* [PATCH] xenbaked: Fix access to trace buffer after xentrace changes
@ 2008-04-24 4:38 NISHIGUCHI Naoki
0 siblings, 0 replies; only message in thread
From: NISHIGUCHI Naoki @ 2008-04-24 4:38 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 262 bytes --]
Hi,
Xenmon does not work correctlly after xentrace changes in cs 17000.
Attached patch fixes this problem.
This patch modifies access to trace buffer same as tools/xentrace.
Signed-off-by: Naoki Nishiguchi <nisiguti@jp.fujitsu.com>
Regards,
Naoki Nishiguchi
[-- Attachment #2: xenbaked.patch --]
[-- Type: text/plain, Size: 1666 bytes --]
diff -r 77dec8732cde tools/xenmon/xenbaked.c
--- a/tools/xenmon/xenbaked.c Wed Apr 23 16:58:44 2008 +0100
+++ b/tools/xenmon/xenbaked.c Thu Apr 24 11:19:41 2008 +0900
@@ -509,14 +509,36 @@ int monitor_tbufs(void)
{
for ( i = 0; (i < num) && !interrupted; i++ )
{
- while ( meta[i]->cons != meta[i]->prod )
+ unsigned long start_offset, end_offset, cons, prod;
+
+ cons = meta[i]->cons;
+ prod = meta[i]->prod;
+ xen_rmb(); /* read prod, then read item. */
+
+ if ( cons == prod )
+ continue;
+
+ start_offset = cons % data_size;
+ end_offset = prod % data_size;
+
+ if ( start_offset >= end_offset )
{
- xen_rmb(); /* read prod, then read item. */
+ while ( start_offset != data_size )
+ {
+ rec_size = process_record(
+ i, (struct t_rec *)(data[i] + start_offset));
+ start_offset += rec_size;
+ }
+ start_offset = 0;
+ }
+ while ( start_offset != end_offset )
+ {
rec_size = process_record(
- i, (struct t_rec *)(data[i] + meta[i]->cons % data_size));
- xen_mb(); /* read item, then update cons. */
- meta[i]->cons += rec_size;
+ i, (struct t_rec *)(data[i] + start_offset));
+ start_offset += rec_size;
}
+ xen_mb(); /* read item, then update cons. */
+ meta[i]->cons = prod;
}
wait_for_event();
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-04-24 4:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-24 4:38 [PATCH] xenbaked: Fix access to trace buffer after xentrace changes NISHIGUCHI Naoki
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.