Re: [rfc 1/3] perf, x86: P4 PMU - describe config format

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Cyrill Gorcunov
Date: Friday, November 26, 2010 - 8:27 am

On Fri, Nov 26, 2010 at 02:54:39PM +0100, Stephane Eranian wrote:
...

 No ;) The key moment here that this flags are related to _activity_ of
logical thread and I guess they were introduced just to allow measuring
if user-space application does win from using HT or not (since for
some loads the HT simply drops the perfomance).

 But I guess what you have in mind is actually set in ESCR register --
flags T0/1_USR, T0/1_OS. And these bits are controlled by kernel and 
"measurement" of events happening on another thread is simply not
allowed, though you still can set on which CPL level measure the event
by 'exclude_kernel','exclude_user' config attributes.

 Though there are still events which are "shared" across threads,
so such events will need CAP_SYS_ADMIN permission.

 Here is what I've put in comments while were touching this code.

	/*
	 * NOTE: P4_CCCR_THREAD_ANY has not the same meaning as
	 * in Architectural Performance Monitoring, it means not
	 * on _which_ logical cpu to count but rather _when_, ie it
	 * depends on logical cpu state -- count event if one cpu active,
	 * none, both or any, so we just allow user to pass any value
	 * desired.
	 *
	 * In turn we always set Tx_OS/Tx_USR bits bound to logical
	 * cpu without their propagation to another cpu
	 */

	/*
	 * if an event is shared accross the logical threads
	 * the user needs special permissions to be able to use it
	 */
	if (p4_event_bind_map[v].shared) {
		if (perf_paranoid_cpu() && !capable(CAP_SYS_ADMIN))
			return -EACCES;
	}

  Cyrill
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[rfc 0/3] perf,x86: p4 pmu series, Cyrill Gorcunov, (Tue Nov 23, 3:46 pm)
[rfc 1/3] perf, x86: P4 PMU - describe config format, Cyrill Gorcunov, (Tue Nov 23, 3:46 pm)
Re: [rfc 1/3] perf, x86: P4 PMU - describe config format, Stephane Eranian, (Fri Nov 26, 3:57 am)
Re: [rfc 1/3] perf, x86: P4 PMU - describe config format, Cyrill Gorcunov, (Fri Nov 26, 4:14 am)
Re: [rfc 1/3] perf, x86: P4 PMU - describe config format, Cyrill Gorcunov, (Fri Nov 26, 4:32 am)
Re: [rfc 1/3] perf, x86: P4 PMU - describe config format, Stephane Eranian, (Fri Nov 26, 4:35 am)
Re: [rfc 1/3] perf, x86: P4 PMU - describe config format, Cyrill Gorcunov, (Fri Nov 26, 4:58 am)
Re: [rfc 1/3] perf, x86: P4 PMU - describe config format, Stephane Eranian, (Fri Nov 26, 5:46 am)
Re: [rfc 1/3] perf, x86: P4 PMU - describe config format, Stephane Eranian, (Fri Nov 26, 5:48 am)
Re: [rfc 1/3] perf, x86: P4 PMU - describe config format, Peter Zijlstra, (Fri Nov 26, 5:59 am)
Re: [rfc 1/3] perf, x86: P4 PMU - describe config format, Cyrill Gorcunov, (Fri Nov 26, 6:04 am)
Re: [rfc 1/3] perf, x86: P4 PMU - describe config format, Peter Zijlstra, (Fri Nov 26, 6:06 am)
Re: [rfc 1/3] perf, x86: P4 PMU - describe config format, Stephane Eranian, (Fri Nov 26, 6:07 am)
Re: [rfc 1/3] perf, x86: P4 PMU - describe config format, Cyrill Gorcunov, (Fri Nov 26, 6:07 am)
Re: [rfc 1/3] perf, x86: P4 PMU - describe config format, Stephane Eranian, (Fri Nov 26, 6:10 am)
Re: [rfc 1/3] perf, x86: P4 PMU - describe config format, Cyrill Gorcunov, (Fri Nov 26, 6:47 am)
Re: [rfc 1/3] perf, x86: P4 PMU - describe config format, Cyrill Gorcunov, (Fri Nov 26, 6:50 am)
Re: [rfc 1/3] perf, x86: P4 PMU - describe config format, Stephane Eranian, (Fri Nov 26, 6:54 am)
Re: [rfc 1/3] perf, x86: P4 PMU - describe config format, Cyrill Gorcunov, (Fri Nov 26, 8:27 am)
Re: [rfc 1/3] perf, x86: P4 PMU - describe config format, Stephane Eranian, (Fri Nov 26, 9:22 am)
Re: [rfc 1/3] perf, x86: P4 PMU - describe config format, Cyrill Gorcunov, (Fri Nov 26, 10:16 am)
Re: [rfc 1/3] perf, x86: P4 PMU - describe config format, Stephane Eranian, (Fri Nov 26, 11:05 am)
Re: [rfc 1/3] perf, x86: P4 PMU - describe config format, Cyrill Gorcunov, (Fri Nov 26, 1:11 pm)