Received: by 10.213.65.68 with SMTP id h4csp2502775imn; Mon, 9 Apr 2018 04:41:47 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+2FM+AoCtgydqrg4+1R5ZPUbpPzaGQi+ViQjr21of7NySElu2ydL9glSqu8GSildEFpvAm X-Received: by 10.98.192.66 with SMTP id x63mr28811914pff.135.1523274107180; Mon, 09 Apr 2018 04:41:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523274107; cv=none; d=google.com; s=arc-20160816; b=cYPNdhq0+O7Jb8qncJReEy8Q0Pd6Kt7ClWIh9hlorvu67A4D9fRa6sQudJQ7n4ab6i i9wLiVoGredpJ4+fUtdNcx7X2VlcXYfBNlHcKHhd0qFHbiRMTNG9Sd3kHvAf40Lp8eLh azee98y3Aqpd/4ZfNFWaDaQoSGGaS9ByYU8W8D1ovkW2/+2ocXhgsPn2v0A9T6HDRE/F UtsYa76XO2Pg08sOLvcwaR+BYTBTPnKzWbXf2io+Wcypu6KClCJtsHASSCGrENOZ6bL9 v7pkH0vv92h2yWxloMbajTa41AzmVh6rE30RhI+EdCk3aZdyIg1vBGUqTORBDW6lgc66 C2nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=XI9gho96DZahKXkZLpHq2RUC38vdXi7GZd+kFBromks=; b=i2V7F3U0eH+G0JpGfeOkoIyxG64zypMbE8wMK8Ol6zMjz3dF+ta3LjuGC9whQlV40h v1QtsIj5oN7komGsVPLBFxFGuMmN28rCNYyhqh7ZA1SZk+NOMTcNzhbu26OW9uxVoHWa wwD21BFMa91XdwYsKj2zmoFubokKF1zeutYpl+h+KrHkE+R8CZJuvwFUAZojAa+IZyry mXVDCGhvsT2fQV/JGwDzq51Bn+HqrNVE+mG/W076B6BbyknP2+FehyLv4LjUfI7GoXRE UR3krZfVwiuWEc/p4TLaZSJfef1f6IT3k/7ILiTfd/AArflhFOTIL4VdUQNePyvysgAC 0aHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y17-v6si150746pll.296.2018.04.09.04.41.10; Mon, 09 Apr 2018 04:41:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751844AbeDILhj (ORCPT + 99 others); Mon, 9 Apr 2018 07:37:39 -0400 Received: from foss.arm.com ([217.140.101.70]:55102 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750759AbeDILhh (ORCPT ); Mon, 9 Apr 2018 07:37:37 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8C87DF; Mon, 9 Apr 2018 04:37:37 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 146113F24A; Mon, 9 Apr 2018 04:37:35 -0700 (PDT) Date: Mon, 9 Apr 2018 12:37:33 +0100 From: Mark Rutland To: Thomas Richter Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, acme@kernel.org, brueckner@linux.vnet.ibm.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, Thomas Richter Subject: Re: [PATCH] perf list: Add s390 support for detailed/verbose pmu event description Message-ID: <20180409113732.6k3plpp6pqdcbzrh@lakrids.cambridge.arm.com> References: <20180409110015.20793-1-tmricht@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180409110015.20793-1-tmricht@linux.ibm.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Mon, Apr 09, 2018 at 01:00:15PM +0200, Thomas Richter wrote: > From: Thomas Richter > > Perf list with flags -d and -v print a description (-d) or > a very verbose explanation (-v) of CPU specific counter events. > These descriptions are provided with the json files in > directory pmu-events/arch/s390/*.json. > > Display of these descriptions on s390 requires the > corresponding json files. > > On s390 this does not work because function is_pmu_core() > does not detect the s390 directory name where the > CPU specific events are listed. On x86 it is > /sys/bus/event_source/devices/cpu > whereas on s390 it is > /sys/bus/event_source/devices/cpum_cf > /sys/bus/event_source/devices/cpum_sf > > Fix this by adding s390 directory name testing to > function is_pmu_core(). This is the same approach as taken for > arm platform. I don't think this is quite right. On arm, we specifically look for PMU directories which have a file called CPUs. e.g. /sys/bus/event_source/devices/arm_pmuv3/cpus ... where "arm_pmuv3" is the PMU name. > diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c > index 1111d5bf15ca..8675ddf558c6 100644 > --- a/tools/perf/util/pmu.c > +++ b/tools/perf/util/pmu.c > @@ -562,6 +562,12 @@ static int is_pmu_core(const char *name) > if (stat(path, &st) == 0) > return 1; > > + /* Look for cpu sysfs (specific to s390) */ > + scnprintf(path, PATH_MAX, "%s/bus/event_source/devices/%s", > + sysfs, name); > + if (stat(path, &st) == 0) > + return 1; IIUC here we return true if the PMU has a sysfs directory, but all PMUs (including uncore PMUs) should have such a directory, so this will make is_pmu_core() always return true. Can you match the "cpum_" prefix specifically, instead? Thanks, Mark.