diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-07-21 07:19:40 -0400 |
---|---|---|
committer | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-07-22 12:05:56 -0400 |
commit | 7f453c24b95a085fc7bd35d53b33abc4dc5a048b (patch) | |
tree | 63d2b80acb3095a3e1a56c69d20a8137a1337aed /tools/perf/builtin-report.c | |
parent | 573402db02746179b3f95f83a11a787501f52d0a (diff) |
perf_counter: PERF_SAMPLE_ID and inherited counters
Anton noted that for inherited counters the counter-id as provided by
PERF_SAMPLE_ID isn't mappable to the id found through PERF_RECORD_ID
because each inherited counter gets its own id.
His suggestion was to always return the parent counter id, since that
is the primary counter id as exposed. However, these inherited
counters have a unique identifier so that events like
PERF_EVENT_PERIOD and PERF_EVENT_THROTTLE can be specific about which
counter gets modified, which is important when trying to normalize the
sample streams.
This patch removes PERF_EVENT_PERIOD in favour of PERF_SAMPLE_PERIOD,
which is more useful anyway, since changing periods became a lot more
common than initially thought -- rendering PERF_EVENT_PERIOD the less
useful solution (also, PERF_SAMPLE_PERIOD reports the more accurate
value, since it reports the value used to trigger the overflow,
whereas PERF_EVENT_PERIOD simply reports the requested period changed,
which might only take effect on the next cycle).
This still leaves us PERF_EVENT_THROTTLE to consider, but since that
_should_ be a rare occurrence, and linking it to a primary id is the
most useful bit to diagnose the problem, we introduce a
PERF_SAMPLE_STREAM_ID, for those few cases where the full
reconstruction is important.
[Does change the ABI a little, but I see no other way out]
Suggested-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1248095846.15751.8781.camel@twins>
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r-- | tools/perf/builtin-report.c | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index a118bc77286d..b20a4b6e31b7 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -101,13 +101,6 @@ struct fork_event { | |||
101 | u32 pid, ppid; | 101 | u32 pid, ppid; |
102 | }; | 102 | }; |
103 | 103 | ||
104 | struct period_event { | ||
105 | struct perf_event_header header; | ||
106 | u64 time; | ||
107 | u64 id; | ||
108 | u64 sample_period; | ||
109 | }; | ||
110 | |||
111 | struct lost_event { | 104 | struct lost_event { |
112 | struct perf_event_header header; | 105 | struct perf_event_header header; |
113 | u64 id; | 106 | u64 id; |
@@ -127,7 +120,6 @@ typedef union event_union { | |||
127 | struct mmap_event mmap; | 120 | struct mmap_event mmap; |
128 | struct comm_event comm; | 121 | struct comm_event comm; |
129 | struct fork_event fork; | 122 | struct fork_event fork; |
130 | struct period_event period; | ||
131 | struct lost_event lost; | 123 | struct lost_event lost; |
132 | struct read_event read; | 124 | struct read_event read; |
133 | } event_t; | 125 | } event_t; |
@@ -1636,19 +1628,6 @@ process_fork_event(event_t *event, unsigned long offset, unsigned long head) | |||
1636 | } | 1628 | } |
1637 | 1629 | ||
1638 | static int | 1630 | static int |
1639 | process_period_event(event_t *event, unsigned long offset, unsigned long head) | ||
1640 | { | ||
1641 | dprintf("%p [%p]: PERF_EVENT_PERIOD: time:%Ld, id:%Ld: period:%Ld\n", | ||
1642 | (void *)(offset + head), | ||
1643 | (void *)(long)(event->header.size), | ||
1644 | event->period.time, | ||
1645 | event->period.id, | ||
1646 | event->period.sample_period); | ||
1647 | |||
1648 | return 0; | ||
1649 | } | ||
1650 | |||
1651 | static int | ||
1652 | process_lost_event(event_t *event, unsigned long offset, unsigned long head) | 1631 | process_lost_event(event_t *event, unsigned long offset, unsigned long head) |
1653 | { | 1632 | { |
1654 | dprintf("%p [%p]: PERF_EVENT_LOST: id:%Ld: lost:%Ld\n", | 1633 | dprintf("%p [%p]: PERF_EVENT_LOST: id:%Ld: lost:%Ld\n", |
@@ -1729,9 +1708,6 @@ process_event(event_t *event, unsigned long offset, unsigned long head) | |||
1729 | case PERF_EVENT_FORK: | 1708 | case PERF_EVENT_FORK: |
1730 | return process_fork_event(event, offset, head); | 1709 | return process_fork_event(event, offset, head); |
1731 | 1710 | ||
1732 | case PERF_EVENT_PERIOD: | ||
1733 | return process_period_event(event, offset, head); | ||
1734 | |||
1735 | case PERF_EVENT_LOST: | 1711 | case PERF_EVENT_LOST: |
1736 | return process_lost_event(event, offset, head); | 1712 | return process_lost_event(event, offset, head); |
1737 | 1713 | ||