* [PATCH v2 0/2] minor fixes for perf cs-etm
@ 2019-03-21 2:31 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
` (2 more replies)
0 siblings, 3 replies; 8+ 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: YueHaibing, linux-kernel, linux-arm-kernel
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(-)
--
2.7.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 8+ messages in thread
* [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-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, 1 reply; 8+ 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: YueHaibing, linux-kernel, linux-arm-kernel
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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 8+ 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-06-04 8:50 ` [PATCH v2 0/2] minor fixes for perf cs-etm Yuehaibing
2 siblings, 1 reply; 8+ 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: YueHaibing, linux-kernel, linux-arm-kernel
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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 8+ 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
0 siblings, 0 replies; 8+ 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, Linux Kernel Mailing List,
Arnaldo Carvalho de Melo, Alexander Shishkin, Ingo Molnar,
Namhyung Kim, Jiri Olsa, 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.
>
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 8+ 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
0 siblings, 0 replies; 8+ 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, Linux Kernel Mailing List,
Arnaldo Carvalho de Melo, Alexander Shishkin, Ingo Molnar,
Namhyung Kim, Jiri Olsa, 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.
>
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 8+ 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; 8+ 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(-)
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 8+ 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; 8+ 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(-)
>>
>
>
> .
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 8+ 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; 8+ messages in thread
From: Arnaldo Carvalho de Melo @ 2019-07-11 15:46 UTC (permalink / raw)
To: Yuehaibing
Cc: mathieu.poirier, suzuki.poulose, peterz, arnaldo.melo,
linux-kernel, alexander.shishkin, mingo, namhyung, jolsa,
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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2019-07-11 15:46 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 16:42 ` Mathieu Poirier
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-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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).