lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 03 Feb 2012 09:16:41 -0500
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Jiri Olsa <jolsa@...hat.com>
Cc:	fweisbec@...il.com, mingo@...hat.com, paulus@...ba.org,
	acme@...stprotocols.net, a.p.zijlstra@...llo.nl,
	linux-kernel@...r.kernel.org, aarapov@...hat.com
Subject: Re: [PATCH 6/7] ftrace, perf: Distinguish ftrace function event
 field type

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;							\
>  									\


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ