OSDN Git Service

perf/amd/uncore: Prepare to scale for more attributes that vary per family
authorKim Phillips <kim.phillips@amd.com>
Mon, 21 Sep 2020 14:43:27 +0000 (09:43 -0500)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 24 Sep 2020 13:55:49 +0000 (15:55 +0200)
commit06f2c24584f31bc16129643bfb8239a1af82a17f
treebf586bcc233614b1b1602cef04d9fae2a07d882c
parente9ffc8c1b83931599663c21ba9082bcafa51d333
perf/amd/uncore: Prepare to scale for more attributes that vary per family

Replace AMD_FORMAT_ATTR with the more apropos DEFINE_UNCORE_FORMAT_ATTR
stolen from arch/x86/events/intel/uncore.h.  This way we can clearly
see the bit-variants of each of the attributes that want to have
the same name across families.

Also unroll AMD_ATTRIBUTE because we are going to separately add
new attributes that differ between DF and L3.

Also clean up the if-Family 17h-else logic in amd_uncore_init.

This is basically a rewrite of commit da6adaea2b7e
("perf/x86/amd/uncore: Update sysfs attributes for Family17h processors").

No functional changes.

Tested F17h+ /sys/bus/event_source/devices/amd_{l3,df}/format/*
content remains unchanged:

/sys/bus/event_source/devices/amd_l3/format/event:config:0-7
/sys/bus/event_source/devices/amd_l3/format/umask:config:8-15
/sys/bus/event_source/devices/amd_df/format/event:config:0-7,32-35,59-60
/sys/bus/event_source/devices/amd_df/format/umask:config:8-15

Signed-off-by: Kim Phillips <kim.phillips@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200921144330.6331-2-kim.phillips@amd.com
arch/x86/events/amd/uncore.c