lkml.org 
[lkml]   [2012]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 6/7] ftrace, perf: Distinguish ftrace function event field type
From
Date
On Sat, 2012-01-28 at 19:43 +0100, Jiri Olsa wrote:
>
> +#define FILTER_TYPE_TRACE_FN FILTER_TRACE_FN
> +#define FILTER_TYPE_TRACE_GRAPH_ENT FILTER_OTHER
> +#define FILTER_TYPE_TRACE_GRAPH_RET FILTER_OTHER
> +#define FILTER_TYPE_TRACE_CTX FILTER_OTHER
> +#define FILTER_TYPE_TRACE_WAKE FILTER_OTHER
> +#define FILTER_TYPE_TRACE_STACK FILTER_OTHER
> +#define FILTER_TYPE_TRACE_USER_STACK FILTER_OTHER
> +#define FILTER_TYPE_TRACE_BPRINT FILTER_OTHER
> +#define FILTER_TYPE_TRACE_PRINT FILTER_OTHER
> +#define FILTER_TYPE_TRACE_MMIO_RW FILTER_OTHER
> +#define FILTER_TYPE_TRACE_MMIO_MAP FILTER_OTHER
> +#define FILTER_TYPE_TRACE_BRANCH FILTER_OTHER
> +#define FILTER_TYPE(arg) FILTER_TYPE_##arg
> +
> #undef FTRACE_ENTRY
> #define FTRACE_ENTRY(name, struct_name, id, tstruct, print) \

If all FTRACE_ENTRY needs a filter defined (as you did with the #defines
above), then we should just add a FILTER field to FTRACE_ENTRY(). The
defines are just ugly, and will be a pain if we ever add or remove a
type. If we remove a type, we'll probably forget to remove the define
for it.

#define FTRACE_ENTRY(name, struct_name, id, tstruct, print, filter)

int filter_type = filter;

And then the trace entries can have the type of filter.

F_STRUCT(
...
),

FILTER_OTHER

That would be much cleaner.

-- Steve

> int \
> @@ -123,6 +137,7 @@ ftrace_define_fields_##name(struct ftrace_event_call *event_call) \
> { \
> struct struct_name field; \
> int ret; \
> + int filter_type = FILTER_TYPE(id); \
> \
> tstruct; \
> \




\
 
 \ /
  Last update: 2012-02-03 15:19    [from the cache]
©2003-2011 Jasper Spaans