提交 39f4a913 编写于 作者: S Song Liu 提交者: Arnaldo Carvalho de Melo

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: NDavid Carrillo-Cisneros <davidca@fb.com>
Signed-off-by: NSong Liu <songliubraving@fb.com>
Tested-by: NDavid Carrillo-Cisneros <davidca@fb.com>
Acked-by: NJiri Olsa <jolsa@kernel.org>
Cc: kernel-team@fb.com
Link: http://lkml.kernel.org/r/20190204193140.719740-1-songliubraving@fb.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 33937e59
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册