aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-trace.c
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2013-12-04 21:41:41 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-12-05 08:09:58 -0500
commit3160565f0e005d2ec736ae25cf0a79988c0cbe71 (patch)
treef2164ae21d3ad54e605ca91f96e111474e5123fd /tools/perf/builtin-trace.c
parent9aca7f1792c5d2d5d367bbe5cfe204fe40517929 (diff)
perf trace: Fix summary percentage when processing files
Getting a divide by 0 when events are processed from a file: perf trace -i perf.data -s ... dnsmasq (1684), 10 events, inf%, 0.000 msec The problem is that the event count is not incremented as events are processed. With this patch: perf trace -i perf.data -s ... dnsmasq (1684), 10 events, 8.9%, 0.000 msec Signed-off-by: David Ahern <dsahern@gmail.com> Link: http://lkml.kernel.org/r/1386211302-31303-4-git-send-email-dsahern@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-trace.c')
-rw-r--r--tools/perf/builtin-trace.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index a7aa771a98e6..56bbca5bc2dc 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -1770,8 +1770,10 @@ static int trace__process_sample(struct perf_tool *tool,
1770 if (!trace->full_time && trace->base_time == 0) 1770 if (!trace->full_time && trace->base_time == 0)
1771 trace->base_time = sample->time; 1771 trace->base_time = sample->time;
1772 1772
1773 if (handler) 1773 if (handler) {
1774 ++trace->nr_events;
1774 handler(trace, evsel, sample); 1775 handler(trace, evsel, sample);
1776 }
1775 1777
1776 return err; 1778 return err;
1777} 1779}