Commit 9e9a7b2c authored by Sami Kyostila's avatar Sami Kyostila Committed by Commit Bot

base/trace_event: Remove unused LINK_IDS trace point support code

Bug: 1006539
Change-Id: Ie8788b614d2ce945974d45223e2044c58d7a04dd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1988351
Auto-Submit: Sami Kyöstilä <skyostil@chromium.org>
Commit-Queue: Eric Seckler <eseckler@chromium.org>
Reviewed-by: default avatarEric Seckler <eseckler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#728511}
parent 7747cbef
...@@ -1079,7 +1079,6 @@ ...@@ -1079,7 +1079,6 @@
#define TRACE_EVENT_PHASE_CLOCK_SYNC ('c') #define TRACE_EVENT_PHASE_CLOCK_SYNC ('c')
#define TRACE_EVENT_PHASE_ENTER_CONTEXT ('(') #define TRACE_EVENT_PHASE_ENTER_CONTEXT ('(')
#define TRACE_EVENT_PHASE_LEAVE_CONTEXT (')') #define TRACE_EVENT_PHASE_LEAVE_CONTEXT (')')
#define TRACE_EVENT_PHASE_LINK_IDS ('=')
// Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT. // Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT.
#define TRACE_EVENT_FLAG_NONE (static_cast<unsigned int>(0)) #define TRACE_EVENT_FLAG_NONE (static_cast<unsigned int>(0))
......
...@@ -407,23 +407,6 @@ ...@@ -407,23 +407,6 @@
} \ } \
} while (0) } while (0)
// The linked ID will not be mangled.
#define INTERNAL_TRACE_EVENT_ADD_LINK_IDS(category_group, name, id1, id2) \
do { \
INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \
if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED()) { \
trace_event_internal::TraceID source_id((id1)); \
unsigned int source_flags = source_id.id_flags(); \
trace_event_internal::TraceID target_id((id2)); \
trace_event_internal::AddTraceEvent( \
TRACE_EVENT_PHASE_LINK_IDS, \
INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \
source_id.scope(), source_id.raw_id(), source_flags, \
trace_event_internal::kNoId, "linked_id", \
target_id.AsConvertableToTraceFormat()); \
} \
} while (0)
// Implementation detail: internal macro to create static category and add // Implementation detail: internal macro to create static category and add
// metadata event if the category is enabled. // metadata event if the category is enabled.
#define INTERNAL_TRACE_EVENT_METADATA_ADD(category_group, name, ...) \ #define INTERNAL_TRACE_EVENT_METADATA_ADD(category_group, name, ...) \
...@@ -635,9 +618,6 @@ class BASE_EXPORT TraceID { ...@@ -635,9 +618,6 @@ class BASE_EXPORT TraceID {
unsigned long long prefix() const { return prefix_; } unsigned long long prefix() const { return prefix_; }
unsigned int id_flags() const { return id_flags_; } unsigned int id_flags() const { return id_flags_; }
std::unique_ptr<base::trace_event::ConvertableToTraceFormat>
AsConvertableToTraceFormat() const;
private: private:
const char* scope_ = nullptr; const char* scope_ = nullptr;
bool has_prefix_ = false; bool has_prefix_ = false;
......
...@@ -311,42 +311,3 @@ void TraceEvent::AppendPrettyPrinted(std::ostringstream* out) const { ...@@ -311,42 +311,3 @@ void TraceEvent::AppendPrettyPrinted(std::ostringstream* out) const {
} // namespace trace_event } // namespace trace_event
} // namespace base } // namespace base
namespace trace_event_internal {
std::unique_ptr<base::trace_event::ConvertableToTraceFormat>
TraceID::AsConvertableToTraceFormat() const {
auto value = std::make_unique<base::trace_event::TracedValue>();
if (scope_ != kGlobalScope)
value->SetString("scope", scope_);
const char* id_field_name = "id";
if (id_flags_ == TRACE_EVENT_FLAG_HAS_GLOBAL_ID) {
id_field_name = "global";
value->BeginDictionary("id2");
} else if (id_flags_ == TRACE_EVENT_FLAG_HAS_LOCAL_ID) {
id_field_name = "local";
value->BeginDictionary("id2");
} else if (id_flags_ != TRACE_EVENT_FLAG_HAS_ID) {
NOTREACHED() << "Unrecognized ID flag";
}
if (has_prefix_) {
value->SetString(id_field_name,
base::StringPrintf("0x%" PRIx64 "/0x%" PRIx64,
static_cast<uint64_t>(prefix_),
static_cast<uint64_t>(raw_id_)));
} else {
value->SetString(
id_field_name,
base::StringPrintf("0x%" PRIx64, static_cast<uint64_t>(raw_id_)));
}
if (id_flags_ != TRACE_EVENT_FLAG_HAS_ID)
value->EndDictionary();
return std::move(value);
}
} // namespace trace_event_internal
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment