aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-top.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r--tools/perf/builtin-top.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 95d5c0ae375a..f139f1ab9333 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -58,6 +58,7 @@ static u64 count_filter = 5;
58static int print_entries = 15; 58static int print_entries = 15;
59 59
60static int target_pid = -1; 60static int target_pid = -1;
61static int inherit = 0;
61static int profile_cpu = -1; 62static int profile_cpu = -1;
62static int nr_cpus = 0; 63static int nr_cpus = 0;
63static unsigned int realtime_prio = 0; 64static unsigned int realtime_prio = 0;
@@ -284,6 +285,7 @@ static const char *skip_symbols[] = {
284 "enter_idle", 285 "enter_idle",
285 "exit_idle", 286 "exit_idle",
286 "mwait_idle", 287 "mwait_idle",
288 "mwait_idle_with_hints",
287 "ppc64_runlatch_off", 289 "ppc64_runlatch_off",
288 "pseries_dedicated_idle_sleep", 290 "pseries_dedicated_idle_sleep",
289 NULL 291 NULL
@@ -549,7 +551,7 @@ int group_fd;
549static void start_counter(int i, int counter) 551static void start_counter(int i, int counter)
550{ 552{
551 struct perf_counter_attr *attr; 553 struct perf_counter_attr *attr;
552 unsigned int cpu; 554 int cpu;
553 555
554 cpu = profile_cpu; 556 cpu = profile_cpu;
555 if (target_pid == -1 && profile_cpu == -1) 557 if (target_pid == -1 && profile_cpu == -1)
@@ -559,6 +561,7 @@ static void start_counter(int i, int counter)
559 561
560 attr->sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_TID; 562 attr->sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_TID;
561 attr->freq = freq; 563 attr->freq = freq;
564 attr->inherit = (cpu < 0) && inherit;
562 565
563try_again: 566try_again:
564 fd[i][counter] = sys_perf_counter_open(attr, target_pid, cpu, group_fd, 0); 567 fd[i][counter] = sys_perf_counter_open(attr, target_pid, cpu, group_fd, 0);
@@ -685,6 +688,8 @@ static const struct option options[] = {
685 "only display functions with more events than this"), 688 "only display functions with more events than this"),
686 OPT_BOOLEAN('g', "group", &group, 689 OPT_BOOLEAN('g', "group", &group,
687 "put the counters into a counter group"), 690 "put the counters into a counter group"),
691 OPT_BOOLEAN('i', "inherit", &inherit,
692 "child tasks inherit counters"),
688 OPT_STRING('s', "sym-filter", &sym_filter, "pattern", 693 OPT_STRING('s', "sym-filter", &sym_filter, "pattern",
689 "only display symbols matchig this pattern"), 694 "only display symbols matchig this pattern"),
690 OPT_BOOLEAN('z', "zero", &zero, 695 OPT_BOOLEAN('z', "zero", &zero,