aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-annotate.c
diff options
context:
space:
mode:
authorPierre Habouzit <[email protected]>2009-08-27 07:59:02 +0000
committerIngo Molnar <[email protected]>2009-08-28 11:47:43 +0000
commit119e7a22bb70d84849384e5113792cd45afa4f85 (patch)
treed9a1cb5b125922e33bd39bf62cac4f4679f10634 /tools/perf/builtin-annotate.c
parentperf top: Show RIP only in verbose mode (diff)
downloadkernel-119e7a22bb70d84849384e5113792cd45afa4f85.tar.gz
kernel-119e7a22bb70d84849384e5113792cd45afa4f85.zip
perf tools: do not complain if root is owning perf.data
This improves patch fa6963b24 so that perf.data stuff that has been dumped as root can be read (annotate/report) by a user without the use of the --force. Rationale is that root has plenty of ways to screw us (usually) that do not require twisted schemes involving specially crafting a perf.data. Signed-off-by: Pierre Habouzit <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'tools/perf/builtin-annotate.c')
-rw-r--r--tools/perf/builtin-annotate.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 4ac618b34254..4c7bc4436236 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -984,8 +984,8 @@ 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);
+ if (!force && input_stat.st_uid && (input_stat.st_uid != geteuid())) {
+ fprintf(stderr, "file: %s not owned by current user or root\n", input_name);
exit(-1);
}