Re: [Ltt-dev] [PATCH][LTTV] take account of the byte order when reading event ids

Mathieu Desnoyers <[email protected]> Wed, 5 Dec 2007 09:12:59 -0500
Newsgroups gmane.linux.kernel.tracing.viewer,gmane.linux.kernel.tracing
Message-ID <20071205141259.GA14769@Krystal>
* Jan Altenberg ([email protected]) wrote:
> Dammit - Adjusted the CC line...This time using the correct address for
> lttv-dev ;-)
> 
> > Hi all,
> > 
> > I tried to view a trace, which has been captured on a powerpc target, on
> > my x86 based host and ran into some trouble (lttv was parsing wrong
> > event IDs). I'm using lttv-0.10.0-pre4-28112007. The trace was captured
> > with 2.6.24-rc3-git1-lttng-0.10-pre3 on a MPC8548CDS.
> > 
> > Attached patch fixes things for me.
> > 
> > Cheers,
> > 	Jan
> 

Thanks, including in lttv. Will be in the next release.

> Index: lttv-0.10.0-pre4-28112007/ltt/tracefile.c
> ===================================================================
> --- lttv-0.10.0-pre4-28112007.orig/ltt/tracefile.c
> +++ lttv-0.10.0-pre4-28112007/ltt/tracefile.c
> @@ -1868,7 +1868,7 @@ int ltt_tracefile_read_update_event(LttT
>    event->event_time = ltt_interpolate_time(tf, event);
>  
>    if(!tf->compact) {
> -    event->event_id = *(guint16*)pos;
> +    event->event_id = ltt_get_uint16(LTT_GET_BO(tf), pos);
>      pos += sizeof(guint16);
>  
>      event->event_size = ltt_get_uint16(LTT_GET_BO(tf), pos);
> 
> 
> _______________________________________________
> Ltt-dev mailing list
> Ltt-dev-JX7+OpRa80TaDLZ980M/[email protected]
> http://listserv.shafik.org/mailman/listinfo/ltt-dev
> 

-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68