linux-hardened/kernel/events
Andrew Vagin 5d81e5cfb3 events: Don't divide events if it has field period
This patch solves the following problem:

Now some samples may be lost due to throttling. The number of samples is
restricted by sysctl_perf_event_sample_rate/HZ.  A trace event is
divided on some samples according to event's period.  I don't sure, that
we should generate more than one sample on each trace event. I think the
better way to use SAMPLE_PERIOD.

E.g.: I want to trace when a process sleeps. I created a process, which
sleeps for 1ms and for 4ms.  perf got 100 events in both cases.

swapper     0 [000]  1141.371830: sched_stat_sleep: comm=foo pid=1801 delay=1386750 [ns]
swapper     0 [000]  1141.369444: sched_stat_sleep: comm=foo pid=1801 delay=4499585 [ns]

In the first case a kernel want to send 4499585 events and
in the second case it wants to send 1386750 events.
perf-reports shows that process sleeps in both places equal time. It's
bug.

With this patch kernel generates one event on each "sleep" and the time
slice is saved in the field "period". Perf knows how handle it.

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1320670457-2633428-3-git-send-email-avagin@openvz.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2011-11-14 13:31:28 +01:00
..
callchain.c perf: Carve out callchain functionality 2011-11-14 13:31:26 +01:00
core.c events: Don't divide events if it has field period 2011-11-14 13:31:28 +01:00
hw_breakpoint.c perf: Add context field to perf_event 2011-07-01 11:06:38 +02:00
internal.h perf: Carve out callchain functionality 2011-11-14 13:31:26 +01:00
Makefile perf: Carve out callchain functionality 2011-11-14 13:31:26 +01:00
ring_buffer.c perf: Remove the perf_output_begin(.sample) argument 2011-07-01 11:06:35 +02:00