Re: [PATCH 2/5] Save trace into CTF format

Joel Brobecker
2013-03-15T23:44:57Z

> 2013-03-03 Hui Zhu <hui_zhu@mentor.com>
> Yao Qi <yao@codesourcery.com>
>
> * Makefile.in (REMOTE_OBS): Add ctf.o.
> (SFILES): Add ctf.c.
> (HFILES_NO_SRCDIR): Add ctf.h.
> * ctf.c, ctf.h: New files.
> * tracepoint.c : Include 'ctf.h'.
> (collect_pseudocommand): Remove static.
> (trace_save_command): Parse option "-ctf".
> Produce different trace file writers per option.
> Adjust output message.
> (trace_save_tfile, trace_save_ctf): New.
> * tracepoint.h (trace_save_tfile, trace_save_ctf): Declare.
> * mi/mi-main.c: Include 'ctf.h'.
> (mi_cmd_trace_save): Handle option '-ctf'. Call either
> trace_save_tfile or trace_save_ctf.
[...]
> + ctf_save_fwrite_format (handler->metadata_fd, metadata_fmt,
> + CTF_SAVE_MAJOR, CTF_SAVE_MINOR,
> + BYTE_ORDER == LITTLE_ENDIAN ? "le" : "be");

This is causing a build failure on ppc-aix, for instance, due to:

/[...]ctf.c:223:28: error: 'BYTE_ORDER' undeclared (first use in this function)
/[...]ctf.c:223:28: note: each undeclared identifier is reported only once for each function it appears in
/[...]ctf.c:223:42: error: 'LITTLE_ENDIAN' undeclared (first use in this function)

I don't know how to fix this, because I am not sure whether host
or target endianness were meant. I asssume from the code that it
was host, but not sure how the host endianess would make sense...

What also worries me is that I don't seem to see approval for commit
for this patch. I know both of you are very careful, so perhaps in
a separate message not linked to this sub-thread?

--
Joel