提交 662a9810 编写于 作者: T tangmeng 提交者: Arnaldo Carvalho de Melo

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: Ntangmeng <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.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 87a73bdc
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册