1637 {
1639 Zone* zone = thread->zone();
1640
1641 ProcessedSample* processed_sample = new (zone) ProcessedSample();
1642
1643
1644 processed_sample->set_timestamp(sample->timestamp());
1645 processed_sample->set_tid(sample->tid());
1646 processed_sample->set_vm_tag(sample->vm_tag());
1647 processed_sample->set_user_tag(sample->user_tag());
1648 if (sample->is_allocation_sample()) {
1649 processed_sample->set_allocation_cid(sample->allocation_cid());
1650 processed_sample->set_allocation_identity_hash(
1651 sample->allocation_identity_hash());
1652 }
1653 processed_sample->set_first_frame_executing(!sample->exit_frame_sample());
1654
1655
1656 bool truncated = false;
1657 Sample* current = sample;
1658 while (current != nullptr) {
1660 if (current->At(
i) == 0) {
1661 break;
1662 }
1663 processed_sample->Add(current->At(
i));
1664 }
1665
1666 truncated = truncated || current->truncated_trace();
1667 current =
Next(current);
1668 }
1669
1670 if (!sample->exit_frame_sample()) {
1671 processed_sample->FixupCaller(clt, 0,
1672 sample->GetStackBuffer());
1673 }
1674
1675 processed_sample->set_truncated(truncated);
1676 return processed_sample;
1677}
Sample * Next(Sample *sample)
static constexpr int kPCArraySizeInWords
static Thread * Current()