diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-08-19 12:50:35 (GMT) |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-08-24 07:24:01 (GMT) |
commit | 96d6e48bc6b38342a59ccd23e25907d12caaeaf8 (patch) | |
tree | b770d9e94545e198e120fac31f650600a855f689 /tools | |
parent | 6e086437f35ad9fda448711732c4ce0f82aad569 (diff) | |
parent | 4464fcaa9cbfc9c551956b48af203e2f775ca892 (diff) | |
download | linux-fsl-qoriq-96d6e48bc6b38342a59ccd23e25907d12caaeaf8.tar.xz |
Merge branch 'perfcounters/urgent' into perfcounters/core
Conflicts:
tools/perf/builtin-annotate.c
tools/perf/builtin-report.c
Merge reason: resolve these conflicts.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/Documentation/Makefile | 2 | ||||
-rw-r--r-- | tools/perf/Documentation/examples.txt (renamed from tools/perf/Documentation/perf-examples.txt) | 0 | ||||
-rw-r--r-- | tools/perf/builtin-annotate.c | 14 | ||||
-rw-r--r-- | tools/perf/builtin-report.c | 7 |
4 files changed, 22 insertions, 1 deletions
diff --git a/tools/perf/Documentation/Makefile b/tools/perf/Documentation/Makefile index 5457192..bdd3b7e 100644 --- a/tools/perf/Documentation/Makefile +++ b/tools/perf/Documentation/Makefile @@ -35,7 +35,7 @@ man7dir=$(mandir)/man7 # DESTDIR= ASCIIDOC=asciidoc -ASCIIDOC_EXTRA = +ASCIIDOC_EXTRA = --unsafe MANPAGE_XSL = manpage-normal.xsl XMLTO_EXTRA = INSTALL?=install diff --git a/tools/perf/Documentation/perf-examples.txt b/tools/perf/Documentation/examples.txt index 8eb6c48..8eb6c48 100644 --- a/tools/perf/Documentation/perf-examples.txt +++ b/tools/perf/Documentation/examples.txt diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 96d421f..4ac618b 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -28,6 +28,7 @@ static char const *input_name = "perf.data"; static char default_sort_order[] = "comm,symbol"; static char *sort_order = default_sort_order; +static int force; static int input; static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV; @@ -629,6 +630,13 @@ process_fork_event(event_t *event, unsigned long offset, unsigned long head) (void *)(long)(event->header.size), event->fork.pid, event->fork.ppid); + /* + * A thread clone will have the same PID for both + * parent and child. + */ + if (thread == parent) + return 0; + if (!thread || !parent || thread__fork(thread, parent)) { dump_printf("problem processing PERF_EVENT_FORK, skipping event.\n"); return -1; @@ -976,6 +984,11 @@ static int __cmd_annotate(void) exit(-1); } + if (!force && (input_stat.st_uid != geteuid())) { + fprintf(stderr, "file: %s not owned by current user\n", input_name); + exit(-1); + } + if (!input_stat.st_size) { fprintf(stderr, "zero-sized file, nothing to do!\n"); exit(0); @@ -1081,6 +1094,7 @@ static const struct option options[] = { "input file name"), OPT_STRING('s', "symbol", &sym_hist_filter, "symbol", "symbol to annotate"), + OPT_BOOLEAN('f', "force", &force, "don't complain, do it"), OPT_BOOLEAN('v', "verbose", &verbose, "be more verbose (show symbol address, etc)"), OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 3fc0d47..d2e2882 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -37,6 +37,7 @@ static char *dso_list_str, *comm_list_str, *sym_list_str, static struct strlist *dso_list, *comm_list, *sym_list; static char *field_sep; +static int force; static int input; static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV; @@ -1404,6 +1405,11 @@ static int __cmd_report(void) exit(-1); } + if (!force && (input_stat.st_uid != geteuid())) { + fprintf(stderr, "file: %s not owned by current user\n", input_name); + exit(-1); + } + if (!input_stat.st_size) { fprintf(stderr, "zero-sized file, nothing to do!\n"); exit(0); @@ -1615,6 +1621,7 @@ static const struct option options[] = { OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, "dump raw trace in ASCII"), OPT_STRING('k', "vmlinux", &vmlinux_name, "file", "vmlinux pathname"), + OPT_BOOLEAN('f', "force", &force, "don't complain, do it"), OPT_BOOLEAN('m', "modules", &modules, "load module symbols - WARNING: use only with -k and LIVE kernel"), OPT_BOOLEAN('n', "show-nr-samples", &show_nr_samples, |