perf stat: Support --all-kernel/--all-user
[linux-2.6-microblaze.git] / tools / perf / util / stat.c
index ebdd130..6822e4f 100644 (file)
@@ -490,6 +490,16 @@ int create_perf_stat_counter(struct evsel *evsel,
        if (config->identifier)
                attr->sample_type = PERF_SAMPLE_IDENTIFIER;
 
+       if (config->all_user) {
+               attr->exclude_kernel = 1;
+               attr->exclude_user   = 0;
+       }
+
+       if (config->all_kernel) {
+               attr->exclude_kernel = 0;
+               attr->exclude_user   = 1;
+       }
+
        /*
         * Disabling all counters initially, they will be enabled
         * either manually by us or by kernel via enable_on_exec