Project

General

Profile

Actions

Feature #16408

closed

AMD Zen 5 CPC support

Added by Robert Mustacchi 2 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
Normal
Category:
driver - device drivers
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

AMD has made public the initial set of performance counters for Family 1ah, models 00-0f in this document. As such, we should go ahead and update our AMD performance counter support for this first set of Zen 5 CPUs.

Actions #1

Updated by Electric Monk 2 months ago

  • Gerrit CR set to 3379
Actions #2

Updated by Robert Mustacchi about 2 months ago

I first used cpustat -h to see data, then cputrack to watch a terminal that I typed a while :; do:; done loop and let that run for a few seconds. We see the zeros as during that time the process is asleep and not running.

rm@gilgamesh ~ $ pfexec cpustat -h
Usage:
        cpustat -c spec [-c spec]... [-p period] [-T u|d]
                [-sntD] [interval [count]]

        -c spec   specify processor events to be monitored
        -n        suppress titles
        -p period cycle through event list periodically
        -s        run user soaker thread for system-only events
        -t        include tsc register
        -T d|u    Display a timestamp in date (d) or unix time_t (u)
        -D        enable debug mode
        -h        print extended usage information

        Use cputrack(1) to monitor per-process statistics.

        CPU performance counter interface: AMD Family 1ah

        event specification syntax:
        [picn=]<eventn>[,attr[n][=<val>]][,[picn=]<eventn>[,attr[n][=<val>]],...]

        Generic Events:

        event[0-5]: PAPI_br_cn PAPI_br_ins PAPI_br_msp PAPI_br_ucn 
                 PAPI_tot_cyc PAPI_tot_ins PAPI_hw_int PAPI_tlb_sd 

        See generic_events(3CPC) for descriptions of these events

        Platform Specific Events:

        event[0-5]: Retired_x87_FP_Ops Retired_x87_FP_Ops.DivSqrROps 
                 Retired_x87_FP_Ops.MulOps Retired_x87_FP_Ops.AddSubOps 
                 Retired_SSE_AVX_FLOPs Retired_FP_uOps 
                 Retired_FP_uOps.Pack512uOpsRetired 
                 Retired_FP_uOps.Pack256uOpsRetired 
                 Retired_FP_uOps.Pack128uOpsRetired 
                 Retired_FP_uOps.ScalaruOpsRetired 
                 Retired_FP_uOps.MMXuOpsRetired 
                 Retired_FP_uOps.x87uOpsRetired FP_Ops_Retired 
                 INT_Ops_Retired Packed_FP_Ops_Retired 
                 Packed_INT_Ops_Retired FP_Dispatch_Faults 
                 FP_Dispatch_Faults.YmmSpillFault 
                 FP_Dispatch_Faults.YmmFillFault 
                 FP_Dispatch_Faults.XmmFillFault 
                 FP_Dispatch_Faults.x87FillFault Bad_Status_2_STLI 
                 Bad_Status_2_STLI.StliOther Retired_Lock_Instructions 
                 CLFLUSH CPUID LS_Dispatch LS_Dispatch.LdOpSt 
                 LS_Dispatch.PureSt LS_Dispatch.PureLd SMI_or_SMM_cycles 
                 Interrupts_Taken Interrupts_Taken.NumInterrupts 
                 Store_to_Load_Forward Store_Globally_Visible_Cancels_2 
                 Store_Globally_Visible_Cancels_2.OlderStVisibleDepCancel 
                 LS_MAB_Allocates_by_Type Demand_DC_Fills_by_Data_Source 
                 Demand_DC_Fills_by_Data_Source.AlternateMemories_NearFar 
                 Demand_DC_Fills_by_Data_Source.DramIO_Far 
                 Demand_DC_Fills_by_Data_Source.NearFarCache_Far 
                 Demand_DC_Fills_by_Data_Source.DramIO_Near 
                 Demand_DC_Fills_by_Data_Source.NearFarCache_Near 
                 Demand_DC_Fills_by_Data_Source.LocalCcx 
                 Demand_DC_Fills_by_Data_Source.LocalL2 
                 Any_DC_Fills_by_Data_Source 
                 Any_DC_Fills_by_Data_Source.AlternateMemories_NearFar 
                 Any_DC_Fills_by_Data_Source.DramIO_Far 
                 Any_DC_Fills_by_Data_Source.NearFarCache_Far 
                 Any_DC_Fills_by_Data_Source.DramIO_Near 
                 Any_DC_Fills_by_Data_Source.NearFarCache_Near 
                 Any_DC_Fills_by_Data_Source.LocalCcx 
                 Any_DC_Fills_by_Data_Source.LocalL2 L1_DTLB_Reloads 
                 L1_DTLB_Reloads.TlbReload1GL2Miss 
                 L1_DTLB_Reloads.TlbReload2ML2Miss 
                 L1_DTLB_Reloads.TlbReloadCoalescedPageMiss 
                 L1_DTLB_Reloads.TlbReload4KL2Miss 
                 L1_DTLB_Reloads.TlbReload1GL2Hit 
                 L1_DTLB_Reloads.TlbReload2ML2Hit 
                 L1_DTLB_Reloads.TlbReloadCoalescedPageHit 
                 L1_DTLB_Reloads.TlbReload4KL2Hit Misaligned_Load_Flows 
                 Misaligned_Load_Flows.MA4K Misaligned_Load_Flows.MA64 
                 Software_Prefetch_Dispatched 
                 Software_Prefetch_Dispatched.PREFETCHNTA 
                 Software_Prefetch_Dispatched.PREFETCHW 
                 Software_Prefetch_Dispatched.PREFETCH WCB_Close 
                 WCB_Close.FullLine64B Ineffective_Software_Prefetches 
                 Ineffective_Software_Prefetches.MabHit 
                 Ineffective_Software_Prefetches.DcHit 
                 Software_Prefetch_Data_Cache_Fills 
                 Software_Prefetch_Data_Cache_Fills.AlternateMemories_NearFar 
                 Software_Prefetch_Data_Cache_Fills.DramIO_Far 
                 Software_Prefetch_Data_Cache_Fills.NearFarCache_Far 
                 Software_Prefetch_Data_Cache_Fills.DramIO_Near 
                 Software_Prefetch_Data_Cache_Fills.NearFarCache_Near 
                 Software_Prefetch_Data_Cache_Fills.LocalCcx 
                 Software_Prefetch_Data_Cache_Fills.LocalL2 
                 Hardware_Prefetch_Data_Cache_Fills 
                 Hardware_Prefetch_Data_Cache_Fills.AlternateMemories_NearFar 
                 Hardware_Prefetch_Data_Cache_Fills.DramIO_Far 
                 Hardware_Prefetch_Data_Cache_Fills.NearFarCache_Far 
                 Hardware_Prefetch_Data_Cache_Fills.DramIO_Near 
                 Hardware_Prefetch_Data_Cache_Fills.NearFarCache_Near 
                 Hardware_Prefetch_Data_Cache_Fills.LocalCcx 
                 Hardware_Prefetch_Data_Cache_Fills.LocalL2 
                 Allocated_DC_misses Cycles_Not_in_Halt TLB_Flush_Events 
                 P0_frequency_Cycles_Not_in_Halt 
                 P0_frequency_Cycles_Not_in_Halt.P0_frequency_Cycles_Not_in_Halt 
                 Instruction_Cache_Refills_from_L2 
                 Instruction_Cache_Refills_from_System 
                 L1_ITLB_Miss_L2_ITLB_Hit ITLB_Reload_from_Page_Table_walk 
                 ITLB_Reload_from_Page_Table_walk.Coalesced_4k 
                 ITLB_Reload_from_Page_Table_walk.walk_1G 
                 ITLB_Reload_from_Page_Table_walk.walk_2M 
                 ITLB_Reload_from_Page_Table_walk.walk_4K BP_Correct 
                 Variable_Target_Predictions 
                 Decoder_Overrides_Existing_Branch_Prediction_Speculative 
                 ITLB_Hits ITLB_Hits.IF1G ITLB_Hits.IF2M ITLB_Hits.IF4K 
                 BP_redirects BP_redirects.ExRedir BP_redirects.Resync 
                 Fetch_IBS_events Fetch_IBS_events.SampleVal 
                 Fetch_IBS_events.SampleFiltered 
                 Fetch_IBS_events.SampleDiscarded 
                 Fetch_IBS_events.FetchTagged IC_Tag_Hit_Miss_events 
                 Op_Cache_hit_miss Dispatch_Empty 
                 Source_of_Op_Dispatched_From_Decoder 
                 Source_of_Op_Dispatched_From_Decoder.Op_Cache 
                 Source_of_Op_Dispatched_From_Decoder.x86_decoder 
                 Types_of_Ops_Dispatched_From_Decoder 
                 Dispatch_Stall_Cycles_Dynamic_Tokens_Part_1 
                 Dispatch_Stall_Cycles_Dynamic_Tokens_Part_1.FPSchRsrcStall 
                 Dispatch_Stall_Cycles_Dynamic_Tokens_Part_1.TakenBrnchBufferRsrc 
                 Dispatch_Stall_Cycles_Dynamic_Tokens_Part_1.StoreQueueRsrcStall 
                 Dispatch_Stall_Cycles_Dynamic_Tokens_Part_1.LoadQueueRsrcStall 
                 Dispatch_Stall_Cycles_Dynamic_Tokens_Part_1.IntPhyRegFileRsrcStall 
                 Dispatch_Stall_Cycles_Dynamic_Tokens_Part_2 
                 Dispatch_Stall_Cycles_Dynamic_Tokens_Part_2.RetQ 
                 Dispatch_Stall_Cycles_Dynamic_Tokens_Part_2.EX_Flush_recovery 
                 Dispatch_Stall_Cycles_Dynamic_Tokens_Part_2.AGTokens 
                 Dispatch_Stall_Cycles_Dynamic_Tokens_Part_2.ALTokens 
                 No_Dispatch_per_Slot Additional_Resource_Stalls 
                 Retired_Instructions Retired_Macro_Ops 
                 Retired_Branch_Instructions 
                 Retired_Branch_Instructions_Mispredicted 
                 Retired_Taken_Branch_Instructions 
                 Retired_Taken_Branch_Instructions_Mispredicted 
                 Retired_Far_Control_Transfers 
                 Retired_Near_Return_Branch_Instructions 
                 Retired_Near_Return_Branch_Instructions_Mispredicted 
                 Retired_Indirect_Branch_Instructions_Mispredicted 
                 Retired_MMX_FP_Instructions 
                 Retired_MMX_FP_Instructions.SSE 
                 Retired_MMX_FP_Instructions.MMX 
                 Retired_MMX_FP_Instructions.X87 
                 Retired_Indirect_Branch_Instructions 
                 Retired_Conditional_Branch_Instructions 
                 Div_Cycles_Busy_count Div_Op_Count Cycles_with_no_retire 
                 Cycles_with_no_retire.ThreadNotSelected 
                 Cycles_with_no_retire.Other 
                 Cycles_with_no_retire.NotCompleteSelf 
                 Cycles_with_no_retire.Empty 
                 Retired_Microcoded_Instructions Retired_Microcode_Ops 
                 Retired_Conditional_Branch_Instructions_Mispredicted 
                 Retired_Unconditional_Branch_Instructions_Mispredicted 
                 Retired_Unconditional_Branch_Instructions Tagged_IBS_Ops 
                 Tagged_IBS_Ops.IbsCountRollover 
                 Tagged_IBS_Ops.IbsTaggedOpsRet Tagged_IBS_Ops.IbsTaggedOps 
                 Retired_fused_instructions L2RequestG1 L2RequestG1.RdBlkL 
                 L2RequestG1.RdBlkX L2RequestG1.LsRdBlkC_S 
                 L2RequestG1.CacheableIcRead L2RequestG1.LsPrefetchL2Cmd 
                 L2RequestG1.L2HwPf L2RequestG1.Group2 L2RequestG2 
                 L2RequestG2.LsRdSized L2RequestG2.LsRdSizedNC L2WcbReq 
                 L2WcbReq.WcbClose L2CacheReqStat L2CacheReqStat.LsRdBlkCS 
                 L2CacheReqStat.LsRdBlkLHitX: Data Cache Read Hit in L2 
                 L2CacheReqStat.LsRdBlkLHitS L2CacheReqStat.LsRdBlkX 
                 L2CacheReqStat.LsRdBlkC L2CacheReqStat.IcFillHitX 
                 L2CacheReqStat.IcFillHitS L2CacheReqStat.IcFillMiss 
                 L2PfHitL2 L2PfMissL2HitL3 L2PfMissL2L3 L2FillRspSrc 
                 L2FillRspSrc.AlternateMemories_NearFar 
                 L2FillRspSrc.DramIO_Far L2FillRspSrc.NearFarCache_Far 
                 L2FillRspSrc.DramIO_Near L2FillRspSrc.NearFarCache_Near 
                 L2FillRspSrc.LocalCcx 

        attributes: edge pc inv cmask umask nouser sys 

        See "Performance Monitor Counters for AMD Family 1Ah Model 00h-Fh 
        Processors" (AMD publication 58550) and amd_f1ah_zen5_events(3CPC) 
rm@gilgamesh ~ $ pfexec cputrack -c PAPI_tot_cyc -p 100497 
   time lwp      event      pic0 
  1.001   1       tick         0 
  2.001   1       tick         0 
  3.001   1       tick         0 
  4.001   1       tick     39836 
  5.001   1       tick     27415 
  6.001   1       tick     33107 
  7.001   1       tick     27880 
  8.011   1       tick 258188741 
  9.012   1       tick 1706967921 
 10.013   1       tick 2808976817 
 11.014   1       tick 2807343899 
 12.015   1       tick 2806640937 
 13.016   1       tick 2804669673 
 14.017   1       tick 2804760008 
 15.001   1       tick 1549359840 
 16.001   1       tick         0 
 17.001   1       tick         0 
 18.001   1       tick         0 
Actions #3

Updated by Electric Monk about 2 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit cf618897f43ea305e3a426f93bbcef4e8106829c

commit  cf618897f43ea305e3a426f93bbcef4e8106829c
Author: Robert Mustacchi <rm@fingolfin.org>
Date:   2024-04-08T21:42:53.000Z

    16408 AMD Zen 5 CPC support
    Reviewed by: Gordon Ross <gordon.w.ross@gmail.com>
    Reviewed by: Andy Fiddaman <illumos@fiddaman.net>
    Approved by: Richard Lowe <richlowe@richlowe.net>

Actions

Also available in: Atom PDF