diff options
| author | Jin Yao <[email protected]> | 2019-11-07 07:47:15 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2019-11-07 12:14:15 +0000 |
| commit | 7841f40aed933dd3838f8d9f2dfcf286c352b7ee (patch) | |
| tree | 9047a617dac0d44a89eb4c3248c1a3bf660a5ef0 /tools/perf/builtin-diff.c | |
| parent | perf block: Cleanup and refactor block info functions (diff) | |
| download | kernel-7841f40aed933dd3838f8d9f2dfcf286c352b7ee.tar.gz kernel-7841f40aed933dd3838f8d9f2dfcf286c352b7ee.zip | |
perf hist: Count the total cycles of all samples
We can get the per sample cycles by hist__account_cycles(). It's also
useful to know the total cycles of all samples in order to get the
cycles coverage for a single program block in further. For example:
coverage = per block sampled cycles / total sampled cycles
This patch creates a new argument 'total_cycles' in hist__account_cycles(),
which will be added with the cycles of each sample.
Signed-off-by: Jin Yao <[email protected]>
Reviewed-by: Jiri Olsa <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: Jin Yao <[email protected]>
Cc: Kan Liang <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lore.kernel.org/lkml/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/builtin-diff.c')
| -rw-r--r-- | tools/perf/builtin-diff.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c index 6728568fe5c4..376dbf10ad64 100644 --- a/tools/perf/builtin-diff.c +++ b/tools/perf/builtin-diff.c @@ -426,7 +426,8 @@ static int diff__process_sample_event(struct perf_tool *tool, goto out_put; } - hist__account_cycles(sample->branch_stack, &al, sample, false); + hist__account_cycles(sample->branch_stack, &al, sample, false, + NULL); } /* |
