[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <928CFBE8E7CB0040959E56B4EA41A77EC1BFF07F@irsmsx504.ger.corp.intel.com>
Date: Fri, 7 Aug 2009 12:51:04 +0100
From: "Metzger, Markus T" <markus.t.metzger@...el.com>
To: Peter Zijlstra <a.p.zijlstra@...llo.nl>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"mingo@...e.hu" <mingo@...e.hu>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"hpa@...or.com" <hpa@...or.com>,
"markus.t.metzger@...il.com" <markus.t.metzger@...il.com>,
"oleg@...hat.com" <oleg@...hat.com>
Subject: RE: [patch] x86, perf_counter, bts: add bts to perf_counter
>-----Original Message-----
>From: Peter Zijlstra [mailto:a.p.zijlstra@...llo.nl]
>Sent: Friday, August 07, 2009 1:45 PM
>To: Metzger, Markus T
>Cc: linux-kernel@...r.kernel.org; mingo@...e.hu; tglx@...utronix.de; hpa@...or.com;
>markus.t.metzger@...il.com; oleg@...hat.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.
thanks and regards,
markus.
---------------------------------------------------------------------
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen Germany
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes Schwaderer
Registergericht: Muenchen HRB 47456 Ust.-IdNr.
VAT Registration No.: DE129385895
Citibank Frankfurt (BLZ 502 109 00) 600119052
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists