Use custom ids instead of thread_id to record threads in trace events
We only use 16-bits to identify a thread in the trace events. Thread ids
can be more than 16-bits and we just truncated it to 16-bits. This could
mean we might see a thread if of 0 which is used as a special value to
differentiate between method trace entries and method / thread
information entries.
This is especially a problem on host where thread ids usually don't fit
in 16-bits. On target, it is a less of a problem but there is no hard
limit on 64-bit devices that the thread ids should fit in 16-bits.
This lookup is only done each time we are flushing the thread local
buffer to the file. Hence the impact on performance isn't expected to be
much.
Bug: 279547877
Test: art/test.py -t 2246
Change-Id: I11d6b9a69db468960dc288b230aa322c51d87421
2 files changed