mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Kapileshwar Singh <kapileshwar.singh@arm.com>
Cc: linux-kernel@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Javi Merino <javi.merino@arm.com>,
	David Ahern <dsahern@gmail.com>, Jiri Olsa <jolsa@kernel.org>
Subject: Re: [PATCH v5] tools lib traceevent: str addresses in heterogeneous arch environments
Date: Tue, 22 Sep 2015 09:46:18 -0400	[thread overview]
Message-ID: <20150922094618.2e730aa8@gandalf.local.home> (raw)
In-Reply-To: <1442928123-13824-1-git-send-email-kapileshwar.singh@arm.com>

On Tue, 22 Sep 2015 14:22:03 +0100
Kapileshwar Singh <kapileshwar.singh@arm.com> wrote:

>  		if (!(field->flags & FIELD_IS_ARRAY) &&
>  		    field->size == pevent->long_size) {
> -			addr = *(unsigned long *)(data + field->offset);
> +
> +			/* Handle heterogeneous recording and processing
> +			 * architectures
> +			 *
> +			 * CASE I:
> +			 * Traces recorded on 32-bit devices (32-bit
> +			 * addressing) and processed on 64-bit devices:
> +			 * In this case, only 32 bits should be read.
> +			 *
> +			 * CASE II:
> +			 * Traces recorded on 64 bit devices and processed
> +			 * on 32-bit devices:
> +			 * In this case, 64 bits must be read.

Probably should have added a comment about not caring about endianess
and why, but that can be added later. This patch is good enough for now.

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

Arnaldo, want to pick this up?

-- Steve

> +			 */
> +			addr = (pevent->long_size == 8) ?
> +				*(unsigned long long *)(data + field->offset) :
> +				(unsigned long long)*(unsigned int *)(data + field->offset);
> +
>  			/* Check if it matches a print format */
>  			printk = find_printk(pevent, addr);
>  			if (printk)
>  				trace_seq_puts(s, printk->printk);
>  			else
> -				trace_seq_printf(s, "%lx", addr);
> +				trace_seq_printf(s, "%llx", addr);
>  			break;
>  		}
>  		str = malloc(len + 1);


  reply	other threads:[~2015-09-22 13:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-22 13:22 Kapileshwar Singh
2015-09-22 13:46 ` Steven Rostedt [this message]
2015-09-22 14:04   ` Arnaldo Carvalho de Melo
2015-09-22 14:19     ` Steven Rostedt
2015-09-22 14:37       ` Arnaldo Carvalho de Melo
2015-09-22 14:39         ` Kapileshwar Singh
2015-09-22 15:21         ` Steven Rostedt
2015-09-23  8:45 ` [tip:perf/core] tools lib traceevent: Fix string handling " tip-bot for Kapileshwar Singh

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=20150922094618.2e730aa8@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=acme@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=javi.merino@arm.com \
    --cc=jolsa@kernel.org \
    --cc=kapileshwar.singh@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@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®