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]
Message-ID: <20160219143013.57c81933@gandalf.local.home>
Date:	Fri, 19 Feb 2016 14:30:13 -0500
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Tom Zanussi <tom.zanussi@...ux.intel.com>
Cc:	masami.hiramatsu.pt@...achi.com, namhyung@...nel.org,
	josh@...htriplett.org, andi@...stfloor.org,
	mathieu.desnoyers@...icios.com, peterz@...radead.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v13 06/29] tracing: Add needs_rec flag to event triggers

On Thu, 10 Dec 2015 12:50:48 -0600
Tom Zanussi <tom.zanussi@...ux.intel.com> wrote:

> Add a new needs_rec flag for triggers that require unconditional
> access to trace records in order to function.
> 
> Normally a trigger requires access to the contents of a trace record
> only if it has a filter associated with it (since filters need the
> contents of a record in order to make a filtering decision).  Some
> types of triggers, such as 'hist' triggers, require access to trace
> record contents independent of the presence of filters, so add a new
> flag for those triggers.
> 
> Signed-off-by: Tom Zanussi <tom.zanussi@...ux.intel.com>
> Tested-by: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
> Reviewed-by: Namhyung Kim <namhyung@...nel.org>
> ---
>  kernel/trace/trace.h                | 7 +++++++
>  kernel/trace/trace_events_trigger.c | 3 ++-
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
> index 5e23a97..300add5 100644
> --- a/kernel/trace/trace.h
> +++ b/kernel/trace/trace.h
> @@ -1293,6 +1293,12 @@ struct event_trigger_ops {
>   *	itself logs to the trace buffer, this flag should be set,
>   *	otherwise it can be left unspecified.
>   *
> + * @needs_rec: A flag that says whether or not this command needs
> + *	access to the trace record in order to perform its function,
> + *	regardless of whether or not it has a filter associated with
> + *	it (filters make a trigger require access to the trace record
> + *	but are not always present).
> + *
>   * All the methods below, except for @set_filter(), must be
>   * implemented.
>   *
> @@ -1333,6 +1339,7 @@ struct event_command {
>  	char			*name;
>  	enum event_trigger_type	trigger_type;
>  	bool			post_trigger;
> +	bool			needs_rec;

Note, from what I understand, gcc sucks with bool in structures. Best
thing to do here is to create a "int flags" field, and check the result
with masks.

You don't need to update this patch (I'm still working on the series),
but a patch on top of these may be necessary. I could add the patch too.

-- Steve


>  	int			(*func)(struct event_command *cmd_ops,
>  					struct trace_event_file *file,
>  					char *glob, char *cmd, char *params);
> diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c
> index 8375d29..2f881e9 100644
> --- a/kernel/trace/trace_events_trigger.c
> +++ b/kernel/trace/trace_events_trigger.c
> @@ -498,7 +498,8 @@ void update_cond_flag(struct trace_event_file *file)
>  	bool set_cond = false;
>  
>  	list_for_each_entry_rcu(data, &file->triggers, list) {
> -		if (data->filter || data->cmd_ops->post_trigger) {
> +		if (data->filter || data->cmd_ops->post_trigger ||
> +		    data->cmd_ops->needs_rec) {
>  			set_cond = true;
>  			break;
>  		}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ