Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions simple_spe_sample_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ bool SimpleSpeDataSampleReader::Append(const std::string &profile_file) {
bool SimpleSpeDataSampleReader::Read() {
// Read the perf data file
quipper::PerfReader reader;
// Skip SAMPLE events to avoid unsupported PERF_SAMPLE_REGS_USER
// We only need AUXTRACE events for SPE data
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SAMPLE events aren't needed for single-process SPE profiles, but we do use them to attribute SPE samples to the right PID when collecting system-wide profiles (see https://github.com/google/autofdo/blob/master/spe_tid_pid_provider.h).

It looks like the SimpleSpeDataSampleReader only operates on single-process SPE profiles, so you still don't need SAMPLE events, but it might be worth calling out that you'd need these events if you want to add support for system-wide SPE profiles.

reader.SetEventTypesToSkipWhenSerializing(
{quipper::PERF_RECORD_SAMPLE, quipper::PERF_RECORD_FORK,
quipper::PERF_RECORD_COMM});

if (!reader.ReadFile(profile_file_)) {
LOG(ERROR) << "Failed to read perf data file: " << profile_file_;
return false;
Expand Down