On 26/06/2019 06:20, Ravindra Kumar Meena wrote:
     > +  ctf_item.event = __builtin_bswap32( item->event );

    Why is there this byte swap?


It will set its value in big-endian.

What it does here depends on the native endian setting.

Since this value will be passed as big-endian. I have defined the typealias for the same in the metadata.

typealias integer { size = 64; align = 8; signed = false; byte_order=be; } := uint64_t_be;

The trace description in our metadata is

trace {
     major = 1;
     minor = 8;
     byte_order = le;
};

This defines that babeltrace has to read in little-endian byte order. Hence, giving out correct value.

So basically we are passing big-endian value so that babeltrace can read it in little-endian.

The target application simulated on Qemu is little endian and your x86_64 host is little endian. There is absolutely no big endian stuff involved here naturally. Your superfluous byte swap causes all the trouble. Why you added it is a complete miracle to me.

Please remove the byte swap and change

typedef enum events_e : uint64_t_be {

to

typedef enum events_e : uint32_t {

--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to