diff mbox series

[v3,8/9] perf mem: Return NULL for event 'ldst' on PowerPC

Message ID 20201028063813.8562-9-leo.yan@linaro.org (mailing list archive)
State New, archived
Headers show
Series perf mem/c2c: Support AUX trace | expand

Commit Message

Leo Yan Oct. 28, 2020, 6:38 a.m. UTC
If user specifies event type "ldst", PowerPC's perf_mem_events__name()
will wrongly return the store event name "cpu/mem-stores/".

This patch changes to return NULL for the event "ldst" on PowerPC.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 tools/perf/arch/powerpc/util/mem-events.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Naveen N. Rao Oct. 28, 2020, 9:35 a.m. UTC | #1
[+ Maddy]

Leo Yan wrote:
> If user specifies event type "ldst", PowerPC's perf_mem_events__name()
> will wrongly return the store event name "cpu/mem-stores/".
> 
> This patch changes to return NULL for the event "ldst" on PowerPC.
> 
> Signed-off-by: Leo Yan <leo.yan@linaro.org>
> ---
>  tools/perf/arch/powerpc/util/mem-events.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/arch/powerpc/util/mem-events.c b/tools/perf/arch/powerpc/util/mem-events.c
> index 07fb5e049488..90c5a0760685 100644
> --- a/tools/perf/arch/powerpc/util/mem-events.c
> +++ b/tools/perf/arch/powerpc/util/mem-events.c
> @@ -7,6 +7,8 @@ char *perf_mem_events__name(int i)
>  {
>  	if (i == PERF_MEM_EVENTS__LOAD)
>  		return (char *) "cpu/mem-loads/";
> -
> -	return (char *) "cpu/mem-stores/";
> +	else if (i == PERF_MEM_EVENTS__STORE)
> +		return (char *) "cpu/mem-stores/";
> +	else
> +		return NULL;
>  }
> -- 
> 2.17.1
> 
>
diff mbox series

Patch

diff --git a/tools/perf/arch/powerpc/util/mem-events.c b/tools/perf/arch/powerpc/util/mem-events.c
index 07fb5e049488..90c5a0760685 100644
--- a/tools/perf/arch/powerpc/util/mem-events.c
+++ b/tools/perf/arch/powerpc/util/mem-events.c
@@ -7,6 +7,8 @@  char *perf_mem_events__name(int i)
 {
 	if (i == PERF_MEM_EVENTS__LOAD)
 		return (char *) "cpu/mem-loads/";
-
-	return (char *) "cpu/mem-stores/";
+	else if (i == PERF_MEM_EVENTS__STORE)
+		return (char *) "cpu/mem-stores/";
+	else
+		return NULL;
 }