summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSong Liu <songliubraving@fb.com>2019-02-04 11:31:40 -0800
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-02-14 13:31:11 -0300
commit39f4a913d6d439178177cae8aa2e9a232160fd51 (patch)
tree8c80a8796a7462d795f95fa8de2410b60df1b942
parent33937e599449c65dbd69c60d7e2255012427baed (diff)
downloadlinux-39f4a913d6d439178177cae8aa2e9a232160fd51.tar.bz2
perf utils: Silence "Couldn't synthesize bpf events" warning for EPERM
Synthesizing BPF events is only supported for root. Silent warning msg when non-root user runs perf-record. Reported-by: David Carrillo-Cisneros <davidca@fb.com> Signed-off-by: Song Liu <songliubraving@fb.com> Tested-by: David Carrillo-Cisneros <davidca@fb.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Cc: kernel-team@fb.com Link: http://lkml.kernel.org/r/20190204193140.719740-1-songliubraving@fb.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/util/bpf-event.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/bpf-event.c b/tools/perf/util/bpf-event.c
index 796ef793f4ce..62dda96b0096 100644
--- a/tools/perf/util/bpf-event.c
+++ b/tools/perf/util/bpf-event.c
@@ -236,8 +236,8 @@ int perf_event__synthesize_bpf_events(struct perf_tool *tool,
pr_debug("%s: can't get next program: %s%s",
__func__, strerror(errno),
errno == EINVAL ? " -- kernel too old?" : "");
- /* don't report error on old kernel */
- err = (errno == EINVAL) ? 0 : -1;
+ /* don't report error on old kernel or EPERM */
+ err = (errno == EINVAL || errno == EPERM) ? 0 : -1;
break;
}
fd = bpf_prog_get_fd_by_id(id);