* [PATCH v2 1/2] perf cs-etm: Remove errnoeous ERR_PTR() usage in cs_etm__process_auxtrace_info
2019-03-21 2:31 [PATCH v2 0/2] minor fixes for perf cs-etm Yue Haibing
@ 2019-03-21 2:31 ` Yue Haibing
2019-03-21 16:42 ` Mathieu Poirier
2019-07-17 23:06 ` [tip:perf/urgent] " tip-bot for YueHaibing
2019-03-21 2:31 ` [PATCH v2 2/2] perf cs-etm: return errcode in cs_etm__process_auxtrace_info() Yue Haibing
2019-06-04 8:50 ` [PATCH v2 0/2] minor fixes for perf cs-etm Yuehaibing
2 siblings, 2 replies; 10+ messages in thread
From: Yue Haibing @ 2019-03-21 2:31 UTC (permalink / raw)
To: mathieu.poirier, suzuki.poulose, peterz, mingo, acme,
alexander.shishkin, jolsa, namhyung, arnaldo.melo
Cc: linux-kernel, linux-arm-kernel, YueHaibing
From: YueHaibing <yuehaibing@huawei.com>
intlist__findnew() doesn't uses ERR_PTR() as a return mechanism
so its callers shouldn't try to extract the error using PTR_ERR(
ret) from intlist__findnew(), make cs_etm__process_auxtrace_info
return -ENOMEM instead.
Fixes: cd8bfd8c973e ("perf tools: Add processing of coresight metadata")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
tools/perf/util/cs-etm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
index 1108049..fd7f1da 100644
--- a/tools/perf/util/cs-etm.c
+++ b/tools/perf/util/cs-etm.c
@@ -1908,7 +1908,7 @@ int cs_etm__process_auxtrace_info(union perf_event *event,
/* Something went wrong, no need to continue */
if (!inode) {
- err = PTR_ERR(inode);
+ err = -ENOMEM;
goto err_free_metadata;
}
--
2.7.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/2] perf cs-etm: Remove errnoeous ERR_PTR() usage in cs_etm__process_auxtrace_info
2019-03-21 2:31 ` [PATCH v2 1/2] perf cs-etm: Remove errnoeous ERR_PTR() usage in cs_etm__process_auxtrace_info Yue Haibing
@ 2019-03-21 16:42 ` Mathieu Poirier
2019-07-17 23:06 ` [tip:perf/urgent] " tip-bot for YueHaibing
1 sibling, 0 replies; 10+ messages in thread
From: Mathieu Poirier @ 2019-03-21 16:42 UTC (permalink / raw)
To: Yue Haibing, Arnaldo Carvalho de Melo
Cc: Suzuki K. Poulose, Peter Zijlstra, Ingo Molnar,
Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa,
Namhyung Kim, Linux Kernel Mailing List, linux-arm-kernel
On Wed, 20 Mar 2019 at 20:31, Yue Haibing <yuehaibing@huawei.com> wrote:
>
> From: YueHaibing <yuehaibing@huawei.com>
>
> intlist__findnew() doesn't uses ERR_PTR() as a return mechanism
> so its callers shouldn't try to extract the error using PTR_ERR(
> ret) from intlist__findnew(), make cs_etm__process_auxtrace_info
> return -ENOMEM instead.
>
> Fixes: cd8bfd8c973e ("perf tools: Add processing of coresight metadata")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> tools/perf/util/cs-etm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
> index 1108049..fd7f1da 100644
> --- a/tools/perf/util/cs-etm.c
> +++ b/tools/perf/util/cs-etm.c
> @@ -1908,7 +1908,7 @@ int cs_etm__process_auxtrace_info(union perf_event *event,
>
> /* Something went wrong, no need to continue */
> if (!inode) {
> - err = PTR_ERR(inode);
> + err = -ENOMEM;
> goto err_free_metadata;
> }
>
> --
> 2.7.0
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Arnaldo, please consider adding to your tally.
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [tip:perf/urgent] perf cs-etm: Remove errnoeous ERR_PTR() usage in cs_etm__process_auxtrace_info
2019-03-21 2:31 ` [PATCH v2 1/2] perf cs-etm: Remove errnoeous ERR_PTR() usage in cs_etm__process_auxtrace_info Yue Haibing
2019-03-21 16:42 ` Mathieu Poirier
@ 2019-07-17 23:06 ` tip-bot for YueHaibing
1 sibling, 0 replies; 10+ messages in thread
From: tip-bot for YueHaibing @ 2019-07-17 23:06 UTC (permalink / raw)
To: linux-tip-commits
Cc: hpa, tglx, suzuki.poulose, mathieu.poirier, namhyung,
alexander.shishkin, peterz, yuehaibing, acme, jolsa, mingo,
linux-kernel
Commit-ID: edc82a99437a93c36b0ae18eb6daac0097fc6bd3
Gitweb: https://git.kernel.org/tip/edc82a99437a93c36b0ae18eb6daac0097fc6bd3
Author: YueHaibing <yuehaibing@huawei.com>
AuthorDate: Thu, 21 Mar 2019 10:31:21 +0800
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 11 Jul 2019 12:42:46 -0300
perf cs-etm: Remove errnoeous ERR_PTR() usage in cs_etm__process_auxtrace_info
intlist__findnew() doesn't uses ERR_PTR() as a return mechanism
so its callers shouldn't try to extract the error using PTR_ERR(
ret) from intlist__findnew(), make cs_etm__process_auxtrace_info
return -ENOMEM instead.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Mathieu 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: cd8bfd8c973e ("perf tools: Add processing of coresight metadata")
Link: http://lkml.kernel.org/r/20190321023122.21332-2-yuehaibing@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/cs-etm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
index 67b88b599a53..2e9f5bc45550 100644
--- a/tools/perf/util/cs-etm.c
+++ b/tools/perf/util/cs-etm.c
@@ -2460,7 +2460,7 @@ int cs_etm__process_auxtrace_info(union perf_event *event,
/* Something went wrong, no need to continue */
if (!inode) {
- err = PTR_ERR(inode);
+ err = -ENOMEM;
goto err_free_metadata;
}
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 2/2] perf cs-etm: return errcode in cs_etm__process_auxtrace_info()
2019-03-21 2:31 [PATCH v2 0/2] minor fixes for perf cs-etm Yue Haibing
2019-03-21 2:31 ` [PATCH v2 1/2] perf cs-etm: Remove errnoeous ERR_PTR() usage in cs_etm__process_auxtrace_info Yue Haibing
@ 2019-03-21 2:31 ` Yue Haibing
2019-03-21 16:44 ` Mathieu Poirier
2019-07-17 23:06 ` [tip:perf/urgent] perf cs-etm: Return " tip-bot for YueHaibing
2019-06-04 8:50 ` [PATCH v2 0/2] minor fixes for perf cs-etm Yuehaibing
2 siblings, 2 replies; 10+ messages in thread
From: Yue Haibing @ 2019-03-21 2:31 UTC (permalink / raw)
To: mathieu.poirier, suzuki.poulose, peterz, mingo, acme,
alexander.shishkin, jolsa, namhyung, arnaldo.melo
Cc: linux-kernel, linux-arm-kernel, YueHaibing
From: YueHaibing <yuehaibing@huawei.com>
'err' is set in err path, but it's not returned to callers.
Don't always return -EINVAL, return err.
Fixes: cd8bfd8c973e ("perf tools: Add processing of coresight metadata")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
tools/perf/util/cs-etm.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
index fd7f1da..2cc773a 100644
--- a/tools/perf/util/cs-etm.c
+++ b/tools/perf/util/cs-etm.c
@@ -1965,8 +1965,10 @@ int cs_etm__process_auxtrace_info(union perf_event *event,
session->auxtrace = &etm->auxtrace;
etm->unknown_thread = thread__new(999999999, 999999999);
- if (!etm->unknown_thread)
+ if (!etm->unknown_thread) {
+ err = -ENOMEM;
goto err_free_queues;
+ }
/*
* Initialize list node so that at thread__zput() we can avoid
@@ -1978,8 +1980,10 @@ int cs_etm__process_auxtrace_info(union perf_event *event,
if (err)
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;
+ }
if (dump_trace) {
cs_etm__print_auxtrace_info(auxtrace_info->priv, num_cpu);
@@ -2023,5 +2027,5 @@ int cs_etm__process_auxtrace_info(union perf_event *event,
err_free_hdr:
zfree(&hdr);
- return -EINVAL;
+ return err;
}
--
2.7.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 2/2] perf cs-etm: return errcode in cs_etm__process_auxtrace_info()
2019-03-21 2:31 ` [PATCH v2 2/2] perf cs-etm: return errcode in cs_etm__process_auxtrace_info() Yue Haibing
@ 2019-03-21 16:44 ` Mathieu Poirier
2019-07-17 23:06 ` [tip:perf/urgent] perf cs-etm: Return " tip-bot for YueHaibing
1 sibling, 0 replies; 10+ messages in thread
From: Mathieu Poirier @ 2019-03-21 16:44 UTC (permalink / raw)
To: Yue Haibing, Arnaldo Carvalho de Melo
Cc: Suzuki K. Poulose, Peter Zijlstra, Ingo Molnar,
Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa,
Namhyung Kim, Linux Kernel Mailing List, linux-arm-kernel
On Wed, 20 Mar 2019 at 20:32, Yue Haibing <yuehaibing@huawei.com> wrote:
>
> From: YueHaibing <yuehaibing@huawei.com>
>
> 'err' is set in err path, but it's not returned to callers.
> Don't always return -EINVAL, return err.
>
> Fixes: cd8bfd8c973e ("perf tools: Add processing of coresight metadata")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> tools/perf/util/cs-etm.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
> index fd7f1da..2cc773a 100644
> --- a/tools/perf/util/cs-etm.c
> +++ b/tools/perf/util/cs-etm.c
> @@ -1965,8 +1965,10 @@ int cs_etm__process_auxtrace_info(union perf_event *event,
> session->auxtrace = &etm->auxtrace;
>
> etm->unknown_thread = thread__new(999999999, 999999999);
> - if (!etm->unknown_thread)
> + if (!etm->unknown_thread) {
> + err = -ENOMEM;
> goto err_free_queues;
> + }
>
> /*
> * Initialize list node so that at thread__zput() we can avoid
> @@ -1978,8 +1980,10 @@ int cs_etm__process_auxtrace_info(union perf_event *event,
> if (err)
> 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;
> + }
>
> if (dump_trace) {
> cs_etm__print_auxtrace_info(auxtrace_info->priv, num_cpu);
> @@ -2023,5 +2027,5 @@ int cs_etm__process_auxtrace_info(union perf_event *event,
> err_free_hdr:
> zfree(&hdr);
>
> - return -EINVAL;
> + return err;
> }
> --
> 2.7.0
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Same here Arnaldo, please consider.
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [tip:perf/urgent] perf cs-etm: Return errcode in cs_etm__process_auxtrace_info()
2019-03-21 2:31 ` [PATCH v2 2/2] perf cs-etm: return errcode in cs_etm__process_auxtrace_info() Yue Haibing
2019-03-21 16:44 ` Mathieu Poirier
@ 2019-07-17 23:06 ` tip-bot for YueHaibing
1 sibling, 0 replies; 10+ messages in thread
From: tip-bot for YueHaibing @ 2019-07-17 23:06 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, mingo, jolsa, acme, yuehaibing, alexander.shishkin,
peterz, tglx, suzuki.poulose, mathieu.poirier, hpa, namhyung
Commit-ID: 6285bd151b95aa28d6de9b8b9249702681f059d2
Gitweb: https://git.kernel.org/tip/6285bd151b95aa28d6de9b8b9249702681f059d2
Author: YueHaibing <yuehaibing@huawei.com>
AuthorDate: Thu, 21 Mar 2019 10:31:22 +0800
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 11 Jul 2019 12:45:02 -0300
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: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Mathieu 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: cd8bfd8c973e ("perf tools: Add processing of coresight metadata")
Link: http://lkml.kernel.org/r/20190321023122.21332-3-yuehaibing@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/cs-etm.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
index 2e9f5bc45550..3d1c34fc4d68 100644
--- a/tools/perf/util/cs-etm.c
+++ b/tools/perf/util/cs-etm.c
@@ -2517,8 +2517,10 @@ int cs_etm__process_auxtrace_info(union perf_event *event,
session->auxtrace = &etm->auxtrace;
etm->unknown_thread = thread__new(999999999, 999999999);
- if (!etm->unknown_thread)
+ if (!etm->unknown_thread) {
+ err = -ENOMEM;
goto err_free_queues;
+ }
/*
* 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,
if (err)
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;
+ }
if (dump_trace) {
cs_etm__print_auxtrace_info(auxtrace_info->priv, num_cpu);
@@ -2575,5 +2579,5 @@ err_free_traceid_list:
err_free_hdr:
zfree(&hdr);
- return -EINVAL;
+ return err;
}
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 0/2] minor fixes for perf cs-etm
2019-03-21 2:31 [PATCH v2 0/2] minor fixes for perf cs-etm Yue Haibing
2019-03-21 2:31 ` [PATCH v2 1/2] perf cs-etm: Remove errnoeous ERR_PTR() usage in cs_etm__process_auxtrace_info Yue Haibing
2019-03-21 2:31 ` [PATCH v2 2/2] perf cs-etm: return errcode in cs_etm__process_auxtrace_info() Yue Haibing
@ 2019-06-04 8:50 ` Yuehaibing
2019-07-11 14:33 ` Yuehaibing
2 siblings, 1 reply; 10+ messages in thread
From: Yuehaibing @ 2019-06-04 8:50 UTC (permalink / raw)
To: mathieu.poirier, suzuki.poulose, peterz, mingo, acme,
alexander.shishkin, jolsa, namhyung, arnaldo.melo
Cc: linux-kernel, linux-arm-kernel
Hi,
Friendly ping:
Arnaldo, will you take this serial?
On 2019/3/21 10:31, Yue Haibing wrote:
> From: YueHaibing <yuehaibing@huawei.com>
>
> v2:
> - patch 1 fix commilt log
> - patch 2 use correct Fixes tag
>
> This patch series fixes two issue:
> 1. fix pass-zero-to-ERR_PTR warning
> 2. return correct errcode to upstream callers
>
> YueHaibing (2):
> perf cs-etm: Remove errnoeous ERR_PTR() usage in in
> cs_etm__process_auxtrace_info
> perf cs-etm: return errcode in cs_etm__process_auxtrace_info()
>
> tools/perf/util/cs-etm.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 0/2] minor fixes for perf cs-etm
2019-06-04 8:50 ` [PATCH v2 0/2] minor fixes for perf cs-etm Yuehaibing
@ 2019-07-11 14:33 ` Yuehaibing
2019-07-11 15:46 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 10+ messages in thread
From: Yuehaibing @ 2019-07-11 14:33 UTC (permalink / raw)
To: mathieu.poirier, suzuki.poulose, peterz, mingo, acme,
alexander.shishkin, jolsa, namhyung, arnaldo.melo
Cc: linux-kernel, linux-arm-kernel
Arnaldo, can you pick this?
On 2019/6/4 16:50, Yuehaibing wrote:
> Hi,
>
> Friendly ping:
>
> Arnaldo, will you take this serial?
>
> On 2019/3/21 10:31, Yue Haibing wrote:
>> From: YueHaibing <yuehaibing@huawei.com>
>>
>> v2:
>> - patch 1 fix commilt log
>> - patch 2 use correct Fixes tag
>>
>> This patch series fixes two issue:
>> 1. fix pass-zero-to-ERR_PTR warning
>> 2. return correct errcode to upstream callers
>>
>> YueHaibing (2):
>> perf cs-etm: Remove errnoeous ERR_PTR() usage in in
>> cs_etm__process_auxtrace_info
>> perf cs-etm: return errcode in cs_etm__process_auxtrace_info()
>>
>> tools/perf/util/cs-etm.c | 12 ++++++++----
>> 1 file changed, 8 insertions(+), 4 deletions(-)
>>
>
>
> .
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 0/2] minor fixes for perf cs-etm
2019-07-11 14:33 ` Yuehaibing
@ 2019-07-11 15:46 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 10+ messages in thread
From: Arnaldo Carvalho de Melo @ 2019-07-11 15:46 UTC (permalink / raw)
To: Yuehaibing
Cc: mathieu.poirier, suzuki.poulose, peterz, mingo,
alexander.shishkin, jolsa, namhyung, arnaldo.melo, linux-kernel,
linux-arm-kernel
Em Thu, Jul 11, 2019 at 10:33:09PM +0800, Yuehaibing escreveu:
>
> Arnaldo, can you pick this?
Thanks, and sorry for the delay, fell thru the cracks.
- Arnaldo
^ permalink raw reply [flat|nested] 10+ messages in thread