* What perf_event_paranoid can do?
@ 2011-03-21 6:14 陳韋任
2011-03-21 8:35 ` Lin Ming
0 siblings, 1 reply; 9+ messages in thread
From: 陳韋任 @ 2011-03-21 6:14 UTC (permalink / raw)
To: linux-perf-users
Hi, folks
I don't know what "perf_event_paranoid" is for. Sometimes
`perf` told me tweaking perf_event_paranoid. For example,
$ perf stat -e branches:pp ls
No permission to collect stats.
Consider tweaking /proc/sys/kernel/perf_event_paranoid.
I cannot find any document talks about what perf_event_paranoid
is and what we can do on it.
Any suggestion appreciated.
Regards,
chenwj
--
Wei-Ren Chen (陳韋任)
Parallel Processing Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: What perf_event_paranoid can do?
2011-03-21 6:14 What perf_event_paranoid can do? 陳韋任
@ 2011-03-21 8:35 ` Lin Ming
2011-03-21 9:19 ` 陳韋任
2011-03-21 9:56 ` 陳韋任
0 siblings, 2 replies; 9+ messages in thread
From: Lin Ming @ 2011-03-21 8:35 UTC (permalink / raw)
To: linux-perf-users; +Cc: 陳韋任
On Mon, Mar 21, 2011 at 2:14 PM, 陳韋任 <chenwj@iis.sinica.edu.tw> wrote:
> Hi, folks
>
> I don't know what "perf_event_paranoid" is for. Sometimes
> `perf` told me tweaking perf_event_paranoid. For example,
>
> $ perf stat -e branches:pp ls
> No permission to collect stats.
> Consider tweaking /proc/sys/kernel/perf_event_paranoid.
>
> I cannot find any document talks about what perf_event_paranoid
> is and what we can do on it.
It's used to control if some action is allowed or not for normal user.
See comments at kernel/perf_event.c:
/*
* perf event paranoia level:
* -1 - not paranoid at all
* 0 - disallow raw tracepoint access for unpriv
* 1 - disallow cpu events for unpriv
* 2 - disallow kernel profiling for unpriv
*/
Lin Ming
>
> Any suggestion appreciated.
>
> Regards,
> chenwj
>
> --
> Wei-Ren Chen (陳韋任)
> Parallel Processing Lab, Institute of Information Science,
> Academia Sinica, Taiwan (R.O.C.)
> Tel:886-2-2788-3799 #1667
> --
> To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: What perf_event_paranoid can do?
2011-03-21 8:35 ` Lin Ming
@ 2011-03-21 9:19 ` 陳韋任
2011-03-21 9:56 ` 陳韋任
1 sibling, 0 replies; 9+ messages in thread
From: 陳韋任 @ 2011-03-21 9:19 UTC (permalink / raw)
To: Lin Ming; +Cc: linux-perf-users, 陳韋任
Thanks, Lin.
--
Wei-Ren Chen (陳韋任)
Parallel Processing Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: What perf_event_paranoid can do?
2011-03-21 8:35 ` Lin Ming
2011-03-21 9:19 ` 陳韋任
@ 2011-03-21 9:56 ` 陳韋任
2011-03-21 13:46 ` Lin Ming
1 sibling, 1 reply; 9+ messages in thread
From: 陳韋任 @ 2011-03-21 9:56 UTC (permalink / raw)
To: Lin Ming; +Cc: linux-perf-users, 陳韋任
Hi, Lin
> It's used to control if some action is allowed or not for normal user.
> See comments at kernel/perf_event.c:
>
> /*
> * perf event paranoia level:
> * -1 - not paranoid at all
> * 0 - disallow raw tracepoint access for unpriv
> * 1 - disallow cpu events for unpriv
> * 2 - disallow kernel profiling for unpriv
> */
I assume -1 give normal user the most high level privilege,
but it doesn't work. I have tried -1 through 2, but none of
them works. Any suggestion? Or maybe the event "branches" does
not support PBES modifier (pp)?
Thanks!
Regards,
chenwj
--
Wei-Ren Chen (陳韋任)
Parallel Processing Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: What perf_event_paranoid can do?
2011-03-21 9:56 ` 陳韋任
@ 2011-03-21 13:46 ` Lin Ming
2011-03-21 13:51 ` Lin Ming
0 siblings, 1 reply; 9+ messages in thread
From: Lin Ming @ 2011-03-21 13:46 UTC (permalink / raw)
To: linux-perf-users, 陳韋任
2011/3/21 陳韋任 <chenwj@iis.sinica.edu.tw>:
> Hi, Lin
>
>> It's used to control if some action is allowed or not for normal user.
>> See comments at kernel/perf_event.c:
>>
>> /*
>> * perf event paranoia level:
>> * -1 - not paranoid at all
>> * 0 - disallow raw tracepoint access for unpriv
>> * 1 - disallow cpu events for unpriv
>> * 2 - disallow kernel profiling for unpriv
>> */
>
> I assume -1 give normal user the most high level privilege,
> but it doesn't work. I have tried -1 through 2, but none of
> them works. Any suggestion? Or maybe the event "branches" does
> not support PBES modifier (pp)?
In x86_setup_perfctr:
/*
* Branch tracing:
*/
if ((attr->config == PERF_COUNT_HW_BRANCH_INSTRUCTIONS) &&
(hwc->sample_period == 1)) {
/* BTS is not supported by this architecture. */
if (!x86_pmu.bts_active)
return -EOPNOTSUPP;
/* BTS is currently only allowed for user-mode. */
if (!attr->exclude_kernel)
return -EOPNOTSUPP;
}
Does your CPU support PEBS? Please attach below output.
dmesg |grep "Performance Events"
Lin Ming
>
> Thanks!
>
> Regards,
> chenwj
>
> --
> Wei-Ren Chen (陳韋任)
> Parallel Processing Lab, Institute of Information Science,
> Academia Sinica, Taiwan (R.O.C.)
> Tel:886-2-2788-3799 #1667
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: What perf_event_paranoid can do?
2011-03-21 13:46 ` Lin Ming
@ 2011-03-21 13:51 ` Lin Ming
2011-03-22 1:10 ` 陳韋任
0 siblings, 1 reply; 9+ messages in thread
From: Lin Ming @ 2011-03-21 13:51 UTC (permalink / raw)
To: linux-perf-users, 陳韋任
2011/3/21 Lin Ming <minggr@gmail.com>:
> 2011/3/21 陳韋任 <chenwj@iis.sinica.edu.tw>:
>> Hi, Lin
>>
>>> It's used to control if some action is allowed or not for normal user.
>>> See comments at kernel/perf_event.c:
>>>
>>> /*
>>> * perf event paranoia level:
>>> * -1 - not paranoid at all
>>> * 0 - disallow raw tracepoint access for unpriv
>>> * 1 - disallow cpu events for unpriv
>>> * 2 - disallow kernel profiling for unpriv
>>> */
>>
>> I assume -1 give normal user the most high level privilege,
>> but it doesn't work. I have tried -1 through 2, but none of
>> them works. Any suggestion? Or maybe the event "branches" does
>> not support PBES modifier (pp)?
>
> In x86_setup_perfctr:
>
> /*
> * Branch tracing:
> */
> if ((attr->config == PERF_COUNT_HW_BRANCH_INSTRUCTIONS) &&
> (hwc->sample_period == 1)) {
> /* BTS is not supported by this architecture. */
> if (!x86_pmu.bts_active)
> return -EOPNOTSUPP;
>
> /* BTS is currently only allowed for user-mode. */
> if (!attr->exclude_kernel)
> return -EOPNOTSUPP;
> }
>
> Does your CPU support PEBS? Please attach below output.
>
> dmesg |grep "Performance Events"
And also "cat /proc/cpuinfo"
Thanks,
Lin Ming
>
> Lin Ming
>
>>
>> Thanks!
>>
>> Regards,
>> chenwj
>>
>> --
>> Wei-Ren Chen (陳韋任)
>> Parallel Processing Lab, Institute of Information Science,
>> Academia Sinica, Taiwan (R.O.C.)
>> Tel:886-2-2788-3799 #1667
>>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: What perf_event_paranoid can do?
2011-03-21 13:51 ` Lin Ming
@ 2011-03-22 1:10 ` 陳韋任
2011-03-22 1:55 ` 陳韋任
0 siblings, 1 reply; 9+ messages in thread
From: 陳韋任 @ 2011-03-22 1:10 UTC (permalink / raw)
To: Lin Ming; +Cc: linux-perf-users, 陳韋任
[-- Attachment #1: Type: text/plain, Size: 385 bytes --]
Hi, Lin
> > Does your CPU support PEBS? Please attach below output.
> >
> > dmesg |grep "Performance Events"
>
> And also "cat /proc/cpuinfo"
The attachment are output of dmesg and cpuinfo. Thanks.
Regards,
chenwj
--
Wei-Ren Chen (陳韋任)
Parallel Processing Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
[-- Attachment #2: dmesg.txt --]
[-- Type: text/plain, Size: 64 bytes --]
Performance Events: PEBS fmt0+, Core2 events, Intel PMU driver.
[-- Attachment #3: cpuinfo.txt --]
[-- Type: text/plain, Size: 6136 bytes --]
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Xeon(R) CPU E5410 @ 2.33GHz
stepping : 6
cpu MHz : 2327.585
cache size : 6144 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 4
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 lahf_lm dts tpr_shadow vnmi flexpriority
bogomips : 4657.13
clflush size : 64
cache_alignment : 64
address sizes : 38 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Xeon(R) CPU E5410 @ 2.33GHz
stepping : 6
cpu MHz : 2327.585
cache size : 6144 KB
physical id : 1
siblings : 4
core id : 0
cpu cores : 4
apicid : 4
initial apicid : 4
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 lahf_lm dts tpr_shadow vnmi flexpriority
bogomips : 4656.99
clflush size : 64
cache_alignment : 64
address sizes : 38 bits physical, 48 bits virtual
power management:
processor : 2
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Xeon(R) CPU E5410 @ 2.33GHz
stepping : 6
cpu MHz : 2327.585
cache size : 6144 KB
physical id : 0
siblings : 4
core id : 1
cpu cores : 4
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 lahf_lm dts tpr_shadow vnmi flexpriority
bogomips : 4656.99
clflush size : 64
cache_alignment : 64
address sizes : 38 bits physical, 48 bits virtual
power management:
processor : 3
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Xeon(R) CPU E5410 @ 2.33GHz
stepping : 6
cpu MHz : 2327.585
cache size : 6144 KB
physical id : 1
siblings : 4
core id : 1
cpu cores : 4
apicid : 5
initial apicid : 5
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 lahf_lm dts tpr_shadow vnmi flexpriority
bogomips : 4656.00
clflush size : 64
cache_alignment : 64
address sizes : 38 bits physical, 48 bits virtual
power management:
processor : 4
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Xeon(R) CPU E5410 @ 2.33GHz
stepping : 6
cpu MHz : 2327.585
cache size : 6144 KB
physical id : 0
siblings : 4
core id : 2
cpu cores : 4
apicid : 2
initial apicid : 2
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 lahf_lm dts tpr_shadow vnmi flexpriority
bogomips : 4656.96
clflush size : 64
cache_alignment : 64
address sizes : 38 bits physical, 48 bits virtual
power management:
processor : 5
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Xeon(R) CPU E5410 @ 2.33GHz
stepping : 6
cpu MHz : 2327.585
cache size : 6144 KB
physical id : 1
siblings : 4
core id : 2
cpu cores : 4
apicid : 6
initial apicid : 6
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 lahf_lm dts tpr_shadow vnmi flexpriority
bogomips : 4656.99
clflush size : 64
cache_alignment : 64
address sizes : 38 bits physical, 48 bits virtual
power management:
processor : 6
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Xeon(R) CPU E5410 @ 2.33GHz
stepping : 6
cpu MHz : 2327.585
cache size : 6144 KB
physical id : 0
siblings : 4
core id : 3
cpu cores : 4
apicid : 3
initial apicid : 3
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 lahf_lm dts tpr_shadow vnmi flexpriority
bogomips : 4509.06
clflush size : 64
cache_alignment : 64
address sizes : 38 bits physical, 48 bits virtual
power management:
processor : 7
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Xeon(R) CPU E5410 @ 2.33GHz
stepping : 6
cpu MHz : 2327.585
cache size : 6144 KB
physical id : 1
siblings : 4
core id : 3
cpu cores : 4
apicid : 7
initial apicid : 7
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 lahf_lm dts tpr_shadow vnmi flexpriority
bogomips : 4656.99
clflush size : 64
cache_alignment : 64
address sizes : 38 bits physical, 48 bits virtual
power management:
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: What perf_event_paranoid can do?
2011-03-22 1:10 ` 陳韋任
@ 2011-03-22 1:55 ` 陳韋任
2011-03-22 3:09 ` Lin Ming
0 siblings, 1 reply; 9+ messages in thread
From: 陳韋任 @ 2011-03-22 1:55 UTC (permalink / raw)
To: Lin Ming, linux-perf-users, 陳韋任
Hi, Lin
As the discussion on the mailing list (see below) said,
He suspected the older perf may over-interpret the error
code, thus gave me poor error message.
http://www.mail-archive.com/perfmon2-devel@lists.sourceforge.net/msg02927.html
Is it possible to build a newer perf by a "normal" user
himself? Or the newer perf needs a kernel update to work
correctly?
Regards,
chenwj
--
Wei-Ren Chen (陳韋任)
Parallel Processing Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: What perf_event_paranoid can do?
2011-03-22 1:55 ` 陳韋任
@ 2011-03-22 3:09 ` Lin Ming
0 siblings, 0 replies; 9+ messages in thread
From: Lin Ming @ 2011-03-22 3:09 UTC (permalink / raw)
To: Lin Ming, linux-perf-users, 陳韋任
On Tue, Mar 22, 2011 at 9:55 AM, 陳韋任 <chenwj@iis.sinica.edu.tw> wrote:
> Hi, Lin
>
> As the discussion on the mailing list (see below) said,
> He suspected the older perf may over-interpret the error
> code, thus gave me poor error message.
>
> http://www.mail-archive.com/perfmon2-devel@lists.sourceforge.net/msg02927.html
>
> Is it possible to build a newer perf by a "normal" user
> himself? Or the newer perf needs a kernel update to work
> correctly?
Yes, you can build perf tool by a non-root normal user.
$ cd linux-2.6/tools/perf
$ make
$ ./perf stat -e branches:pp ls
The code changes frequently, you'd better also build a new kernel, for
example 2.6.38.
So I can analyze where from problem is with the same kernel version.
Lin Ming
>
> Regards,
> chenwj
>
> --
> Wei-Ren Chen (陳韋任)
> Parallel Processing Lab, Institute of Information Science,
> Academia Sinica, Taiwan (R.O.C.)
> Tel:886-2-2788-3799 #1667
>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2011-03-22 3:09 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-21 6:14 What perf_event_paranoid can do? 陳韋任
2011-03-21 8:35 ` Lin Ming
2011-03-21 9:19 ` 陳韋任
2011-03-21 9:56 ` 陳韋任
2011-03-21 13:46 ` Lin Ming
2011-03-21 13:51 ` Lin Ming
2011-03-22 1:10 ` 陳韋任
2011-03-22 1:55 ` 陳韋任
2011-03-22 3:09 ` Lin Ming
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).