mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Javi Merino <javi.merino@arm.com>
Cc: acme@redhat.com, jolsa@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 2/2] tools lib traceevent: Add support for __print_array()
Date: Fri, 6 Mar 2015 14:19:31 -0500	[thread overview]
Message-ID: <20150306141931.71f482b4@gandalf.local.home> (raw)
In-Reply-To: <1425666918-11870-3-git-send-email-javi.merino@arm.com>

On Fri,  6 Mar 2015 18:35:18 +0000
Javi Merino <javi.merino@arm.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@redhat.com>
> Cc: Jiri Olsa <jolsa@redhat.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>

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

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


> Acked-by: Namhyung Kim <namhyung@kernel.org>
> Signed-off-by: Javi Merino <javi.merino@arm.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;

      reply	other threads:[~2015-03-06 19:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-06 18:35 [PATCH v8 0/2] Add array printing support to libtraceevent Javi Merino
2015-03-06 18:35 ` [PATCH v8 1/2] tools lib traceevent: factor out allocating and processing args Javi Merino
2015-03-06 18:35 ` [PATCH v8 2/2] tools lib traceevent: Add support for __print_array() Javi Merino
2015-03-06 19:19   ` Steven Rostedt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150306141931.71f482b4@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=acme@redhat.com \
    --cc=javi.merino@arm.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®