chromium/third_party/perfetto/src/trace_processor/importers/ftrace/ftrace_sched_event_tracker.cc

/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "src/trace_processor/importers/ftrace/ftrace_sched_event_tracker.h"

#include <limits>

#include "perfetto/ext/base/string_view.h"
#include "src/trace_processor/importers/common/args_tracker.h"
#include "src/trace_processor/importers/common/event_tracker.h"
#include "src/trace_processor/importers/common/process_tracker.h"
#include "src/trace_processor/importers/common/sched_event_state.h"
#include "src/trace_processor/importers/common/sched_event_tracker.h"
#include "src/trace_processor/importers/common/system_info_tracker.h"
#include "src/trace_processor/importers/common/thread_state_tracker.h"
#include "src/trace_processor/importers/ftrace/ftrace_descriptors.h"
#include "src/trace_processor/storage/stats.h"
#include "src/trace_processor/storage/trace_storage.h"
#include "src/trace_processor/types/task_state.h"
#include "src/trace_processor/types/trace_processor_context.h"
#include "src/trace_processor/types/variadic.h"

#include "protos/perfetto/trace/ftrace/ftrace_event.pbzero.h"
#include "protos/perfetto/trace/ftrace/sched.pbzero.h"

namespace perfetto {
namespace trace_processor {

FtraceSchedEventTracker::FtraceSchedEventTracker(TraceProcessorContext* context)
    :{}

FtraceSchedEventTracker::~FtraceSchedEventTracker() = default;

void FtraceSchedEventTracker::PushSchedSwitch(uint32_t cpu,
                                              int64_t ts,
                                              uint32_t prev_pid,
                                              base::StringView prev_comm,
                                              int32_t prev_prio,
                                              int64_t prev_state,
                                              uint32_t next_pid,
                                              base::StringView next_comm,
                                              int32_t next_prio) {}

void FtraceSchedEventTracker::PushSchedSwitchCompact(uint32_t cpu,
                                                     int64_t ts,
                                                     int64_t prev_state,
                                                     uint32_t next_pid,
                                                     int32_t next_prio,
                                                     StringId next_comm_id,
                                                     bool parse_only_into_raw) {}

// Processes a sched_waking that was decoded from a compact representation,
// adding to the raw and instants tables.
void FtraceSchedEventTracker::PushSchedWakingCompact(uint32_t cpu,
                                                     int64_t ts,
                                                     uint32_t wakee_pid,
                                                     uint16_t target_cpu,
                                                     uint16_t prio,
                                                     StringId comm_id,
                                                     uint16_t common_flags,
                                                     bool parse_only_into_raw) {}

void FtraceSchedEventTracker::AddRawSchedSwitchEvent(uint32_t cpu,
                                                     int64_t ts,
                                                     UniqueTid prev_utid,
                                                     uint32_t prev_pid,
                                                     StringId prev_comm_id,
                                                     int32_t prev_prio,
                                                     int64_t prev_state,
                                                     uint32_t next_pid,
                                                     StringId next_comm_id,
                                                     int32_t next_prio) {}

StringId FtraceSchedEventTracker::TaskStateToStringId(int64_t task_state_int) {}

}  // namespace trace_processor
}  // namespace perfetto