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]
Date:	Thu, 09 Jul 2015 11:44:55 +0300
From:	Adrian Hunter <adrian.hunter@...el.com>
To:	Ingo Molnar <mingo@...nel.org>
CC:	Peter Zijlstra <peterz@...radead.org>,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Andy Lutomirski <luto@...capital.net>,
	Vince Weaver <vincent.weaver@...ne.edu>,
	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...ux.intel.com>,
	linux-kernel@...r.kernel.org, Jiri Olsa <jolsa@...hat.com>,
	Stephane Eranian <eranian@...gle.com>,
	Borislav Petkov <bp@...e.de>,
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
	Andi Kleen <ak@...ux.intel.com>
Subject: Re: [RFC PATCH] perf: Provide status of known PMUs

On 09/07/15 11:10, Ingo Molnar wrote:
> 
> * Adrian Hunter <adrian.hunter@...el.com> wrote:
> 
>> Known PMUs may not be present for various reasons.
>> Provide a way for the user to know what the reason
>> is.
>>
>> A bus attribute is created for each known PMU beneath
>> a group "known_pmus".  The attribute name is the same
>> as the PMU name.  The value is a string consisting of
>> one or, optionally, two parts: a canonical part, and
>> a driver specific part.  If there are two parts, they
>> are separated by " - ".  The canonical part is one of:
>>
>> 	Supported
>> 	Driver error
>> 	Driver not loaded
>> 	Driver not in kernel config
>> 	Not supported by kernel
>> 	Not supported by hardware
>> 	Wrong vendor
>> 	Wrong architecture
>> 	Unknown status
> 
> Very nice!
> 
>> Example:
>>
>> 	$ cat /sys/bus/event_source/known_pmus/intel_pt
>> 	Supported
> 
> So I only have naming nits. 'Supported' is a bit ambiguous, because it could mean 
> that the PMU is supported but the driver is not active. How about 'Enabled'?
> 
> I'd also make the strings more unambiguously structured, something like:
> 
> 	Enabled
> 	Disabled: Driver error
> 	Disabled: Driver not loaded
> 	Disabled: Driver not in kernel config
> 	Disabled: Not supported by the kernel
> 	Disabled: Not supported by the hardware
> 	Disabled: Not supported by the hardware vendor
> 	Disabled: Not supported by the the architecture
> 	Disabled: Unknown status
> 
> (Note the small changes I did to the text in some places.)

OK

> 
> Also note that I'd suggest not enumerating all the error reasons rigidly - just 
> have a single error code, but a free flowing error string that is provided by the 
> low level driver (and maybe strdup()-ed by the core). That way you can provide 
> very specific error descriptions, without having to change the core every time you 
> need a new category. Agreed?

Drivers can optionally provide a string - the optional second part described above.
For example:

	$ cat /sys/bus/event_source/known_pmus/intel_pt
	Disabled: Not supported by the hardware - ToPA output is not supported on this CPU

Having a finite set of categories allows software to interpret the string for
purposes other than displaying it.  Having an optional second part allows
drivers to detail anything else.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ