Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1180560

Re: [RFC PATCH] perf: Provide status of known PMUs

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Adrian Hunter <adrian.hunter@intel.com>
Newsgroups linux.kernel
Subject Re: [RFC PATCH] perf: Provide status of known PMUs
Date Thu, 09 Jul 2015 10:50:03 +0200
Message-ID <pKfGP-6mA-23@gated-at.bofh.it> (permalink)
References <pKeUr-5Qy-13@gated-at.bofh.it> <pKfdL-6cK-13@gated-at.bofh.it>
X-Original-To Ingo Molnar <mingo@kernel.org>
X-Extloop1 1
X-Ironport-Av E=Sophos;i="5.15,438,1432623600"; d="scan'208";a="743537550"
Organization Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0
MIME-Version 1.0
Content-Type text/plain; charset=windows-1252
Content-Transfer-Encoding 7bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 73
X-Original-Cc Peter Zijlstra <peterz@infradead.org>, Arnaldo Carvalho de Melo <acme@kernel.org>, Andy Lutomirski <luto@amacapital.net>, Vince Weaver <vincent.weaver@maine.edu>, Thomas Gleixner <tglx@linutronix.de>, "H. Peter Anvin" <hpa@linux.intel.com>, linux-kernel@vger.kernel.org, Jiri Olsa <jolsa@redhat.com>, Stephane Eranian <eranian@google.com>, Borislav Petkov <bp@suse.de>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Andi Kleen <ak@linux.intel.com>
X-Original-Date Thu, 09 Jul 2015 11:44:55 +0300
X-Original-Message-ID <559E3487.1000600@intel.com>
X-Original-References <1436428080-3098-1-git-send-email-adrian.hunter@intel.com> <20150709081011.GA31953@gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref aioe.org linux.kernel:1180560

Show key headers only | View raw


On 09/07/15 11:10, Ingo Molnar wrote:
> 
> * Adrian Hunter <adrian.hunter@intel.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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC PATCH] perf: Provide status of known PMUs Adrian Hunter <adrian.hunter@intel.com> - 2015-07-09 10:00 +0200
  Re: [RFC PATCH] perf: Provide status of known PMUs Ingo Molnar <mingo@kernel.org> - 2015-07-09 10:20 +0200
    Re: [RFC PATCH] perf: Provide status of known PMUs Adrian Hunter <adrian.hunter@intel.com> - 2015-07-09 10:50 +0200
  Re: [RFC PATCH] perf: Provide status of known PMUs Peter Zijlstra <peterz@infradead.org> - 2015-07-09 11:00 +0200
    Re: [RFC PATCH] perf: Provide status of known PMUs Peter Zijlstra <peterz@infradead.org> - 2015-07-09 13:50 +0200
    Re: [RFC PATCH] perf: Provide status of known PMUs Peter Zijlstra <peterz@infradead.org> - 2015-07-09 14:10 +0200
      Re: [RFC PATCH] perf: Provide status of known PMUs Ingo Molnar <mingo@kernel.org> - 2015-07-09 14:40 +0200
        Re: [RFC PATCH] perf: Provide status of known PMUs Peter Zijlstra <peterz@infradead.org> - 2015-07-09 14:50 +0200
          Re: [RFC PATCH] perf: Provide status of known PMUs Ingo Molnar <mingo@kernel.org> - 2015-07-10 10:40 +0200

csiph-web