#include "src/trace_processor/importers/common/thread_state_tracker.h"
#include <cstdint>
#include <optional>
#include "src/trace_processor/importers/common/cpu_tracker.h"
#include "src/trace_processor/importers/common/process_tracker.h"
namespace perfetto {
namespace trace_processor {
ThreadStateTracker::ThreadStateTracker(TraceProcessorContext* context)
: … { … }
ThreadStateTracker::~ThreadStateTracker() = default;
void ThreadStateTracker::PushSchedSwitchEvent(int64_t event_ts,
uint32_t cpu,
UniqueTid prev_utid,
StringId prev_state,
UniqueTid next_utid) { … }
void ThreadStateTracker::PushWakingEvent(int64_t event_ts,
UniqueTid utid,
UniqueTid waker_utid,
std::optional<uint16_t> common_flags) { … }
void ThreadStateTracker::PushNewTaskEvent(int64_t event_ts,
UniqueTid utid,
UniqueTid waker_utid) { … }
void ThreadStateTracker::PushBlockedReason(
UniqueTid utid,
std::optional<bool> io_wait,
std::optional<StringId> blocked_function) { … }
void ThreadStateTracker::AddOpenState(int64_t ts,
UniqueTid utid,
StringId state,
std::optional<uint16_t> cpu,
std::optional<UniqueTid> waker_utid,
std::optional<uint16_t> common_flags) { … }
uint32_t ThreadStateTracker::CommonFlagsToIrqContext(uint32_t common_flags) { … }
void ThreadStateTracker::ClosePendingState(int64_t end_ts,
UniqueTid utid,
bool data_loss) { … }
bool ThreadStateTracker::IsRunning(StringId state) { … }
bool ThreadStateTracker::IsRunnable(StringId state) { … }
bool ThreadStateTracker::IsBlocked(StringId state) { … }
}
}