tp: introduce PerfettoSqlEngine intermediary
This CL introduces PerfettoSqlEngine as an intermediary engine before
SqliteEngine and consolidates anything which belongs there into the
class (e.g. registering SqlFunction instances, SqliteTable etc).
Bug: 261195778
Change-Id: I6b4dbd27e5b80fb4a41cd536c49b3d4b5ce89706
diff --git a/src/trace_processor/prelude/functions/create_function.h b/src/trace_processor/prelude/functions/create_function.h
index 0dd6f4c..ed8c06c 100644
--- a/src/trace_processor/prelude/functions/create_function.h
+++ b/src/trace_processor/prelude/functions/create_function.h
@@ -27,16 +27,13 @@
namespace perfetto {
namespace trace_processor {
+class PerfettoSqlEngine;
+
// Implementation of CREATE_FUNCTION SQL function.
// See https://perfetto.dev/docs/analysis/metrics#metric-helper-functions for
// usage of this function.
struct CreateFunction : public SqlFunction {
- struct PerFunctionState {
- ScopedStmt stmt;
- // void* to avoid leaking state.
- void* created_functon_context;
- };
- using Context = SqliteEngine;
+ using Context = PerfettoSqlEngine;
static constexpr bool kVoidReturn = true;