Re: [PATCH 11/18] tracing: Add symbol type to function based events
From: Steven Rostedt
Date: Thu Feb 08 2018 - 10:48:52 EST
On Thu, 8 Feb 2018 20:03:41 +0900
Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
> > @@ -76,6 +76,7 @@ typedef u64 x64;
> > typedef u32 x32;
> > typedef u16 x16;
> > typedef u8 x8;
> > +typedef void * symbol;
> >
> > #define TYPE_TUPLE(type) \
> > { #type, sizeof(type), is_signed_type(type) }
> > @@ -97,7 +98,8 @@ typedef u8 x8;
> > TYPE_TUPLE(x16), \
> > TYPE_TUPLE(u8), \
> > TYPE_TUPLE(s8), \
> > - TYPE_TUPLE(x8)
> > + TYPE_TUPLE(x8), \
> > + TYPE_TUPLE(symbol)
> >
> > static struct func_type {
> > char *name;
> > @@ -262,7 +264,7 @@ process_event(struct func_event *fevent, const char *token, enum func_states sta
> > switch (state) {
> > case FUNC_STATE_INIT:
> > unsign = 0;
> > - if (!isalpha(token[0]))
> > + if (!isalpha(token[0]) && token[0] != '_')
> > break;
>
> Hmm.. it seems that it needs to be moved to the patch 1?
Agreed.
>
>
> > /* Do not allow wild cards */
> > if (strstr(token, "*") || strstr(token, "?"))
> > @@ -305,7 +307,7 @@ process_event(struct func_event *fevent, const char *token, enum func_states sta
> > return FUNC_STATE_TYPE;
> >
> > case FUNC_STATE_TYPE:
> > - if (!isalpha(token[0]))
> > + if (!isalpha(token[0]) || token[0] == '_')
> > break;
>
> Why is different that the above? Anyway, '_' is not an alphabet..
That's a bug. I thought I fixed that. Ah, in v2 I fixed it in a later
patch. I'll restructure to fix it in the proper place.
Thanks!
-- Steve