aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-stat.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-stat.c')
-rw-r--r--tools/perf/builtin-stat.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 201ef2367dcb..2e03524a1de0 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -116,8 +116,9 @@ static void create_perf_stat_counter(int counter, int pid)
116 fd[cpu][counter], strerror(errno)); 116 fd[cpu][counter], strerror(errno));
117 } 117 }
118 } else { 118 } else {
119 attr->inherit = inherit; 119 attr->inherit = inherit;
120 attr->disabled = 1; 120 attr->disabled = 1;
121 attr->enable_on_exec = 1;
121 122
122 fd[0][counter] = sys_perf_counter_open(attr, pid, -1, -1, 0); 123 fd[0][counter] = sys_perf_counter_open(attr, pid, -1, -1, 0);
123 if (fd[0][counter] < 0 && verbose) 124 if (fd[0][counter] < 0 && verbose)
@@ -262,7 +263,6 @@ static int run_perf_stat(int argc, const char **argv)
262 * Enable counters and exec the command: 263 * Enable counters and exec the command:
263 */ 264 */
264 t0 = rdclock(); 265 t0 = rdclock();
265 prctl(PR_TASK_PERF_COUNTERS_ENABLE);
266 266
267 close(go_pipe[1]); 267 close(go_pipe[1]);
268 wait(&status); 268 wait(&status);