* unconditionally enable the trace buffer
@ 2005-10-25 16:40 Rob Gardner
0 siblings, 0 replies; 6+ messages in thread
From: Rob Gardner @ 2005-10-25 16:40 UTC (permalink / raw)
To: xen-devel
Last month Mark Williamson sent out a patch to unconditionally enable
the trace buffer. I'd like to suggest that his patch be accepted and
merged. I have performed some simple benchmarks to quantify the overhead
associated with the trace buffer and calls, and found a negligable
performance loss due to them. The actual number was .069%, and was
gotten by timing a simple cpu-intensive task running with trace buffers
compiled in and again with trace buffers not compiled in. It's important
for us to have the trace buffer functionality totally enabled by
default, so we can depend on its availability for running XenMon without
requiring recompiling and rebooting.
Thanks,
Rob Gardner (HP)
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: unconditionally enable the trace buffer
@ 2005-10-27 19:45 Ian Pratt
2005-10-27 22:08 ` Rob Gardner
0 siblings, 1 reply; 6+ messages in thread
From: Ian Pratt @ 2005-10-27 19:45 UTC (permalink / raw)
To: Rob Gardner, xen-devel
> Last month Mark Williamson sent out a patch to
> unconditionally enable the trace buffer. I'd like to suggest
> that his patch be accepted and merged. I have performed some
> simple benchmarks to quantify the overhead associated with
> the trace buffer and calls, and found a negligable
> performance loss due to them. The actual number was .069%,
> and was gotten by timing a simple cpu-intensive task running
> with trace buffers compiled in and again with trace buffers
> not compiled in.
Of course, a cpu intensive workload is likely to be generating fewest
trace events. I doubt the overhead is a big deal, though.
I haven't looked at xentrace in a while, but last time I did it could
seriously do with some tidying up. Here's a list of features I'd like to
see it have. I'd be grateful if you could tell me what the current state
is:
* ability to turn on/off via hypercall
* trace events grouped by type, with a bitmap to enable the event types
of interest
* ability to set the per CPU tracebuffer size when turning it on
* ability for the user-space reader to explicitly block (select on fd)
on an eventchn notification that the buffer is e.g. half full. (reader
should write out all the pages that are full of trace events)
* user space reader should log when it misses blocks of events
(overwrite last trace message in buffer with a special 'missed X events'
message)
Thanks,
Ian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: unconditionally enable the trace buffer
2005-10-27 19:45 Ian Pratt
@ 2005-10-27 22:08 ` Rob Gardner
2005-10-27 23:21 ` Mark Williamson
0 siblings, 1 reply; 6+ messages in thread
From: Rob Gardner @ 2005-10-27 22:08 UTC (permalink / raw)
To: Ian Pratt; +Cc: xen-devel
Ian Pratt wrote:
>I haven't looked at xentrace in a while, but last time I did it could
>seriously do with some tidying up. Here's a list of features I'd like to
>see it have. I'd be grateful if you could tell me what the current state
>is:
>
>* ability to turn on/off via hypercall
>
>
Not currently implemented, but would not be difficult to add.
>* trace events grouped by type, with a bitmap to enable the event types
>of interest
>
>
This functionality is in there already.
>* ability to set the per CPU tracebuffer size when turning it on
>
>
Partially; You can enable the trace buffer on the xen (boot) command
line, and you can specify the trace buffer size there. You cannot change
the size dynamically.
>* ability for the user-space reader to explicitly block (select on fd)
>on an eventchn notification that the buffer is e.g. half full. (reader
>should write out all the pages that are full of trace events)
>
>
Not done.
>* user space reader should log when it misses blocks of events
>(overwrite last trace message in buffer with a special 'missed X events'
>message)
>
>
>
Not done, but my XenMon patch includes a change to the trace buffer code
to help with this. I've added a "sequence number" to each trace record
which can be used to detect when blocks of events have been missed.
Rob Gardner
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: unconditionally enable the trace buffer
2005-10-27 22:08 ` Rob Gardner
@ 2005-10-27 23:21 ` Mark Williamson
0 siblings, 0 replies; 6+ messages in thread
From: Mark Williamson @ 2005-10-27 23:21 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Pratt, Rob Gardner
> >* ability to turn on/off via hypercall
>
> Not currently implemented, but would not be difficult to add.
Just as an aside I'm not sure this matters: From what Rob's told me, having
the (inline) trace() calls in there produces the same overhead whether
tracing is active or not. I guess it makes sense; once you've incurred the
overhead of having the function there and evaluating the "is tracing on"
conditional, you might as well have stored a few values also ;-)
> >* ability to set the per CPU tracebuffer size when turning it on
>
> Partially; You can enable the trace buffer on the xen (boot) command
> line, and you can specify the trace buffer size there. You cannot change
> the size dynamically.
Aside #2: You can disable at boot time by setting size=0.
> >* ability for the user-space reader to explicitly block (select on fd)
> >on an eventchn notification that the buffer is e.g. half full. (reader
> >should write out all the pages that are full of trace events)
>
> Not done.
We can just block on /dev/evtchn, I guess. Shouldn't be too hard; we just
need to define a new "trace" virq.
> >* user space reader should log when it misses blocks of events
> >(overwrite last trace message in buffer with a special 'missed X events'
> >message)
>
> Not done, but my XenMon patch includes a change to the trace buffer code
> to help with this. I've added a "sequence number" to each trace record
> which can be used to detect when blocks of events have been missed.
Yep, sounds good to me.
Cheers,
Mark0
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: unconditionally enable the trace buffer
@ 2005-10-28 0:24 Ian Pratt
2005-10-28 6:45 ` Rob Gardner
0 siblings, 1 reply; 6+ messages in thread
From: Ian Pratt @ 2005-10-28 0:24 UTC (permalink / raw)
To: Mark Williamson, xen-devel; +Cc: Rob Gardner
> > >* ability to turn on/off via hypercall
> >
> > Not currently implemented, but would not be difficult to add.
>
> Just as an aside I'm not sure this matters: From what Rob's
> told me, having the (inline) trace() calls in there produces
> the same overhead whether tracing is active or not. I guess
> it makes sense; once you've incurred the overhead of having
> the function there and evaluating the "is tracing on"
> conditional, you might as well have stored a few values also ;-)
We could cache miss on reading the tracebuffer producer counter and
tracebuffer base address, so its not totally a done deal.
I don't have a big worry about performance, but I'd feel more
comfortable to see a more realistic assesment of overhead. Comparing
results from ttcp in a domU with 128k sock buf and the MTU set to 552
bytes should do it.
> > >* ability to set the per CPU tracebuffer size when turning it on
> >
> > Partially; You can enable the trace buffer on the xen
> (boot) command
> > line, and you can specify the trace buffer size there. You cannot
> > change the size dynamically.
>
> Aside #2: You can disable at boot time by setting size=0.
Ideally, it should be set as part of the hypercall to turn tracing on.
> > >* ability for the user-space reader to explicitly block (select on
> > >fd) on an eventchn notification that the buffer is e.g. half full.
> > >(reader should write out all the pages that are full of
> trace events)
> >
> > Not done.
>
> We can just block on /dev/evtchn, I guess. Shouldn't be too
> hard; we just need to define a new "trace" virq.
The polling stuff totally sucks, and we definitely need the virq.
> > >* user space reader should log when it misses blocks of events
> > >(overwrite last trace message in buffer with a special
> 'missed X events'
> > >message)
> >
> > Not done, but my XenMon patch includes a change to the trace buffer
> > code to help with this. I've added a "sequence number" to
> each trace
> > record which can be used to detect when blocks of events
> have been missed.
My scheme avoids burning tracebuffer memory, but OK.
Ian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: unconditionally enable the trace buffer
2005-10-28 0:24 unconditionally enable the trace buffer Ian Pratt
@ 2005-10-28 6:45 ` Rob Gardner
0 siblings, 0 replies; 6+ messages in thread
From: Rob Gardner @ 2005-10-28 6:45 UTC (permalink / raw)
To: Ian Pratt; +Cc: xen-devel, Mark Williamson
Ian Pratt wrote:
>>>>* ability to turn on/off via hypercall
>>>>
>>>>
>>>Not currently implemented, but would not be difficult to add.
>>>
>>>
>>Just as an aside I'm not sure this matters: From what Rob's
>>told me, having the (inline) trace() calls in there produces
>>the same overhead whether tracing is active or not. I guess
>>it makes sense; once you've incurred the overhead of having
>>the function there and evaluating the "is tracing on"
>>conditional, you might as well have stored a few values also ;-)
>>
>>
>We could cache miss on reading the tracebuffer producer counter and
>tracebuffer base address, so its not totally a done deal.
>
>I don't have a big worry about performance, but I'd feel more
>comfortable to see a more realistic assesment of overhead. Comparing
>results from ttcp in a domU with 128k sock buf and the MTU set to 552
>bytes should do it.
>
>
I just completed some benchmarks using ttcp as Ian suggests. I was
surprised by the results, but essentially, Ian's intuition n this case
may be right on the money. I tested three cases:
1. trace buffers turned off, that is not compiled in
2. trace buffers compiled in and turned on
3. trace buffers compiled in but disabled
Cases 1 and 3 show no performance difference at all, but case 2 does
show a non-trivial degradation.
Details of the benchmarking: ttcp using 128k buffers to send data to a
domU from another machine using a gigabit network. 2gb were transferred
in each run, and 10 runs were performed for each case. Dom0 and domU
together used up just about all of a cpu, and experienced 2000-2500
context switches per second to handle 40-50,000 I/O's per second. Please
note that the additional trace events for XenMon were enabled in this
system (case 2) so each of those 50,000 I/O's each second generates a
trace record!
I conclude the following from this:
- there is no penalty for simply having the trace buffer code compiled
into xen
- there is a penalty for enabling tracing
- therefore, the ability to turn tracing on/off via a hypercall is
definitely important
Rob
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-10-28 6:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-28 0:24 unconditionally enable the trace buffer Ian Pratt
2005-10-28 6:45 ` Rob Gardner
-- strict thread matches above, loose matches on Subject: below --
2005-10-27 19:45 Ian Pratt
2005-10-27 22:08 ` Rob Gardner
2005-10-27 23:21 ` Mark Williamson
2005-10-25 16:40 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.