diff mbox

[v2,2/4] powerpc/perf: update attribute_group data structure

Message ID 1479147435-18665-3-git-send-email-maddy@linux.vnet.ibm.com (mailing list archive)
State Superseded
Headers show

Commit Message

maddy Nov. 14, 2016, 6:17 p.m. UTC
Rename the power_pmu and attribute_group variables that
support PowerISA v2.07. Add a cpu feature flag check to pick
the PowerISA v2.07 format structures to support.

Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
---
 arch/powerpc/perf/power9-pmu.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

Comments

kernel test robot Nov. 15, 2016, 5 a.m. UTC | #1
Hi Madhavan,

[auto build test ERROR on powerpc/next]
[also build test ERROR on v4.9-rc5 next-20161114]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Madhavan-Srinivasan/powerpc-perf-factor-out-the-event-format-field/20161115-041335
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-pasemi_defconfig (attached as .config)
compiler: powerpc64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=powerpc 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

Note: the linux-review/Madhavan-Srinivasan/powerpc-perf-factor-out-the-event-format-field/20161115-041335 HEAD 51c82e12f03b6f83703ad810dfa72a7bf2205983 builds fine.
      It only hurts bisectibility.

All errors (new ones prefixed by >>):

   arch/powerpc/perf/power9-pmu.c: In function 'init_power9_pmu':
>> arch/powerpc/perf/power9-pmu.c:294:5: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     if (rc)
        ^
   cc1: all warnings being treated as errors

vim +/rc +294 arch/powerpc/perf/power9-pmu.c

8c002dbd Madhavan Srinivasan 2016-06-26  288  		return -ENODEV;
8c002dbd Madhavan Srinivasan 2016-06-26  289  
4a3d1bb1 Madhavan Srinivasan 2016-11-14  290  	if (cpu_has_feature(CPU_FTR_POWER9_DD1)) {
4a3d1bb1 Madhavan Srinivasan 2016-11-14  291  		rc = register_power_pmu(&power9_isa207_pmu);
4a3d1bb1 Madhavan Srinivasan 2016-11-14  292  	}
4a3d1bb1 Madhavan Srinivasan 2016-11-14  293  
8c002dbd Madhavan Srinivasan 2016-06-26 @294  	if (rc)
8c002dbd Madhavan Srinivasan 2016-06-26  295  		return rc;
8c002dbd Madhavan Srinivasan 2016-06-26  296  
8c002dbd Madhavan Srinivasan 2016-06-26  297  	/* Tell userspace that EBB is supported */

:::::: The code at line 294 was first introduced by commit
:::::: 8c002dbd05eecbb2933e9668da9614b33c7a97d2 powerpc/perf: Power9 PMU support

:::::: TO: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
:::::: CC: Michael Ellerman <mpe@ellerman.id.au>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox

Patch

diff --git a/arch/powerpc/perf/power9-pmu.c b/arch/powerpc/perf/power9-pmu.c
index 443511b18bc5..d1782fd644e9 100644
--- a/arch/powerpc/perf/power9-pmu.c
+++ b/arch/powerpc/perf/power9-pmu.c
@@ -93,7 +93,7 @@  static struct attribute_group power9_pmu_events_group = {
 	.attrs = power9_events_attr,
 };
 
-static const struct attribute_group *power9_pmu_attr_groups[] = {
+static const struct attribute_group *power9_isa207_pmu_attr_groups[] = {
 	&isa207_pmu_format_group,
 	&power9_pmu_events_group,
 	NULL,
@@ -260,7 +260,7 @@  static int power9_cache_events[C(MAX)][C(OP_MAX)][C(RESULT_MAX)] = {
 
 #undef C
 
-static struct power_pmu power9_pmu = {
+static struct power_pmu power9_isa207_pmu = {
 	.name			= "POWER9",
 	.n_counter		= MAX_PMU_COUNTERS,
 	.add_fields		= ISA207_ADD_FIELDS,
@@ -274,7 +274,7 @@  static struct power_pmu power9_pmu = {
 	.n_generic		= ARRAY_SIZE(power9_generic_events),
 	.generic_events		= power9_generic_events,
 	.cache_events		= &power9_cache_events,
-	.attr_groups		= power9_pmu_attr_groups,
+	.attr_groups		= power9_isa207_pmu_attr_groups,
 	.bhrb_nr		= 32,
 };
 
@@ -287,7 +287,10 @@  static int __init init_power9_pmu(void)
 	    strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power9"))
 		return -ENODEV;
 
-	rc = register_power_pmu(&power9_pmu);
+	if (cpu_has_feature(CPU_FTR_POWER9_DD1)) {
+		rc = register_power_pmu(&power9_isa207_pmu);
+	}
+
 	if (rc)
 		return rc;