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] [day] [month] [year] [list]
Message-ID: <20150306141931.71f482b4@gandalf.local.home>
Date:	Fri, 6 Mar 2015 14:19:31 -0500
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Javi Merino <javi.merino@....com>
Cc:	acme@...hat.com, jolsa@...hat.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v8 2/2] tools lib traceevent: Add support for
 __print_array()

On Fri,  6 Mar 2015 18:35:18 +0000
Javi Merino <javi.merino@....com> wrote:

> Since 6ea22486ba46 ("tracing: Add array printing helper") trace can
> traces with variable element size arrays.  Add support to parse them.
> 
> Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
> Cc: Jiri Olsa <jolsa@...hat.com>
> Cc: Steven Rostedt <rostedt@...dmis.org>

Both patches look fine to me. You can add my:

Acked-by: Steven Rostedt <rostedt@...dmis.org>


> Acked-by: Namhyung Kim <namhyung@...nel.org>
> Signed-off-by: Javi Merino <javi.merino@....com>
> ---
>  tools/lib/traceevent/event-parse.c | 93 ++++++++++++++++++++++++++++++++++++++
>  tools/lib/traceevent/event-parse.h |  8 ++++
>  2 files changed, 101 insertions(+)
> 


> +		if (arg->int_array.field->type == PRINT_DYNAMIC_ARRAY) {
> +			unsigned long offset;
> +			struct format_field *field =
> +				arg->int_array.field->dynarray.field;
> +			offset = pevent_read_number(pevent,
> +						    data + field->offset,
> +						    field->size);
> +			num = data + (offset & 0xffff);

Unrelated to this patch set, but we really should make that 0xffff a
named define. Something like this perhaps?

#define DYNAMIC_OFFSET_MASK 0xffff
#define DYNAMIC_LENGTH_SHIFT 16

and even add:

#define dynamic_offset(num) ((num) & DYNAMIC_OFFSET_MASK)
#define dynamic_length(num) ((num) >> DYNAMIC_LENGTH_SHIFT)

and use these macros instead.

Again, this has nothing to do with the acceptance of this patch set.
Just something that this patch set reminds me that we should do.

-- Steve

> +		} else {
> +			field = arg->int_array.field->field.field;
> +			if (!field) {
> +				str = arg->int_array.field->field.name;
> +				field = pevent_find_any_field(event, str);
> +				if (!field)
> +					goto out_warning_field;
> +				arg->int_array.field->field.field = field;
> +			}
> +			num = data + field->offset;
--
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