#include "src/trace_processor/importers/perf/perf_session.h"
#include <cinttypes>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "perfetto/base/logging.h"
#include "perfetto/base/status.h"
#include "perfetto/ext/base/flat_hash_map.h"
#include "perfetto/ext/base/status_or.h"
#include "perfetto/ext/base/string_utils.h"
#include "perfetto/ext/base/string_view.h"
#include "perfetto/trace_processor/ref_counted.h"
#include "perfetto/trace_processor/trace_blob_view.h"
#include "src/trace_processor/importers/perf/perf_event.h"
#include "src/trace_processor/importers/perf/perf_event_attr.h"
#include "src/trace_processor/importers/perf/reader.h"
#include "src/trace_processor/storage/trace_storage.h"
#include "src/trace_processor/types/trace_processor_context.h"
#include "src/trace_processor/util/build_id.h"
namespace perfetto::trace_processor::perf_importer {
namespace {
bool OffsetsMatch(const PerfEventAttr& attr, const PerfEventAttr& other) { … }
}
base::StatusOr<RefPtr<PerfSession>> PerfSession::Builder::Build() { … }
base::StatusOr<RefPtr<PerfEventAttr>> PerfSession::FindAttrForRecord(
const perf_event_header& header,
const TraceBlobView& payload) const { … }
bool PerfSession::ReadEventId(const perf_event_header& header,
const TraceBlobView& payload,
uint64_t& id) const { … }
RefPtr<PerfEventAttr> PerfSession::FindAttrForEventId(uint64_t id) const { … }
void PerfSession::SetEventName(uint64_t event_id, std::string name) { … }
void PerfSession::SetEventName(uint32_t type,
uint64_t config,
const std::string& name) { … }
void PerfSession::AddBuildId(int32_t pid,
std::string filename,
BuildId build_id) { … }
std::optional<BuildId> PerfSession::LookupBuildId(
uint32_t pid,
const std::string& filename) const { … }
void PerfSession::SetCmdline(const std::vector<std::string>& args) { … }
}