public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: kan.liang@intel.com
Cc: acme@kernel.org, tglx@linutronix.de, mingo@redhat.com,
	linux-kernel@vger.kernel.org, peterz@infradead.org,
	eranian@google.com, jolsa@kernel.org, elliott@hpe.com,
	ak@linux.intel.com
Subject: Re: [PATCH V2 0/2] measure SMI cost (user)
Date: Mon, 29 May 2017 14:46:37 +0200	[thread overview]
Message-ID: <20170529124637.GA1957@krava> (raw)
In-Reply-To: <1495825538-5230-1-git-send-email-kan.liang@intel.com>

On Fri, May 26, 2017 at 12:05:36PM -0700, kan.liang@intel.com wrote:
> From: Kan Liang <Kan.liang@intel.com>
> 
> Currently, there is no way to measure the time cost in System management
> mode (SMM) by perf.
> 
> Intel perfmon supports FREEZE_WHILE_SMM bit in IA32_DEBUGCTL. Once it sets,
> the PMU core counters will freeze on SMI handler. But it will not have an
> effect on free running counters. E.g. APERF counter.
> The cost of SMI can be measured by (aperf - unhalted core cycles).
> 
> A new sysfs entry /sys/device/cpu/freeze_on_smi is introduced to set
> FREEZE_WHILE_SMM bit in IA32_DEBUGCTL. (kernel patch, which has been merged.
> The commit ID is 6089327f5424f227bb6a8cf92363c2617e054453)
> 
> A new --smi-cost mode in perf stat is implemented to measure the SMI cost
> by calculating unhalted core cycles and aperf results.
> 
> In practice, the percentages of SMI cycles is very useful for performance
> oriented analysis. So the output will be SMI cycles% and SMI#.
> For users who wants to get the actual value, they can apply --no-metric-only.
> 
> Here is an example of default output.
> 
>  Performance counter stats for 'sudo echo ':
> 
> SMI cycles%          SMI#
>     0.1%              1
> 
>        0.010858678 seconds time elapsed

for some reason I can't get single SMI count generated,
is there a setup/bench that would provoke that?

other than that, the code looks ok

thanks,
jirka

  parent reply	other threads:[~2017-05-29 12:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-26 19:05 [PATCH V2 0/2] measure SMI cost (user) kan.liang
2017-05-26 19:05 ` [PATCH V2 1/2] tools lib api fs: Add sysfs__write_int function kan.liang
2017-06-21 18:17   ` [tip:perf/core] " tip-bot for Kan Liang
2017-05-26 19:05 ` [PATCH V2 2/2] perf stat: Add support to measure SMI cost kan.liang
2017-06-21 18:18   ` [tip:perf/core] " tip-bot for Kan Liang
2017-05-29 12:46 ` Jiri Olsa [this message]
2017-05-29 12:52   ` [PATCH V2 0/2] measure SMI cost (user) Peter Zijlstra
2017-05-29 13:16     ` Jiri Olsa
2017-05-29 17:06       ` Liang, Kan
2017-06-02 15:45         ` Liang, Kan
2017-06-02 18:27           ` Arnaldo Carvalho de Melo
2017-06-14 17:50             ` Liang, Kan
2017-06-20 13:43               ` Liang, Kan
2017-06-20 20:29                 ` 'Arnaldo Carvalho de Melo'
2017-06-20 21:43 ` Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170529124637.GA1957@krava \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=elliott@hpe.com \
    --cc=eranian@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox