Commit 6285bd15 authored by YueHaibing's avatar YueHaibing Committed by Arnaldo Carvalho de Melo

perf cs-etm: Return errcode in cs_etm__process_auxtrace_info()

The 'err' variable is set in the error path, but it's not returned to
callers.  Don't always return -EINVAL, return err.
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Reviewed-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Fixes: cd8bfd8c ("perf tools: Add processing of coresight metadata")
Link: http://lkml.kernel.org/r/20190321023122.21332-3-yuehaibing@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent edc82a99
...@@ -2517,8 +2517,10 @@ int cs_etm__process_auxtrace_info(union perf_event *event, ...@@ -2517,8 +2517,10 @@ int cs_etm__process_auxtrace_info(union perf_event *event,
session->auxtrace = &etm->auxtrace; session->auxtrace = &etm->auxtrace;
etm->unknown_thread = thread__new(999999999, 999999999); etm->unknown_thread = thread__new(999999999, 999999999);
if (!etm->unknown_thread) if (!etm->unknown_thread) {
err = -ENOMEM;
goto err_free_queues; goto err_free_queues;
}
/* /*
* Initialize list node so that at thread__zput() we can avoid * Initialize list node so that at thread__zput() we can avoid
...@@ -2530,8 +2532,10 @@ int cs_etm__process_auxtrace_info(union perf_event *event, ...@@ -2530,8 +2532,10 @@ int cs_etm__process_auxtrace_info(union perf_event *event,
if (err) if (err)
goto err_delete_thread; goto err_delete_thread;
if (thread__init_map_groups(etm->unknown_thread, etm->machine)) if (thread__init_map_groups(etm->unknown_thread, etm->machine)) {
err = -ENOMEM;
goto err_delete_thread; goto err_delete_thread;
}
if (dump_trace) { if (dump_trace) {
cs_etm__print_auxtrace_info(auxtrace_info->priv, num_cpu); cs_etm__print_auxtrace_info(auxtrace_info->priv, num_cpu);
...@@ -2575,5 +2579,5 @@ int cs_etm__process_auxtrace_info(union perf_event *event, ...@@ -2575,5 +2579,5 @@ int cs_etm__process_auxtrace_info(union perf_event *event,
err_free_hdr: err_free_hdr:
zfree(&hdr); zfree(&hdr);
return -EINVAL; return err;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment