aboutsummaryrefslogtreecommitdiff
path: root/Documentation/DocBook/procfs_example.c
diff options
context:
space:
mode:
authorLucas De Marchi <[email protected]>2009-11-15 12:05:08 -0200
committerIngo Molnar <[email protected]>2009-11-15 15:25:50 +0100
commit7255fe2a42c612f2b8fe4c347f0a5f0c97d85a46 (patch)
tree188f42ec858fc1caf7a50d8fb92393bd7778d59b /Documentation/DocBook/procfs_example.c
parentd2fb8b4151a92223da6a84006f8f248ebeb6677d (diff)
perf stat: Do not print ratio when task-clock event is not counted
The ratio between the number of events and the time elapsed makes sense only if task-clock event is counted. Otherwise it will be simply a (confusing) # 0.000 M/sec This patch outputs the ratio only if task-clock event is counted. Some test examples of before and after: Before: [lucas@skywalker linux.trees.git]$ sudo perf stat -e branch-misses -a -- sleep 1 Performance counter stats for 'sleep 1': 1367818 branch-misses # 0.000 M/sec 1.001494325 seconds time elapsed After (without task-clock): [lucas@skywalker perf]$ sudo ./perf stat -e branch-misses -a -- sleep 1 Performance counter stats for 'sleep 1': 1135044 branch-misses 1.001370775 seconds time elapsed After (with task-clock): [lucas@skywalker perf]$ sudo ./perf stat -e branch-misses -e task-clock -a -- sleep 1 Performance counter stats for 'sleep 1': 1070111 branch-misses # 0.534 M/sec 2002.730893 task-clock-msecs # 1.999 CPUs 1.001640292 seconds time elapsed Signed-off-by: Lucas De Marchi <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'Documentation/DocBook/procfs_example.c')
0 files changed, 0 insertions, 0 deletions