* ctf.c (ctf_save_metadata_header): Define macro HOST_ENDIANNESS
	and write it to CTF metadata.
This commit is contained in:
Yao Qi
2013-03-20 02:54:22 +00:00
parent 75c8d84d74
commit 8249a5a9e2
2 changed files with 14 additions and 1 deletions

View File

@ -218,9 +218,17 @@ ctf_save_metadata_header (struct trace_write_handler *handler)
" := uint64_t;\n");
ctf_save_write_metadata (handler, "\n");
/* Get the byte order of the host and write CTF data in this byte
order. */
#if WORDS_BIGENDIAN
#define HOST_ENDIANNESS "be"
#else
#define HOST_ENDIANNESS "le"
#endif
ctf_save_write_metadata (handler, metadata_fmt,
CTF_SAVE_MAJOR, CTF_SAVE_MINOR,
BYTE_ORDER == LITTLE_ENDIAN ? "le" : "be");
HOST_ENDIANNESS);
ctf_save_write_metadata (handler, "\n");
}