lkml.org 
[lkml]   [2017]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/5] perf-probe: Add warning message if there is unexpected event name
On Thu, 7 Dec 2017 12:53:43 -0300
Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Em Thu, Dec 07, 2017 at 04:19:45PM +0900, Masami Hiramatsu escreveu:
> > This improve the error message so that user can know
> > event-name error before writing new events to
> > kprobe-events interface.
> >
> > E.g.
> > ======
> > #./perf probe -x /lib64/libc-2.25.so malloc_get_state*
> > Internal error: "malloc_get_state@GLIBC_2" is wrong event name.
>
> I'm changing this to:
>
> Internal error: "malloc_get_state@GLIBC_2" is an invalid event name for the /sys/kernel/debug/tracing/kprobe_events interface.
>
> Ok?

Hmm, it is a kernel limitation (or spec). Would you think we really need it?
(are there any chance to allow '@' for event name?)

Thank you,

>
> - Arnaldo
>
> > Error: Failed to add events.
> > ======
> >
> > Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> > ---
> > tools/perf/util/probe-event.c | 8 ++++++++
> > 1 file changed, 8 insertions(+)
> >
> > diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
> > index b7aaf9b2294d..c0067950e56f 100644
> > --- a/tools/perf/util/probe-event.c
> > +++ b/tools/perf/util/probe-event.c
> > @@ -2625,6 +2625,14 @@ static int get_new_event_name(char *buf, size_t len, const char *base,
> >
> > out:
> > free(nbase);
> > +
> > + /* Final validation */
> > + if (ret >= 0 && !is_c_func_name(buf)) {
> > + pr_warning("Internal error: \"%s\" is wrong event name.\n",
> > + buf);
> > + ret = -EINVAL;
> > + }
> > +
> > return ret;
> > }
> >


--
Masami Hiramatsu <mhiramat@kernel.org>

\
 
 \ /
  Last update: 2017-12-08 03:49    [W:0.069 / U:1.188 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site