From 4b016037b6018c1efae24213c0ec7c9b13901e83 Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Tue, 21 Jul 2009 10:30:36 +0200 Subject: [PATCH] --- yaml --- r: 155730 b: refs/heads/master c: 0fdc7e67dd312986e30b861adff48732bd33eb3f h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/tools/perf/builtin-top.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index fc243a31de32..46f764eb7f1d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d20ff6bd6bba2e7e6681fa17565347b410c46ab3 +refs/heads/master: 0fdc7e67dd312986e30b861adff48732bd33eb3f diff --git a/trunk/tools/perf/builtin-top.c b/trunk/tools/perf/builtin-top.c index 95d5c0ae375a..c0a423004e15 100644 --- a/trunk/tools/perf/builtin-top.c +++ b/trunk/tools/perf/builtin-top.c @@ -58,6 +58,7 @@ static u64 count_filter = 5; static int print_entries = 15; static int target_pid = -1; +static int inherit = 0; static int profile_cpu = -1; static int nr_cpus = 0; static unsigned int realtime_prio = 0; @@ -549,7 +550,7 @@ int group_fd; static void start_counter(int i, int counter) { struct perf_counter_attr *attr; - unsigned int cpu; + int cpu; cpu = profile_cpu; if (target_pid == -1 && profile_cpu == -1) @@ -559,6 +560,7 @@ static void start_counter(int i, int counter) attr->sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_TID; attr->freq = freq; + attr->inherit = (cpu < 0) && inherit; try_again: fd[i][counter] = sys_perf_counter_open(attr, target_pid, cpu, group_fd, 0); @@ -685,6 +687,8 @@ static const struct option options[] = { "only display functions with more events than this"), OPT_BOOLEAN('g', "group", &group, "put the counters into a counter group"), + OPT_BOOLEAN('i', "inherit", &inherit, + "child tasks inherit counters"), OPT_STRING('s', "sym-filter", &sym_filter, "pattern", "only display symbols matchig this pattern"), OPT_BOOLEAN('z', "zero", &zero,