linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf vendor events: Update PMC used in PM_RUN_INST_CMPL event for power10 platform
@ 2023-10-16 14:31 Kajol Jain
  2023-10-16 16:11 ` Athira Rajeev
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kajol Jain @ 2023-10-16 14:31 UTC (permalink / raw)
  To: acme
  Cc: maddy, atrajeev, disgoel, kjain, linux-perf-users, namhyung,
	Disha Goel

The CPI_STALL_RATIO metric group can be used to present the high
level CPI stall breakdown metrics in powerpc, which will show:

- DISPATCH_STALL_CPI ( Dispatch stall cycles per insn )
- ISSUE_STALL_CPI ( Issue stall cycles per insn )
- EXECUTION_STALL_CPI ( Execution stall cycles per insn )
- COMPLETION_STALL_CPI ( Completion stall cycles per insn )

Commit cf26e043c2a9 ("perf vendor events power10: Add JSON
metric events to present CPI stall cycles in powerpc)" which added
the CPI_STALL_RATIO metric group, also modified
the PMC value used in PM_RUN_INST_CMPL event from PMC4 to PMC5, 
to avoid multiplexing of events.
But that got revert in recent changes. Fix this issue by changing
back the PMC value used in PM_RUN_INST_CMPL to PMC5.

Result with the fix:

 ./perf stat --metric-no-group -M CPI_STALL_RATIO <workload>

 Performance counter stats for 'workload':

        68,745,426      PM_CMPL_STALL                    #     0.21 COMPLETION_STALL_CPI
         7,692,827      PM_ISSUE_STALL                   #     0.02 ISSUE_STALL_CPI
       322,638,223      PM_RUN_INST_CMPL                 #     0.05 DISPATCH_STALL_CPI
                                                  #     0.48 EXECUTION_STALL_CPI
        16,858,553      PM_DISP_STALL_CYC
       153,880,133      PM_EXEC_STALL

       0.089774592 seconds time elapsed

"--metric-no-group" is used for forcing PM_RUN_INST_CMPL to be scheduled
in all group for more accuracy.

Fixes: 7d473f475b2a ("perf vendor events: Move JSON/events to appropriate files for power10 platform")
Reported-by: Disha Goel <disgoel@linux.vnet.ibm.com>
Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
---
 tools/perf/pmu-events/arch/powerpc/power10/pmc.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/pmu-events/arch/powerpc/power10/pmc.json b/tools/perf/pmu-events/arch/powerpc/power10/pmc.json
index c606ae03cd27..0e0253d0e757 100644
--- a/tools/perf/pmu-events/arch/powerpc/power10/pmc.json
+++ b/tools/perf/pmu-events/arch/powerpc/power10/pmc.json
@@ -195,7 +195,7 @@
     "BriefDescription": "Threshold counter exceeded a value of 128."
   },
   {
-    "EventCode": "0x400FA",
+    "EventCode": "0x500FA",
     "EventName": "PM_RUN_INST_CMPL",
     "BriefDescription": "PowerPC instruction completed while the run latch is set."
   }
-- 
2.39.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf vendor events: Update PMC used in PM_RUN_INST_CMPL event for power10 platform
  2023-10-16 14:31 [PATCH] perf vendor events: Update PMC used in PM_RUN_INST_CMPL event for power10 platform Kajol Jain
@ 2023-10-16 16:11 ` Athira Rajeev
  2023-10-17  9:57 ` Disha Goel
  2023-10-20 21:21 ` Namhyung Kim
  2 siblings, 0 replies; 4+ messages in thread
From: Athira Rajeev @ 2023-10-16 16:11 UTC (permalink / raw)
  To: Kajol Jain, linux-perf-users
  Cc: Arnaldo Carvalho de Melo, Madhavan Srinivasan, Disha Goel,
	Namhyung Kim, Disha Goel



> On 16-Oct-2023, at 8:01 PM, Kajol Jain <kjain@linux.ibm.com> wrote:
> 
> The CPI_STALL_RATIO metric group can be used to present the high
> level CPI stall breakdown metrics in powerpc, which will show:
> 
> - DISPATCH_STALL_CPI ( Dispatch stall cycles per insn )
> - ISSUE_STALL_CPI ( Issue stall cycles per insn )
> - EXECUTION_STALL_CPI ( Execution stall cycles per insn )
> - COMPLETION_STALL_CPI ( Completion stall cycles per insn )
> 
> Commit cf26e043c2a9 ("perf vendor events power10: Add JSON
> metric events to present CPI stall cycles in powerpc)" which added
> the CPI_STALL_RATIO metric group, also modified
> the PMC value used in PM_RUN_INST_CMPL event from PMC4 to PMC5, 
> to avoid multiplexing of events.
> But that got revert in recent changes. Fix this issue by changing
> back the PMC value used in PM_RUN_INST_CMPL to PMC5.
> 
> Result with the fix:
> 
> ./perf stat --metric-no-group -M CPI_STALL_RATIO <workload>
> 
> Performance counter stats for 'workload':
> 
>        68,745,426      PM_CMPL_STALL                    #     0.21 COMPLETION_STALL_CPI
>         7,692,827      PM_ISSUE_STALL                   #     0.02 ISSUE_STALL_CPI
>       322,638,223      PM_RUN_INST_CMPL                 #     0.05 DISPATCH_STALL_CPI
>                                                  #     0.48 EXECUTION_STALL_CPI
>        16,858,553      PM_DISP_STALL_CYC
>       153,880,133      PM_EXEC_STALL
> 
>       0.089774592 seconds time elapsed
> 
> "--metric-no-group" is used for forcing PM_RUN_INST_CMPL to be scheduled
> in all group for more accuracy.
> 
> Fixes: 7d473f475b2a ("perf vendor events: Move JSON/events to appropriate files for power10 platform")
> Reported-by: Disha Goel <disgoel@linux.vnet.ibm.com>
> Signed-off-by: Kajol Jain <kjain@linux.ibm.com>

Reviewed-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>

Thanks
Athira
> ---
> tools/perf/pmu-events/arch/powerpc/power10/pmc.json | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/pmu-events/arch/powerpc/power10/pmc.json b/tools/perf/pmu-events/arch/powerpc/power10/pmc.json
> index c606ae03cd27..0e0253d0e757 100644
> --- a/tools/perf/pmu-events/arch/powerpc/power10/pmc.json
> +++ b/tools/perf/pmu-events/arch/powerpc/power10/pmc.json
> @@ -195,7 +195,7 @@
>     "BriefDescription": "Threshold counter exceeded a value of 128."
>   },
>   {
> -    "EventCode": "0x400FA",
> +    "EventCode": "0x500FA",
>     "EventName": "PM_RUN_INST_CMPL",
>     "BriefDescription": "PowerPC instruction completed while the run latch is set."
>   }
> -- 
> 2.39.3
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf vendor events: Update PMC used in PM_RUN_INST_CMPL event for power10 platform
  2023-10-16 14:31 [PATCH] perf vendor events: Update PMC used in PM_RUN_INST_CMPL event for power10 platform Kajol Jain
  2023-10-16 16:11 ` Athira Rajeev
@ 2023-10-17  9:57 ` Disha Goel
  2023-10-20 21:21 ` Namhyung Kim
  2 siblings, 0 replies; 4+ messages in thread
From: Disha Goel @ 2023-10-17  9:57 UTC (permalink / raw)
  To: Kajol Jain, acme, linux-perf-users; +Cc: maddy, atrajeev, namhyung, Disha Goel

On 16/10/23 8:01 pm, Kajol Jain wrote:

> The CPI_STALL_RATIO metric group can be used to present the high
> level CPI stall breakdown metrics in powerpc, which will show:
>
> - DISPATCH_STALL_CPI ( Dispatch stall cycles per insn )
> - ISSUE_STALL_CPI ( Issue stall cycles per insn )
> - EXECUTION_STALL_CPI ( Execution stall cycles per insn )
> - COMPLETION_STALL_CPI ( Completion stall cycles per insn )
>
> Commit cf26e043c2a9 ("perf vendor events power10: Add JSON
> metric events to present CPI stall cycles in powerpc)" which added
> the CPI_STALL_RATIO metric group, also modified
> the PMC value used in PM_RUN_INST_CMPL event from PMC4 to PMC5,
> to avoid multiplexing of events.
> But that got revert in recent changes. Fix this issue by changing
> back the PMC value used in PM_RUN_INST_CMPL to PMC5.
>
> Result with the fix:
>
>   ./perf stat --metric-no-group -M CPI_STALL_RATIO <workload>
>
>   Performance counter stats for 'workload':
>
>          68,745,426      PM_CMPL_STALL                    #     0.21 COMPLETION_STALL_CPI
>           7,692,827      PM_ISSUE_STALL                   #     0.02 ISSUE_STALL_CPI
>         322,638,223      PM_RUN_INST_CMPL                 #     0.05 DISPATCH_STALL_CPI
>                                                    #     0.48 EXECUTION_STALL_CPI
>          16,858,553      PM_DISP_STALL_CYC
>         153,880,133      PM_EXEC_STALL
>
>         0.089774592 seconds time elapsed
>
> "--metric-no-group" is used for forcing PM_RUN_INST_CMPL to be scheduled
> in all group for more accuracy.
>
> Fixes: 7d473f475b2a ("perf vendor events: Move JSON/events to appropriate files for power10 platform")
> Reported-by: Disha Goel <disgoel@linux.vnet.ibm.com>
> Signed-off-by: Kajol Jain <kjain@linux.ibm.com>

Thanks for the fix Kajol.
With this patch applied getting correct PMC value for PM_RUN_INST_CMPL event.

# ./perf stat -vv -e PM_RUN_INST_CMPL sleep 1
Using CPUID 00800200
Attempt to add: cpu/PM_RUN_INST_CMPL/
..after resolving event: cpu/event=0x500fa/
PM_RUN_INST_CMPL -> cpu/event=0x500fa/
Control descriptor is not initialized
------------------------------------------------------------
perf_event_attr:
   type                             4 (PERF_TYPE_RAW)
   size                             136
   config                           0x500fa
   sample_type                      IDENTIFIER
   read_format                      TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING
   disabled                         1
   inherit                          1
   enable_on_exec                   1
   exclude_guest                    1
------------------------------------------------------------
sys_perf_event_open: pid 750989  cpu -1  group_fd -1  flags 0x8 = 3
PM_RUN_INST_CMPL: -1: 1593381 483118 483118
PM_RUN_INST_CMPL: 1593381 483118 483118

  Performance counter stats for 'sleep 1':

          1,593,381      PM_RUN_INST_CMPL

        1.001107900 seconds time elapsed

        0.001087000 seconds user
        0.000000000 seconds sys

Tested-by: Disha Goel<disgoel@linux.ibm.com>

> ---
>   tools/perf/pmu-events/arch/powerpc/power10/pmc.json | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/pmu-events/arch/powerpc/power10/pmc.json b/tools/perf/pmu-events/arch/powerpc/power10/pmc.json
> index c606ae03cd27..0e0253d0e757 100644
> --- a/tools/perf/pmu-events/arch/powerpc/power10/pmc.json
> +++ b/tools/perf/pmu-events/arch/powerpc/power10/pmc.json
> @@ -195,7 +195,7 @@
>       "BriefDescription": "Threshold counter exceeded a value of 128."
>     },
>     {
> -    "EventCode": "0x400FA",
> +    "EventCode": "0x500FA",
>       "EventName": "PM_RUN_INST_CMPL",
>       "BriefDescription": "PowerPC instruction completed while the run latch is set."
>     }

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf vendor events: Update PMC used in PM_RUN_INST_CMPL event for power10 platform
  2023-10-16 14:31 [PATCH] perf vendor events: Update PMC used in PM_RUN_INST_CMPL event for power10 platform Kajol Jain
  2023-10-16 16:11 ` Athira Rajeev
  2023-10-17  9:57 ` Disha Goel
@ 2023-10-20 21:21 ` Namhyung Kim
  2 siblings, 0 replies; 4+ messages in thread
From: Namhyung Kim @ 2023-10-20 21:21 UTC (permalink / raw)
  To: acme, Kajol Jain; +Cc: Disha Goel, maddy, linux-perf-users, disgoel, atrajeev

On Mon, 16 Oct 2023 20:01:10 +0530, Kajol Jain wrote:
> The CPI_STALL_RATIO metric group can be used to present the high
> level CPI stall breakdown metrics in powerpc, which will show:
> 
> - DISPATCH_STALL_CPI ( Dispatch stall cycles per insn )
> - ISSUE_STALL_CPI ( Issue stall cycles per insn )
> - EXECUTION_STALL_CPI ( Execution stall cycles per insn )
> - COMPLETION_STALL_CPI ( Completion stall cycles per insn )
> 
> [...]

Applied to perf-tools-next, thanks!


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-20 21:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-16 14:31 [PATCH] perf vendor events: Update PMC used in PM_RUN_INST_CMPL event for power10 platform Kajol Jain
2023-10-16 16:11 ` Athira Rajeev
2023-10-17  9:57 ` Disha Goel
2023-10-20 21:21 ` Namhyung Kim

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).