public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: "Metzger, Markus T" <markus.t.metzger@intel.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"markus.t.metzger@gmail.com" <markus.t.metzger@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [patch] x86, perf_counter, bts: add bts to perf_counter
Date: Fri, 7 Aug 2009 12:31:27 +0200	[thread overview]
Message-ID: <20090807103127.GA23139@elte.hu> (raw)
In-Reply-To: <928CFBE8E7CB0040959E56B4EA41A77EC1BFEFEB@irsmsx504.ger.corp.intel.com>


* Metzger, Markus T <markus.t.metzger@intel.com> wrote:

> >-----Original Message-----
> >From: Peter Zijlstra [mailto:a.p.zijlstra@chello.nl]
> >Sent: Friday, August 07, 2009 10:21 AM
> >To: Metzger, Markus T
> >Cc: Ingo Molnar; tglx@linutronix.de; hpa@zytor.com; markus.t.metzger@gmail.com; linux-
> >kernel@vger.kernel.org
> >Subject: RE: [patch] x86, perf_counter, bts: add bts to perf_counter
> >
> >On Fri, 2009-08-07 at 08:29 +0100, Metzger, Markus T wrote:
> >
> >> I incorporated Peter's review comments, except that I would not enforce sample_period == 1
> >> when branch tracing is requested. There might be users who want to sample the IP every 100.000'th
> >> branch for profiling reasons.
> >
> >But in case you don't set sample_period==1 then you won't be able to
> >match the BTS counter:
> >
> >+       if (unlikely((event ==
> >+                     x86_pmu.event_map(PERF_COUNT_HW_BRANCH_INSTRUCTIONS)) &&
> >+                    (hwc->sample_period == 1)))
> >+               return X86_PMC_IDX_FIXED_BTS;
> >
> >Also,
> >
> >+               /*
> >+                * Try to use BTS for branch tracing. If that is not
> >+                * available, try to get a generic counter.
> >+                */
> >+               if (unlikely(!cpuc->ds))
> >+                       goto try_generic;
> >
> >How will be use a generic counter for BTS, will it generate an NMI for
> >every encountered branch? That might very will hit the throttle as that
> >might be many.
> >
> >Would it not be better to force sample_period==1 usage onto the BTS and
> >simply fail if its not available?
> 
> In case someone requests a bigger sample-period, we would use the 
> normal counter - as we do without this patch. We would also use 
> the normal counter in case BTS is not available.
> 
> In that case, we won't have BTS, we will have normal performance 
> monitoring. It will be throttled just like any other sampling 
> request with small sample_period.
> 
> If we forced sample_period = 1 for 
> PERF_COUNT_HW_BRANCH_INSTRUCTIONS, we would remove functionality.

i'm inclined to agree with you.

period=1 branch execution sampling without BTS might be seriously 
limited, but it could still be (borderline) applied to user mode 
tasks and the result ought to be usable as a crude poor man's trace 
of execution. So no matter how sucky it may be, we shouldnt limit 
it.

	Ingo

  parent reply	other threads:[~2009-08-07 10:31 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-21 13:56 [patch] x86, perf_counter, bts: add bts to perf_counter Markus Metzger
2009-08-04 10:24 ` Peter Zijlstra
2009-08-04 11:14   ` Ingo Molnar
2009-08-04 11:35     ` Ingo Molnar
2009-08-05 11:10       ` Metzger, Markus T
2009-08-07  7:29       ` Metzger, Markus T
2009-08-07  8:21         ` Peter Zijlstra
2009-08-07 10:18           ` Metzger, Markus T
2009-08-07 10:29             ` Peter Zijlstra
2009-08-07 12:18               ` Metzger, Markus T
2009-08-07 13:05                 ` Peter Zijlstra
2009-08-07 10:31             ` Ingo Molnar [this message]
2009-08-07 10:36               ` Ingo Molnar
2009-08-07 10:57                 ` Metzger, Markus T
2009-08-07 11:17                   ` Metzger, Markus T
2009-08-07 11:24                     ` Ingo Molnar
2009-08-07 11:33                       ` Ingo Molnar
2009-08-07 17:49                         ` [PATCH] perf_counter: Fix a race on perf_counter_ctx Peter Zijlstra
2009-08-08 11:52                           ` [tip:perfcounters/core] " tip-bot for Peter Zijlstra
2009-08-08 12:03                           ` [PATCH] " Ingo Molnar
2009-08-10 12:33                             ` Metzger, Markus T
2009-08-10 12:59                               ` Peter Zijlstra
2009-08-10 13:46                               ` Ingo Molnar
2009-08-11  6:33                                 ` Metzger, Markus T
2009-08-11  8:59                                 ` Metzger, Markus T
2009-08-18 12:49                                   ` Metzger, Markus T
2009-08-18 12:59                                     ` Peter Zijlstra
2009-08-18 12:59                                       ` Peter Zijlstra
2009-08-18 13:20                                         ` Metzger, Markus T
2009-08-18 13:37                                           ` Peter Zijlstra
2009-08-18 13:54                                             ` Metzger, Markus T
2009-08-18 14:00                                               ` Ingo Molnar
2009-08-18 14:15                                                 ` Metzger, Markus T
2009-08-28  9:56                                                   ` Metzger, Markus T
2009-09-01 11:17                                                     ` [discuss] BTS overflow handling, was: " Metzger, Markus T
2009-09-01 13:00                                                       ` Peter Zijlstra
2009-09-01 13:09                                                         ` Ingo Molnar
2009-09-01 13:32                                                         ` Metzger, Markus T
2009-09-01 13:53                                                           ` Peter Zijlstra
2009-09-01 14:27                                                             ` Metzger, Markus T
2009-09-01 14:35                                                               ` Peter Zijlstra
2009-09-03 14:25                                                             ` Metzger, Markus T
2009-08-18 14:01                                               ` Peter Zijlstra
2009-08-18 14:19                                                 ` Metzger, Markus T
2009-08-09 11:10                           ` [tip:perfcounters/core] " tip-bot for Peter Zijlstra
2009-08-07 11:26                     ` [patch] x86, perf_counter, bts: add bts to perf_counter Ingo Molnar
2009-08-07 11:29                       ` Ingo Molnar
2009-08-07 12:14                         ` Metzger, Markus T
2009-08-07 11:19                   ` Ingo Molnar
2009-08-07 11:34                     ` Metzger, Markus T
2009-08-07 11:37                     ` Metzger, Markus T
2009-08-04 11:37 ` [tip:perfcounters/urgent] x86, perf_counter, bts: Add BTS support to perfcounters tip-bot for Markus Metzger
2009-08-07 10:10 ` [tip:perfcounters/core] " tip-bot for Markus Metzger
2009-08-08 11:43 ` tip-bot for Markus Metzger
2009-08-08 11:53 ` tip-bot for Markus Metzger
  -- strict thread matches above, loose matches on Subject: below --
2009-08-07  7:22 [patch] x86, perf_counter, bts: add bts to perf_counter Markus Metzger
2009-08-07 11:45 ` Peter Zijlstra
2009-08-07 11:51   ` Metzger, Markus T
2009-08-07 11:57     ` Peter Zijlstra
2009-08-07 16:39 ` Peter Zijlstra

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=20090807103127.GA23139@elte.hu \
    --to=mingo@elte.hu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markus.t.metzger@gmail.com \
    --cc=markus.t.metzger@intel.com \
    --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