Re: [RFC][PATCH 5/3] tracing: Add smi counting to HWLAT

2016-08-09 Thread Peter Zijlstra
On Tue, Aug 09, 2016 at 02:05:43PM -0400, Steven Rostedt wrote: > +int arch_smi_count(void) > +{ > + unsigned long long count; > + int err; > + > + err = rdmsrl_safe(MSR_SMI_COUNT, ); > + if (err) > + return 0; That's really yucky, relying on _safe() to detect

Re: [RFC][PATCH 5/3] tracing: Add smi counting to HWLAT

2016-08-09 Thread Peter Zijlstra
On Tue, Aug 09, 2016 at 02:05:43PM -0400, Steven Rostedt wrote: > +int arch_smi_count(void) > +{ > + unsigned long long count; > + int err; > + > + err = rdmsrl_safe(MSR_SMI_COUNT, ); > + if (err) > + return 0; That's really yucky, relying on _safe() to detect

Re: [RFC][PATCH 5/3] tracing: Add smi counting to HWLAT

2016-08-09 Thread Steven Rostedt
On Tue, 9 Aug 2016 15:28:57 -0300 Daniel Bristot de Oliveira wrote: > On 08/09/2016 03:05 PM, Steven Rostedt wrote: > > If an arch supports counting of SMIs (like newer intel chips do), then it > > can implement arch_smi_count() to return the number of SMIs that were > >

Re: [RFC][PATCH 5/3] tracing: Add smi counting to HWLAT

2016-08-09 Thread Steven Rostedt
On Tue, 9 Aug 2016 15:28:57 -0300 Daniel Bristot de Oliveira wrote: > On 08/09/2016 03:05 PM, Steven Rostedt wrote: > > If an arch supports counting of SMIs (like newer intel chips do), then it > > can implement arch_smi_count() to return the number of SMIs that were > > triggered. The hwlat

Re: [RFC][PATCH 5/3] tracing: Add smi counting to HWLAT

2016-08-09 Thread Daniel Bristot de Oliveira
On 08/09/2016 03:05 PM, Steven Rostedt wrote: > If an arch supports counting of SMIs (like newer intel chips do), then it > can implement arch_smi_count() to return the number of SMIs that were > triggered. The hwlat detector will call this function to get the current > number of SMIs, and then

Re: [RFC][PATCH 5/3] tracing: Add smi counting to HWLAT

2016-08-09 Thread Daniel Bristot de Oliveira
On 08/09/2016 03:05 PM, Steven Rostedt wrote: > If an arch supports counting of SMIs (like newer intel chips do), then it > can implement arch_smi_count() to return the number of SMIs that were > triggered. The hwlat detector will call this function to get the current > number of SMIs, and then

[RFC][PATCH 5/3] tracing: Add smi counting to HWLAT

2016-08-09 Thread Steven Rostedt
If an arch supports counting of SMIs (like newer intel chips do), then it can implement arch_smi_count() to return the number of SMIs that were triggered. The hwlat detector will call this function to get the current number of SMIs, and then after a period, it will read that function again, and

[RFC][PATCH 5/3] tracing: Add smi counting to HWLAT

2016-08-09 Thread Steven Rostedt
If an arch supports counting of SMIs (like newer intel chips do), then it can implement arch_smi_count() to return the number of SMIs that were triggered. The hwlat detector will call this function to get the current number of SMIs, and then after a period, it will read that function again, and