linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf utils: silent "Couldn't synthesize bpf events" warning for EPERM
@ 2019-02-04 19:31 Song Liu
  2019-02-04 19:33 ` Song Liu
  2019-02-15  9:32 ` [tip:perf/core] perf utils: Silence " tip-bot for Song Liu
  0 siblings, 2 replies; 4+ messages in thread
From: Song Liu @ 2019-02-04 19:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: Song Liu, kernel-team, Arnaldo Carvalho de Melo, Jiri Olsa

Synthesizing BPF events is only supported for root. Silent warning msg
when non-root user runs perf-record.

Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Reported-by: David Carrillo-Cisneros <davidca@fb.com>
Tested-by: David Carrillo-Cisneros <davidca@fb.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
---
 tools/perf/util/bpf-event.c | 4 ++--
 1 file 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);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf utils: silent "Couldn't synthesize bpf events" warning for EPERM
  2019-02-04 19:31 [PATCH] perf utils: silent "Couldn't synthesize bpf events" warning for EPERM Song Liu
@ 2019-02-04 19:33 ` Song Liu
  2019-02-04 20:30   ` Jiri Olsa
  2019-02-15  9:32 ` [tip:perf/core] perf utils: Silence " tip-bot for Song Liu
  1 sibling, 1 reply; 4+ messages in thread
From: Song Liu @ 2019-02-04 19:33 UTC (permalink / raw)
  To: lkml
  Cc: Kernel Team, Arnaldo Carvalho de Melo, Jiri Olsa,
	David Carrillo Cisneros



> On Feb 4, 2019, at 11:31 AM, Song Liu <songliubraving@fb.com> wrote:
> 
> Synthesizing BPF events is only supported for root. Silent warning msg
> when non-root user runs perf-record.
> 
> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
> Cc: Jiri Olsa <jolsa@redhat.com>
> Reported-by: David Carrillo-Cisneros <davidca@fb.com>
> Tested-by: David Carrillo-Cisneros <davidca@fb.com>
> Signed-off-by: Song Liu <songliubraving@fb.com>
> ---
> tools/perf/util/bpf-event.c | 4 ++--
> 1 file 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);
> -- 
> 2.17.1
> 

CC David. 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf utils: silent "Couldn't synthesize bpf events" warning for EPERM
  2019-02-04 19:33 ` Song Liu
@ 2019-02-04 20:30   ` Jiri Olsa
  0 siblings, 0 replies; 4+ messages in thread
From: Jiri Olsa @ 2019-02-04 20:30 UTC (permalink / raw)
  To: Song Liu
  Cc: lkml, Kernel Team, Arnaldo Carvalho de Melo, David Carrillo Cisneros

On Mon, Feb 04, 2019 at 07:33:06PM +0000, Song Liu wrote:
> 
> 
> > On Feb 4, 2019, at 11:31 AM, Song Liu <songliubraving@fb.com> wrote:
> > 
> > Synthesizing BPF events is only supported for root. Silent warning msg
> > when non-root user runs perf-record.

great, it was annoying ;-)

Tested-by: Jiri Olsa <jolsa@kernel.org>

thanks,
jirka

> > 
> > Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
> > Cc: Jiri Olsa <jolsa@redhat.com>
> > Reported-by: David Carrillo-Cisneros <davidca@fb.com>
> > Tested-by: David Carrillo-Cisneros <davidca@fb.com>
> > Signed-off-by: Song Liu <songliubraving@fb.com>
> > ---
> > tools/perf/util/bpf-event.c | 4 ++--
> > 1 file 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);
> > -- 
> > 2.17.1
> > 
> 
> CC David. 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [tip:perf/core] perf utils: Silence "Couldn't synthesize bpf events" warning for EPERM
  2019-02-04 19:31 [PATCH] perf utils: silent "Couldn't synthesize bpf events" warning for EPERM Song Liu
  2019-02-04 19:33 ` Song Liu
@ 2019-02-15  9:32 ` tip-bot for Song Liu
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Song Liu @ 2019-02-15  9:32 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, songliubraving, hpa, jolsa, davidca, acme, tglx, mingo

Commit-ID:  39f4a913d6d439178177cae8aa2e9a232160fd51
Gitweb:     https://git.kernel.org/tip/39f4a913d6d439178177cae8aa2e9a232160fd51
Author:     Song Liu <songliubraving@fb.com>
AuthorDate: Mon, 4 Feb 2019 11:31:40 -0800
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 14 Feb 2019 13:31:11 -0300

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>
---
 tools/perf/util/bpf-event.c | 4 ++--
 1 file 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);

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-15  9:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-04 19:31 [PATCH] perf utils: silent "Couldn't synthesize bpf events" warning for EPERM Song Liu
2019-02-04 19:33 ` Song Liu
2019-02-04 20:30   ` Jiri Olsa
2019-02-15  9:32 ` [tip:perf/core] perf utils: Silence " tip-bot for Song Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).