public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: "Metzger, Markus T" <markus.t.metzger@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mingo@elte.hu" <mingo@elte.hu>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"markus.t.metzger@gmail.com" <markus.t.metzger@gmail.com>,
	"oleg@redhat.com" <oleg@redhat.com>
Subject: RE: [patch] x86, perf_counter, bts: add bts to perf_counter
Date: Fri, 07 Aug 2009 13:57:09 +0200	[thread overview]
Message-ID: <1249646229.32113.692.camel@twins> (raw)
In-Reply-To: <928CFBE8E7CB0040959E56B4EA41A77EC1BFF07F@irsmsx504.ger.corp.intel.com>

On Fri, 2009-08-07 at 12:51 +0100, Metzger, Markus T wrote:
> >-----Original Message-----
> >From: Peter Zijlstra [mailto:a.p.zijlstra@chello.nl]
> >Sent: Friday, August 07, 2009 1:45 PM
> >To: Metzger, Markus T
> >Cc: linux-kernel@vger.kernel.org; mingo@elte.hu; tglx@linutronix.de; hpa@zytor.com;
> >markus.t.metzger@gmail.com; oleg@redhat.com
> >Subject: Re: [patch] x86, perf_counter, bts: add bts to perf_counter
> >
> >On Fri, 2009-08-07 at 09:22 +0200, Markus Metzger wrote:
> >> @@ -721,9 +903,13 @@ static int __hw_perf_counter_init(struct
> >>         err = 0;
> >>         if (!atomic_inc_not_zero(&active_counters)) {
> >>                 mutex_lock(&pmc_reserve_mutex);
> >> -               if (atomic_read(&active_counters) == 0 && !reserve_pmc_hardware())
> >> -                       err = -EBUSY;
> >> -               else
> >> +               if (atomic_read(&active_counters) == 0) {
> >> +                       if (!reserve_pmc_hardware())
> >> +                               err = -EBUSY;
> >> +                       else
> >> +                               reserve_bts_hardware();
> >> +               }
> >> +               if (!err)
> >>                         atomic_inc(&active_counters);
> >>                 mutex_unlock(&pmc_reserve_mutex);
> >>         }
> >
> >You loose the reserve_bts_hardware() error case there.
> 
> 
> That had been intentional since I consider BTS somewhat optional. In case it is not available or
> fails to initialize, e.g. out of memory, we fall back to normal profiling.
> 
> Now that I think about it again, I guess that's not what a (debugger) user would expect.
> An error might be more appropriate in that case.
> 
> I'll change it.

If there's hardware that supports intel perfmon v2+ but doesn't have BTS
(I don't think so) then we shouldn't fail it hard on not present.

But if the BTS stuff should always be present on the hardware then we
can indeed unconditionally fail.


  reply	other threads:[~2009-08-07 11:57 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2009-08-07 16:39 ` Peter Zijlstra
  -- strict thread matches above, loose matches on Subject: below --
2009-07-21 13:56 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
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 11:26                     ` 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

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=1249646229.32113.692.camel@twins \
    --to=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=mingo@elte.hu \
    --cc=oleg@redhat.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