All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: Hi,something about the xentrace tool
@ 2006-06-15  7:06 Ian Pratt
  2006-06-15  8:58 ` [Xen-devel] " rickey berkeley
  2006-06-15 16:41 ` Rob Gardner
  0 siblings, 2 replies; 22+ messages in thread
From: Ian Pratt @ 2006-06-15  7:06 UTC (permalink / raw)
  To: Rob Gardner, NAHieu
  Cc: xen-tools, xen-devel, rickey berkeley, ryanh, xen-users

> If overflow occurs, it is not handled. The mechanism I implemented was
> just designed to drastically reduce the probability of overflow.

It does count the number of lost trace messages and add a trace message
to that effect though, right?

Thanks,
Ian

> Currently, the trace buffer "high water" mark is set to 50%. That is,
> when the hypervisor trace buffer becomes 1/2 full, it sends a soft
> interrupt to wake up xenbaked from its blocking select(). If nobody
> wakes up to read trace records from the trace buffer, I take that to
> mean that nobody cares about the trace records. When somebody does
care,
> they will read those records in a timely manner. Obviously, the
> hypervisor cannot "block" if there is no room in the trace buffers; In
> this case, new trace records simply overwrite old ones, and the old
ones
> are lost.
> 
> If you encounter a situation where trace records are being generated
too
> fast, and fill up the trace buffer too quickly, then the simple next
> step is to increase the size of the trace buffers. So far, use of the
> trace records has not been linked to anything so critical that it's
> necessary to take extraordinary measures to avoid loss of data.
> 
> Rob
> 
> 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread
* RE: Hi,something about the xentrace tool
@ 2006-06-19  7:14 Ian Pratt
  0 siblings, 0 replies; 22+ messages in thread
From: Ian Pratt @ 2006-06-19  7:14 UTC (permalink / raw)
  To: George Dunlap, Rob Gardner
  Cc: xen-tools, xen-devel, xen-users, rickey berkeley

> > Once again, there is no explicit copying of the data between kernel
and
> > user space, so nobody should be worried about it.
> 
> There's no copying from the HV to the xentrace process.  But there is
> copying from xentrace to the dom0 kernel for the output file.  Some
> copying is necessary right now, because rather than writing out the
> pages verbatim, xentrace writes out the pcpu before writing out each
> record:

We have the records in huge per-cpu blocks in memory, then write them
out individually?
That's nuts.

We should keep the IO page aligned, reserving the first record entry of
each block to fill in when we do a write-out to indicate the cpu and
#records in the batch. 

I'd say this fix is less important than logging the number of dropped
records, but if we ever want to reduce the capture overhead in the
future we'll have to fix this.

Ian

 
> void write_rec(unsigned int cpu, struct t_rec *rec, FILE *out)
> {
>     size_t written = 0;
>     written += fwrite(&cpu, sizeof(cpu), 1, out);
>     written += fwrite(rec, sizeof(*rec), 1, out);
>     if ( written != 2 )
>     {
>         PERROR("Failed to write trace record");
>         exit(EXIT_FAILURE);
>     }
> }
> 
> If we wanted to make it zero copy all the way from the HV to the disk,
> we could have the xentrace process one stream per cpu, and do
> whatever's necessary to use DMA.  (Does anyone know if O_DIRECT will
> do direct DMA, or if one would have to use a raw disk?)
> 
> But I think we all seem to agree, this is not a high priority. :-)
> 
>  -George
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread
* RE: Hi,something about the xentrace tool
@ 2006-06-16 14:11 Ian Pratt
  2006-06-16 16:56 ` Rob Gardner
  0 siblings, 1 reply; 22+ messages in thread
From: Ian Pratt @ 2006-06-16 14:11 UTC (permalink / raw)
  To: Rob Gardner
  Cc: xen-tools, xen-devel, rickey berkeley, NAHieu, ryanh, xen-users


> 	It does count the number of lost trace messages and add a trace
> message
> 	to that effect though, right?
>  
> No, but I'll add that to the list of things to do in the future.

I think we really need this. It's trivial to add -- as soon as you fill,
overwrite the last trace record with a new 'lost events' record and bump
a counter in it whenever you try to write a record. When space becomes
available just progress as before.

Ian

^ permalink raw reply	[flat|nested] 22+ messages in thread
* Hi,something about the xentrace tool
@ 2006-06-11 13:17 rickey berkeley
  2006-06-12 15:17 ` George Dunlap 
  2006-06-12 15:30 ` Ryan Harper
  0 siblings, 2 replies; 22+ messages in thread
From: rickey berkeley @ 2006-06-11 13:17 UTC (permalink / raw)
  To: xen-tools, xen-devel, xen-users


[-- Attachment #1.1: Type: text/plain, Size: 1718 bytes --]

Hi folks:

 Recently, I am doing some research on xentrace source code.
 En,actually,I think the xentrace is a very useful tool for xen debug.

 ./xen/include/xen/trace.h
 ./xen/common/trace.c
 etc.
 I got a point very confused in the source code about the trace record.

from man page
            "Where CPU is the processor number, TSC is the record’s
timestamp  (the
            value  of the CPU cycle counter), EVENT is the event ID and
D1...D5 are
            the trace data."

            "Which correspond to the CPU number, event ID, timestamp counter
and
            the 5 data fields from the trace record.   There should be one
such
            rule for each type of event."

 So I just wonder what does these kind of D1....D5 data mean.

 I found the defined the d1-d5 structure in  xen/include/public/trace.h
 59 /* This structure represents a single trace buffer record. */
 60 struct t_rec {
 61     uint64_t cycles;          /* cycle counter timestamp */
 62     uint32_t event;           /* event ID                */
 63     unsigned long data[5];    /* event data items        */
 64 };

 and defined a trace function in ./xen/common/trace.c
 225 void trace(u32 event, unsigned long d1, unsigned long d2,
 226            unsigned long d3, unsigned long d4, unsigned long d5)
 227 {

 But I still can't understand what are these data real meaning
  I never found a place in the source code where this function void
trace(...) had been called.

 Can someone give me a clue about this?
 Or are those interfaces (d1...d5) for developers to define their own
interest to track the event?

 Your rapid reply will be appreciated.
 Thanks.

----
Regards

[-- Attachment #1.2: Type: text/html, Size: 2949 bytes --]

[-- Attachment #2: 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] 22+ messages in thread

end of thread, other threads:[~2006-06-21 19:02 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-15  7:06 Hi,something about the xentrace tool Ian Pratt
2006-06-15  8:58 ` [Xen-devel] " rickey berkeley
2006-06-15 17:03   ` Rob Gardner
2006-06-15 18:20     ` George Dunlap 
2006-06-15 18:28       ` George Dunlap 
2006-06-15 18:53       ` Rob Gardner
2006-06-19  1:06         ` George Dunlap 
2006-06-19  5:00           ` Rob Gardner
2006-06-19 14:02             ` George Dunlap 
2006-06-19 17:19               ` Rob Gardner
2006-06-21 19:02                 ` George Dunlap 
2006-06-15 16:41 ` Rob Gardner
  -- strict thread matches above, loose matches on Subject: below --
2006-06-19  7:14 Ian Pratt
2006-06-16 14:11 Ian Pratt
2006-06-16 16:56 ` Rob Gardner
2006-06-11 13:17 rickey berkeley
2006-06-12 15:17 ` George Dunlap 
2006-06-12 15:30 ` Ryan Harper
2006-06-13 17:11   ` rickey berkeley
2006-06-13 17:25     ` Rob Gardner
2006-06-14  3:47       ` NAHieu
2006-06-14 16:06         ` Rob Gardner

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.