lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180409113732.6k3plpp6pqdcbzrh@lakrids.cambridge.arm.com>
Date:   Mon, 9 Apr 2018 12:37:33 +0100
From:   Mark Rutland <mark.rutland@....com>
To:     Thomas Richter <tmricht@...ux.ibm.com>
Cc:     linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
        acme@...nel.org, brueckner@...ux.vnet.ibm.com,
        schwidefsky@...ibm.com, heiko.carstens@...ibm.com,
        Thomas Richter <tmricht@...ux.vnet.ibm.com>
Subject: Re: [PATCH] perf list: Add s390 support for detailed/verbose pmu
 event description

Hi,

On Mon, Apr 09, 2018 at 01:00:15PM +0200, Thomas Richter wrote:
> From: Thomas Richter <tmricht@...ux.vnet.ibm.com>
> 
> 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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ