diff options
author | tangmeng <tangmeng@uniontech.com> | 2022-02-16 04:04:25 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-02-16 14:38:03 +0100 |
commit | 662a9810fcca3d9b3435187d45b759b9649c4551 (patch) | |
tree | 6006190e095ff518e314072fd6af32742b87d4c4 | |
parent | perf test: Make metric testing more robust (diff) | |
download | linux-662a9810fcca3d9b3435187d45b759b9649c4551.tar.xz linux-662a9810fcca3d9b3435187d45b759b9649c4551.zip |
perf top: Remove redundant 'err' variable
The variable 'err' in the perf_event__process_sample() is only used in
the only one judgment statement, it is not used in other places.
So, use the return value from hist_entry_iter__add() directly instead of
taking this in another redundant variable.
Signed-off-by: tangmeng <tangmeng@uniontech.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20220216030425.27779-2-tangmeng@uniontech.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/builtin-top.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 1e25aa0862bc..9b08e44a31d9 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -746,7 +746,6 @@ static void perf_event__process_sample(struct perf_tool *tool, { struct perf_top *top = container_of(tool, struct perf_top, tool); struct addr_location al; - int err; if (!machine && perf_guest) { static struct intlist *seen; @@ -839,8 +838,7 @@ static void perf_event__process_sample(struct perf_tool *tool, pthread_mutex_lock(&hists->lock); - err = hist_entry_iter__add(&iter, &al, top->max_stack, top); - if (err < 0) + if (hist_entry_iter__add(&iter, &al, top->max_stack, top) < 0) pr_err("Problem incrementing symbol period, skipping event\n"); pthread_mutex_unlock(&hists->lock); |