lkml.org 
[lkml]   [2013]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf session: Add option to copy events when queueing
On 10/2/13 6:38 AM, Jiri Olsa wrote:
>>> Examples hitting this problem are 'perf kvm stat live', especially with nested
>>> VMs which generate 100,000+ traces per second, and a command processing
>>> scheduling events with a high rate of context switching -- e.g., running
>>> 'perf bench sched pipe'.
>>>
>>> This patch offers live commands an option to copy the event when it is
>>> placed in
>>> the ordered samples queue.
>
> So I guess you have some other patch that actually sets
> session::copy_on_queue?

Yes, with this patch commands have to set session->copy_on_queue to true.

My latest perf-sched-daemon code actually solves this another way:
rather than asking perf-session to copy the events, the command itself
does and passes the copied event to the perf-session processing code.

I like this design better because the command itself controls the
allocation and free which the daemon needs because the events are added
to another queue so the flow is:

read from mmmap --> copy event --> pass to session code for time
ordering --> process time ordered events

The daemon puts the time ordered events into a time-limited queue and
only processes the event when requested.

If that is too confusing take a look at:

https://github.com/dsahern/linux/blob/perf-sched-timehist-3.11/tools/perf/schedmon.c

process_event is the handler for sample events coming out of the mmaps.
It allocates memory, copies the event and then calls
perf_session_queue_event on the copy.

David



\
 
 \ /
  Last update: 2013-10-02 15:21    [W:0.036 / U:0.692 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site