| Index: components/metrics/call_stack_profile_metrics_provider.cc
|
| diff --git a/components/metrics/call_stack_profile_metrics_provider.cc b/components/metrics/call_stack_profile_metrics_provider.cc
|
| index 3dc55b9ea6d00f0a571cd4bcbb528867f03f6a9f..d704a0645b466bf342ce4026cc735e867b991dfd 100644
|
| --- a/components/metrics/call_stack_profile_metrics_provider.cc
|
| +++ b/components/metrics/call_stack_profile_metrics_provider.cc
|
| @@ -220,7 +220,7 @@ void CopySampleToProto(
|
| const StackSamplingProfiler::Sample& sample,
|
| const std::vector<StackSamplingProfiler::Module>& modules,
|
| CallStackProfile::Sample* proto_sample) {
|
| - for (const StackSamplingProfiler::Frame& frame : sample) {
|
| + for (const StackSamplingProfiler::Frame& frame : sample.frames) {
|
| CallStackProfile::Entry* entry = proto_sample->add_entry();
|
| // A frame may not have a valid module. If so, we can't compute the
|
| // instruction pointer offset, and we don't want to send bare pointers, so
|
| @@ -247,11 +247,21 @@ void CopyProfileToProto(
|
| if (ordering_spec == CallStackProfileParams::PRESERVE_ORDER) {
|
| // Collapse only consecutive repeated samples together.
|
| CallStackProfile::Sample* current_sample_proto = nullptr;
|
| + int32_t phases = 0;
|
| + int32_t activities = 0;
|
| for (auto it = profile.samples.begin(); it != profile.samples.end(); ++it) {
|
| if (!current_sample_proto || *it != *(it - 1)) {
|
| current_sample_proto = proto_profile->add_sample();
|
| CopySampleToProto(*it, profile.modules, current_sample_proto);
|
| current_sample_proto->set_count(1);
|
| + if (it->process_phases != phases) {
|
| + phases = it->process_phases;
|
| + current_sample_proto->set_process_phases(phases);
|
| + }
|
| + if (it->current_activities != activities) {
|
| + activities = it->current_activities;
|
| + current_sample_proto->set_current_activities(activities);
|
| + }
|
| } else {
|
| current_sample_proto->set_count(current_sample_proto->count() + 1);
|
| }
|
|
|