From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933626AbbIVNqX (ORCPT ); Tue, 22 Sep 2015 09:46:23 -0400 Received: from smtprelay0154.hostedemail.com ([216.40.44.154]:33026 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933337AbbIVNqV (ORCPT ); Tue, 22 Sep 2015 09:46:21 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:3138:3139:3140:3141:3142:3353:3622:3867:3868:3870:3871:3872:3874:5007:6119:6120:6261:7875:7901:7974:8603:10004:10400:10848:10967:11026:11232:11473:11658:11914:12517:12519:12740:13069:13138:13231:13255:13311:13357:14096:14097:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: sky92_5464432320361 X-Filterd-Recvd-Size: 2453 Date: Tue, 22 Sep 2015 09:46:18 -0400 From: Steven Rostedt To: Kapileshwar Singh Cc: linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Namhyung Kim , Javi Merino , David Ahern , Jiri Olsa Subject: Re: [PATCH v5] tools lib traceevent: str addresses in heterogeneous arch environments Message-ID: <20150922094618.2e730aa8@gandalf.local.home> In-Reply-To: <1442928123-13824-1-git-send-email-kapileshwar.singh@arm.com> References: <1442928123-13824-1-git-send-email-kapileshwar.singh@arm.com> X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.28; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 22 Sep 2015 14:22:03 +0100 Kapileshwar Singh 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 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);