diff options
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r-- | tools/perf/builtin-report.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 3fc0d471b90b..d2e28820ee60 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, | |||
37 | static struct strlist *dso_list, *comm_list, *sym_list; | 37 | static struct strlist *dso_list, *comm_list, *sym_list; |
38 | static char *field_sep; | 38 | static char *field_sep; |
39 | 39 | ||
40 | static int force; | ||
40 | static int input; | 41 | static int input; |
41 | static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV; | 42 | static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV; |
42 | 43 | ||
@@ -1404,6 +1405,11 @@ static int __cmd_report(void) | |||
1404 | exit(-1); | 1405 | exit(-1); |
1405 | } | 1406 | } |
1406 | 1407 | ||
1408 | if (!force && (input_stat.st_uid != geteuid())) { | ||
1409 | fprintf(stderr, "file: %s not owned by current user\n", input_name); | ||
1410 | exit(-1); | ||
1411 | } | ||
1412 | |||
1407 | if (!input_stat.st_size) { | 1413 | if (!input_stat.st_size) { |
1408 | fprintf(stderr, "zero-sized file, nothing to do!\n"); | 1414 | fprintf(stderr, "zero-sized file, nothing to do!\n"); |
1409 | exit(0); | 1415 | exit(0); |
@@ -1615,6 +1621,7 @@ static const struct option options[] = { | |||
1615 | OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, | 1621 | OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, |
1616 | "dump raw trace in ASCII"), | 1622 | "dump raw trace in ASCII"), |
1617 | OPT_STRING('k', "vmlinux", &vmlinux_name, "file", "vmlinux pathname"), | 1623 | OPT_STRING('k', "vmlinux", &vmlinux_name, "file", "vmlinux pathname"), |
1624 | OPT_BOOLEAN('f', "force", &force, "don't complain, do it"), | ||
1618 | OPT_BOOLEAN('m', "modules", &modules, | 1625 | OPT_BOOLEAN('m', "modules", &modules, |
1619 | "load module symbols - WARNING: use only with -k and LIVE kernel"), | 1626 | "load module symbols - WARNING: use only with -k and LIVE kernel"), |
1620 | OPT_BOOLEAN('n', "show-nr-samples", &show_nr_samples, | 1627 | OPT_BOOLEAN('n', "show-nr-samples", &show_nr_samples, |