/* * Builtin evlist command: Show the list of event selectors present * in a perf.data file. */ #include "builtin.h" #include "util/util.h" #include #include "perf.h" #include "util/evlist.h" #include "util/evsel.h" #include "util/parse-events.h" #include #include "util/session.h" #include "util/data.h" #include "util/debug.h" static int __cmd_evlist(const char *file_name, struct perf_attr_details *details) { struct perf_session *session; struct perf_evsel *pos; struct perf_data_file file = { .path = file_name, .mode = PERF_DATA_MODE_READ, .force = details->force, }; bool has_tracepoint = false; session = perf_session__new(&file, 0, NULL); if (session == NULL) return -1; evlist__for_each_entry(session->evlist, pos) { perf_evsel__fprintf(pos, details, stdout); if (pos->attr.type == PERF_TYPE_TRACEPOINT) has_tracepoint = true; } if (has_tracepoint && !details->trace_fields) printf("# Tip: use 'perf evlist --trace-fields' to show fields for tracepoint events\n"); perf_session__delete(session); return 0; } int cmd_evlist(int argc, const char **argv, const char *prefix __maybe_unused) { struct perf_attr_details details = { .verbose = false, }; const struct option options[] = { OPT_STRING('i', "input", &input_name, "file", "Input file name"), OPT_BOOLEAN('F', "freq", &details.freq, "Show the sample frequency"), OPT_BOOLEAN('v', "verbose", &details.verbose, "Show all event attr details"), OPT_BOOLEAN('g', "group", &details.event_group, "Show event group information"), OPT_BOOLEAN('f', "force", &details.force, "don't complain, do it"), OPT_BOOLEAN(0, "trace-fields", &details.trace_fields, "Show tracepoint fields"), OPT_END() }; const char * const evlist_usage[] = { "perf evlist []", NULL }; argc = parse_options(argc, argv, options, evlist_usage, 0); if (argc) usage_with_options(evlist_usage, options); if (details.event_group && (details.verbose || details.freq)) { usage_with_options_msg(evlist_usage, options, "--group option is not compatible with other options\n"); } return __cmd_evlist(input_name, &details); } &id=ac6e058b75be71208e98a5808453aae9a17be480'>diff
'20'>20
AgeCommit message (Expand)AuthorFilesLines
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2016-07-07 18:28:43 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-07-12 15:19:54 -0300
commitcec07f53c398f22576df77052c4777dc13f14962 (patch)
tree38b2c6d3718a0a33629249db930147495db84709 /tools/arch/x86
parent9c304f6c715f1849bb5b0d450a600dc731a80bda (diff)
perf tools: Move syscall number fallbacks from perf-sys.h to tools/arch/x86/include/asm/
And remove the empty tools/arch/x86/include/asm/unistd_{32,64}.h files introduced by eae7a755ee81 ("perf tools, x86: Build perf on older user-space as well"). This way we get closer to mirroring the kernel for cases where __NR_ can't be found for some include path/_GNU_SOURCE/whatever scenario. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-kpj6m3mbjw82kg6krk2z529e@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/arch/x86')