#include "src/trace_processor/perfetto_sql/intrinsics/functions/to_ftrace.h"
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <functional>
#include <optional>
#include <vector>
#include "perfetto/base/logging.h"
#include "perfetto/base/status.h"
#include "perfetto/ext/base/string_view.h"
#include "perfetto/ext/base/string_writer.h"
#include "perfetto/public/compiler.h"
#include "perfetto/trace_processor/basic_types.h"
#include "src/trace_processor/containers/null_term_string_view.h"
#include "src/trace_processor/db/column/types.h"
#include "src/trace_processor/importers/common/system_info_tracker.h"
#include "src/trace_processor/importers/ftrace/ftrace_descriptors.h"
#include "src/trace_processor/sqlite/bindings/sqlite_type.h"
#include "src/trace_processor/sqlite/bindings/sqlite_value.h"
#include "src/trace_processor/storage/trace_storage.h"
#include "src/trace_processor/tables/metadata_tables_py.h"
#include "src/trace_processor/types/gfp_flags.h"
#include "src/trace_processor/types/softirq_action.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/binder.pbzero.h"
#include "protos/perfetto/trace/ftrace/cgroup.pbzero.h"
#include "protos/perfetto/trace/ftrace/clk.pbzero.h"
#include "protos/perfetto/trace/ftrace/dpu.pbzero.h"
#include "protos/perfetto/trace/ftrace/filemap.pbzero.h"
#include "protos/perfetto/trace/ftrace/ftrace.pbzero.h"
#include "protos/perfetto/trace/ftrace/ftrace_event.pbzero.h"
#include "protos/perfetto/trace/ftrace/g2d.pbzero.h"
#include "protos/perfetto/trace/ftrace/irq.pbzero.h"
#include "protos/perfetto/trace/ftrace/mdss.pbzero.h"
#include "protos/perfetto/trace/ftrace/panel.pbzero.h"
#include "protos/perfetto/trace/ftrace/power.pbzero.h"
#include "protos/perfetto/trace/ftrace/samsung.pbzero.h"
#include "protos/perfetto/trace/ftrace/sched.pbzero.h"
#include "protos/perfetto/trace/ftrace/workqueue.pbzero.h"
#include "src/trace_processor/types/version_number.h"
namespace perfetto::trace_processor {
namespace {
struct FtraceTime { … };
Query GetArgQuery(const tables::ArgTable& table, uint32_t arg_set_id) { … }
class ArgsSerializer { … };
ArgsSerializer::ArgsSerializer(
TraceProcessorContext* context,
ArgSetId arg_set_id,
NullTermStringView event_name,
std::vector<std::optional<uint32_t>>* field_id_to_arg_index,
base::StringWriter* writer)
: … { … }
void ArgsSerializer::SerializeArgs() { … }
void ArgsSerializer::WriteArg(base::StringView key,
Variadic value,
const ValueWriter& writer) { … }
void ArgsSerializer::WriteValue(const Variadic& value) { … }
}
base::Status ToFtrace::Run(Context* context,
size_t argc,
sqlite3_value** argv,
SqlValue& out,
Destructors& destructors) { … }
SystraceSerializer::SystraceSerializer(TraceProcessorContext* context)
: … { … }
SystraceSerializer::ScopedCString SystraceSerializer::SerializeToString(
uint32_t raw_row) { … }
void SystraceSerializer::SerializePrefix(uint32_t raw_row,
base::StringWriter* writer) { … }
}