aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/annotate.c
diff options
context:
space:
mode:
authorJiri Olsa <[email protected]>2017-11-15 11:05:59 +0000
committerArnaldo Carvalho de Melo <[email protected]>2017-11-17 15:16:25 +0000
commit9e4e0a9d2ef37c7bc60c32e2a3189bd1f04067a5 (patch)
tree7ccc19bd67c1edd7fd8a299a4d102669c025accc /tools/perf/util/annotate.c
parentperf top: Fix crash when annotating symbol (diff)
downloadkernel-9e4e0a9d2ef37c7bc60c32e2a3189bd1f04067a5.tar.gz
kernel-9e4e0a9d2ef37c7bc60c32e2a3189bd1f04067a5.zip
perf tools: Change (symbol|annotation)__calc_percent return type to void
There's no need for symbol__calc_percent and annotation__calc_percent functions to return any value, since it's always zero. Changing both function to return void. Signed-off-by: Jiri Olsa <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: David Ahern <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Wang Nan <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/util/annotate.c')
-rw-r--r--tools/perf/util/annotate.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 30d74dabdc42..846abb4955ac 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -1584,8 +1584,8 @@ static void calc_percent(struct sym_hist *hist,
}
}
-static int annotation__calc_percent(struct annotation *notes,
- struct perf_evsel *evsel, s64 len)
+static void annotation__calc_percent(struct annotation *notes,
+ struct perf_evsel *evsel, s64 len)
{
struct annotation_line *al, *next;
@@ -1609,15 +1609,13 @@ static int annotation__calc_percent(struct annotation *notes,
calc_percent(hist, sample, al->offset, end);
}
}
-
- return 0;
}
-int symbol__calc_percent(struct symbol *sym, struct perf_evsel *evsel)
+void symbol__calc_percent(struct symbol *sym, struct perf_evsel *evsel)
{
struct annotation *notes = symbol__annotation(sym);
- return annotation__calc_percent(notes, evsel, symbol__size(sym));
+ annotation__calc_percent(notes, evsel, symbol__size(sym));
}
int symbol__annotate(struct symbol *sym, struct map *map,
@@ -1656,10 +1654,11 @@ int symbol__annotate(struct symbol *sym, struct map *map,
}
err = symbol__disassemble(sym, &args);
- if (err)
- return err;
+ if (!err)
+ symbol__calc_percent(sym, evsel);
+
+ return err;
- return symbol__calc_percent(sym, evsel);
}
static void insert_source_line(struct rb_root *root, struct annotation_line *al)