mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 22:54:05 +08:00
perf record: Use per-task-per-cpu events for inherited events
Create events with a pid and cpu contraint for inherited events so that we get a stream per cpu, instead of all cpus contending on a single stream. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: fweisbec@gmail.com Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <20091216165904.987643843@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
856e96608a
commit
60ab271617
@ -278,7 +278,7 @@ static void create_counter(int counter, int cpu, pid_t pid)
|
|||||||
|
|
||||||
attr->mmap = track;
|
attr->mmap = track;
|
||||||
attr->comm = track;
|
attr->comm = track;
|
||||||
attr->inherit = (cpu < 0) && inherit;
|
attr->inherit = inherit;
|
||||||
attr->disabled = 1;
|
attr->disabled = 1;
|
||||||
|
|
||||||
try_again:
|
try_again:
|
||||||
@ -537,7 +537,7 @@ static int __cmd_record(int argc __used, const char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!system_wide || profile_cpu != -1) {
|
if ((!system_wide && !inherit) || profile_cpu != -1) {
|
||||||
open_counters(profile_cpu, target_pid);
|
open_counters(profile_cpu, target_pid);
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < nr_cpus; i++)
|
for (i = 0; i < nr_cpus; i++)
|
||||||
|
Loading…
Reference in New Issue
Block a user