projects
/
platform
/
upstream
/
bcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f088bbf
)
cc: Only try to list ksyms if we're root
author
Vicent Marti
<tanoku@gmail.com>
Wed, 20 Apr 2016 11:24:54 +0000
(13:24 +0200)
committer
Vicent Marti
<tanoku@gmail.com>
Wed, 20 Apr 2016 11:24:54 +0000
(13:24 +0200)
src/cc/bcc_proc.c
patch
|
blob
|
history
diff --git
a/src/cc/bcc_proc.c
b/src/cc/bcc_proc.c
index
a44ba04
..
a12d9e4
100644
(file)
--- a/
src/cc/bcc_proc.c
+++ b/
src/cc/bcc_proc.c
@@
-111,8
+111,13
@@
int bcc_procutils_each_module(int pid, bcc_procutils_modulecb callback,
int bcc_procutils_each_ksym(bcc_procutils_ksymcb callback, void *payload) {
char line[2048];
- FILE *kallsyms
= fopen("/proc/kallsyms", "r")
;
+ FILE *kallsyms;
+ /* root is needed to list ksym addresses */
+ if (geteuid() != 0)
+ return -1;
+
+ kallsyms = fopen("/proc/kallsyms", "r");
if (!kallsyms)
return -1;