The TRACE_LINK_IDS macro

We would like to be able to make two event IDs identical; so,
e.g. we can do something like the following:

TRACE_EVENT_ASYNC_BEGIN0("cat", "an_async_event", "0x1000");
TRACE_EVENT_LINK_IDS("cat", "a_link_event", "0x1000", "0x2000");
TRACE_EVENT_ASYNC_END("cat", "an_async_event", "0x2000");

This was done in https://codereview.chromium.org/2142023003. But,
in that patch, I misused the "bind_id" field in the
implementation of the macro to avoid introducing a new field.
That field overwriting caused some confusions because "bind_id"
was introduced for flow events.

This patch fixes the "bind_id" misusage. Also, it makes sure that
the TRACE_ID_LOCAL and TRACE_ID_GLOBAL macros that were
introduced in https://codereview.chromium.org/2253973003 work
properly when nested inside the TRACE_LINK_IDS macro.

For more context about why the TRACE_LINK_IDS was introduced in
the first place:
https://docs.google.com/document/d/1s0DKjNJk85hDuRp5IqujwZvPML-MPsyAtDeksMwBw7s

BUG=catapult:#2465

Review-Url: https://codereview.chromium.org/2381083003
Cr-Original-Commit-Position: refs/heads/master@{#425069}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ecfbdf571cc36bc1f9282032a27177d482202580
1 file changed
tree: 9a35b212bc222605573d96dd8fa608c4012315fa
  1. tools/