Received: by 10.192.165.156 with SMTP id m28csp724313imm; Mon, 16 Apr 2018 07:45:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx48xJvHaPjeBkBcg2fBg2g9SsnIozGV6FUVadgKS0p8G+1cm5lvDE6pMFPR44xnv2D30DfmL X-Received: by 10.98.163.68 with SMTP id s65mr21701369pfe.13.1523889905815; Mon, 16 Apr 2018 07:45:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523889905; cv=none; d=google.com; s=arc-20160816; b=t75d+j0U0dTPUXP8/FQD66aC4FtVPlDGPtmrQ2/vRlw5jfEw/QhIsm7neq5GQWNVK3 PwdT+6nZtAYrGn1AVxGm05/joI6rgHGRRxPkK1zbY0nKNbkbM1ifKQP6cD0FGhG7yCEo z9/jOdScWbZidLdBBTQoG98zcV1NHDy1PV14prE2rwTdRjA6/ha12lCEUgOMj204QKx6 QpOCUs23GJrBzwJK3xWADqFgg2px0dAggxP2qA4Jz9C+JTU8mHNRWKjg8btTrOY350qM SizrFi2G/DugrEF/x1JZNUL0h75N2SNVzs8kraINzuSFVUGinSfbq/AiZ0a78BCQwYDd hwww== 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=6a1Ip8g53w4iFA547COVhggbo99RCmSHm9jgYlGEGj0=; b=RyuIpejK2f9oPiWI2+PcuRULLiCCoz54zRRI1UUEGzZoNjItWqRZGs5c675LALn5zv r1smmQAOf8Y5lxYg9mQlBgZ7hFTOB8/t5g7by2uZJ43A26o7fcVKwNtBbyHXPaMFSx16 932v8S+jnhavKbpk46o68+w1JhthkyZIrFLxMY1SUq6EmzgbKBjyn8JDqYNfmU3C2yoy g47hryA/z+VIe9/m16DncwAr2hb53glYAWXIbYU5tPXyWPgzWmcgATUlHcgWBqkIrFV0 euWnMoSOXdz9iBroXjBcEYsw3SzmwQa/0Fxs/xgbqu3Le3Kq3IKQaUOP5smisDEPlP6p felw== 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 y62si11129141pfd.309.2018.04.16.07.44.52; Mon, 16 Apr 2018 07:45:05 -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 S1752666AbeDPOnp (ORCPT + 99 others); Mon, 16 Apr 2018 10:43:45 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:60326 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751194AbeDPOnm (ORCPT ); Mon, 16 Apr 2018 10:43:42 -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 A53081529; Mon, 16 Apr 2018 07:43:41 -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 2CC9A3F587; Mon, 16 Apr 2018 07:43:40 -0700 (PDT) Date: Mon, 16 Apr 2018 15:43:34 +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 v2] perf list: Add s390 support for detailed/verbose pmu event description Message-ID: <20180416144334.zkzxyhhnlm3ia5gy@lakrids.cambridge.arm.com> References: <20180416132314.33249-1-tmricht@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180416132314.33249-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 On Mon, Apr 16, 2018 at 03:23:14PM +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. > 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 && !strncmp(name, "cpum_", 5)) > + return 1; > + This shouldn't adversely affect ARM, so FWIW: Acked-by: Mark Rutland Mark.