Commit 56c8508f authored by Oystein Eftevaag's avatar Oystein Eftevaag Committed by Commit Bot

Move StackCpuSampling trace events to separate tracks

R=ssid@chromium.org

Change-Id: Ifacbffb22fdbc7aeb6abf96fe3dd85edbc075c33
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1850772Reviewed-by: default avatarssid <ssid@chromium.org>
Commit-Queue: oysteine <oysteine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705280}
parent 1ad1ee7c
...@@ -630,12 +630,14 @@ void TrackEventJSONExporter::HandleStreamingProfilePacket( ...@@ -630,12 +630,14 @@ void TrackEventJSONExporter::HandleStreamingProfilePacket(
auto event_builder = AddTraceEvent( auto event_builder = AddTraceEvent(
"StackCpuSampling", TRACE_DISABLED_BY_DEFAULT("cpu_profiler"), "StackCpuSampling", TRACE_DISABLED_BY_DEFAULT("cpu_profiler"),
TRACE_EVENT_PHASE_INSTANT, current_state_->time_us, current_state_->pid, TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT, current_state_->time_us,
current_state_->tid); current_state_->pid, current_state_->tid);
// Add a dummy thread timestamp to this event to match the format of instant // Add a dummy thread timestamp to this event to match the format of instant
// events. Useful in the UI to view args of a selected group of samples. // events. Useful in the UI to view args of a selected group of samples.
event_builder.AddThreadTimestamp(1); event_builder.AddThreadTimestamp(1);
event_builder.AddFlags(TRACE_EVENT_SCOPE_THREAD, base::nullopt, ""); static int g_id_counter = 0;
event_builder.AddFlags(TRACE_EVENT_SCOPE_THREAD | TRACE_EVENT_FLAG_HAS_ID,
++g_id_counter, "");
auto args_builder = event_builder.BuildArgs(); auto args_builder = event_builder.BuildArgs();
auto* add_arg = args_builder->MaybeAddArg("frames"); auto* add_arg = args_builder->MaybeAddArg("frames");
if (add_arg) { if (add_arg) {
......
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