diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-06-25 05:27:12 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-06-25 15:39:08 -0400 |
commit | e6e18ec79b023d5fe84226cef533cf0e3770ce93 (patch) | |
tree | 6fc1bd9afd21454864abe2aec6a0e35e17d47f04 /tools/perf/builtin-top.c | |
parent | bfbd3381e63aa2a14c6706afb50ce4630aa0d9a2 (diff) |
perf_counter: Rework the sample ABI
The PERF_EVENT_READ implementation made me realize we don't
actually need the sample_type int the output sample, since
we already have that in the perf_counter_attr information.
Therefore, remove the PERF_EVENT_MISC_OVERFLOW bit and the
event->type overloading, and imply put counter overflow
samples in a PERF_EVENT_SAMPLE type.
This also fixes the issue that event->type was only 32-bit
and sample_type had 64 usable bits.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r-- | tools/perf/builtin-top.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 5352b5e352ed..cf0d21f1ae10 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -392,11 +392,11 @@ static void record_ip(u64 ip, int counter) | |||
392 | samples--; | 392 | samples--; |
393 | } | 393 | } |
394 | 394 | ||
395 | static void process_event(u64 ip, int counter) | 395 | static void process_event(u64 ip, int counter, int user) |
396 | { | 396 | { |
397 | samples++; | 397 | samples++; |
398 | 398 | ||
399 | if (ip < min_ip || ip > max_ip) { | 399 | if (user) { |
400 | userspace_samples++; | 400 | userspace_samples++; |
401 | return; | 401 | return; |
402 | } | 402 | } |
@@ -509,9 +509,10 @@ static void mmap_read_counter(struct mmap_data *md) | |||
509 | 509 | ||
510 | old += size; | 510 | old += size; |
511 | 511 | ||
512 | if (event->header.misc & PERF_EVENT_MISC_OVERFLOW) { | 512 | if (event->header.type == PERF_EVENT_SAMPLE) { |
513 | if (event->header.type & PERF_SAMPLE_IP) | 513 | int user = |
514 | process_event(event->ip.ip, md->counter); | 514 | (event->header.misc & PERF_EVENT_MISC_CPUMODE_MASK) == PERF_EVENT_MISC_USER; |
515 | process_event(event->ip.ip, md->counter, user); | ||
515 | } | 516 | } |
516 | } | 517 | } |
517 | 518 | ||