diff options
author | Brice Goglin <Brice.Goglin@inria.fr> | 2009-08-07 07:55:24 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-08-09 07:04:20 -0400 |
commit | 8d51327090ac025d7f4ce6c059786b5e93513321 (patch) | |
tree | 32576a197af970ac698c7888c67235e8f723fa67 /tools/perf/util/values.h | |
parent | 30dd568c912602b7dbd609a45d053e01b13422bb (diff) |
perf report: Fix and improve the displaying of per-thread event counters
Improve and fix the handling of per-thread counter stats
recorded via perf record -s. Previously we only displayed
it in debug printouts (-D) and even that output was hard
to disambiguate.
I moved everything to utils/values.[ch] so that we may reuse
it in perf stat.
We get something like this now:
# PID TID cache-misses cache-references
4658 4659 495581 3238779
4658 4662 498246 3236823
4658 4663 499531 3243162
Then it'll be easy to add --pretty=raw to display a single line per thread/event.
By the way, -S was also used for --symbol... So I used -T/--thread here.
perf report: Add -T/--threads to display per-thread counter values
We get something like this now:
# PID TID cache-misses cache-references
4658 4659 495581 3238779
4658 4662 498246 3236823
4658 4663 499531 3243162
Per-thread arrays of counter values are managed in utils/values.[ch]
Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: paulus@samba.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/values.h')
-rw-r--r-- | tools/perf/util/values.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/perf/util/values.h b/tools/perf/util/values.h new file mode 100644 index 000000000000..e41be5e86e6b --- /dev/null +++ b/tools/perf/util/values.h | |||
@@ -0,0 +1,26 @@ | |||
1 | #ifndef _PERF_VALUES_H | ||
2 | #define _PERF_VALUES_H | ||
3 | |||
4 | #include "types.h" | ||
5 | |||
6 | struct perf_read_values { | ||
7 | int threads; | ||
8 | int threads_max; | ||
9 | u32 *pid, *tid; | ||
10 | int counters; | ||
11 | int counters_max; | ||
12 | u64 *counterrawid; | ||
13 | char **countername; | ||
14 | u64 **value; | ||
15 | }; | ||
16 | |||
17 | void perf_read_values_init(struct perf_read_values *values); | ||
18 | void perf_read_values_destroy(struct perf_read_values *values); | ||
19 | |||
20 | void perf_read_values_add_value(struct perf_read_values *values, | ||
21 | u32 pid, u32 tid, | ||
22 | u64 rawid, char *name, u64 value); | ||
23 | |||
24 | void perf_read_values_display(FILE *fp, struct perf_read_values *values); | ||
25 | |||
26 | #endif /* _PERF_VALUES_H */ | ||