ABSTRACTION OF ENDIANESS IN A TRACE COLLECTION
Original Publication Date: 2000-Mar-01
Included in the Prior Art Database: 2003-Jun-18
With the advent of Operating systems that have been ported to multiple hardware platforms with different processors, performance traces can be gathered from platforms with different Endianess. (Big, Little, depending on which byte order the numeric data types are stored by the processor to memory or IO). It is possible to write to the trace file with a certain pre-defined endianess, to solve this problem, but this imposes additional overhead in writing the trace data, which is not desirable for a performance trace. A better solution is to let the processor write the trace data with its inherent endianess, and put an endianess identification field in the trace header, and handle the endianess issue during the post-processing. This also simplifies the encoding of the trace instrumentation. This also provides a standard mechanism to post-process traces on machines with different Endianess. To solve this problem, a known value, say "0x0C0A0F0E" in hex, is written as a 32 bit int, by the processor into the trace header. The byte order of this value in the trace file is used to figure out the Endianess of the processor writing it. (If the byte at the lower address is "0x0C" hex, then the processor is BigEndian.