summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-top.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2012-02-14 14:18:57 -0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-02-14 14:18:57 -0200
commit808e122630d45a7f036d25582474d70548a87e2c (patch)
tree96a8d45358110ce48f184d2a62f7816022ff5c1a /tools/perf/builtin-top.c
parent0c9781280fb672ca09c997df3f14ba506bbdb977 (diff)
perf tools: Invert the sample_id_all logic
Instead of requiring that users of perf_record_opts set .sample_id_all_avail to true, just invert the logic, using .sample_id_all_missing, that doesn't need to be explicitely initialized since gcc will zero members ommitted in a struct initialization. Just like the newly introduced .exclude_{guest,host} feature test. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-ab772uzk78cwybihf0vt7kxw@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r--tools/perf/builtin-top.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 02e11ff5a72..e3c63aef8ef 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -876,7 +876,7 @@ fallback_missing_features:
if (top->exclude_guest_missing)
attr->exclude_guest = attr->exclude_host = 0;
retry_sample_id:
- attr->sample_id_all = top->sample_id_all_avail ? 1 : 0;
+ attr->sample_id_all = top->sample_id_all_missing ? 0 : 1;
try_again:
if (perf_evsel__open(counter, top->evlist->cpus,
top->evlist->threads, top->group,
@@ -893,11 +893,11 @@ try_again:
"guest or host samples.\n");
top->exclude_guest_missing = true;
goto fallback_missing_features;
- } else if (top->sample_id_all_avail) {
+ } else if (!top->sample_id_all_missing) {
/*
* Old kernel, no attr->sample_id_type_all field
*/
- top->sample_id_all_avail = false;
+ top->sample_id_all_missing = true;
goto retry_sample_id;
}
}
@@ -1122,7 +1122,6 @@ int cmd_top(int argc, const char **argv, const char *prefix __used)
.delay_secs = 2,
.uid = UINT_MAX,
.freq = 1000, /* 1 KHz */
- .sample_id_all_avail = true,
.mmap_pages = 128,
.sym_pcnt_filter = 5,
};