Skip to content

Commit 439f041

Browse files
committed
Fix
1 parent 2d9f776 commit 439f041

File tree

4 files changed

+28
-39
lines changed

4 files changed

+28
-39
lines changed

src/trace_processor/core/plugin/plugin.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,16 @@ std::unique_ptr<Destructible> PluginBase::CreateStorage(
5454
}
5555
void PluginBase::RegisterImporters(TraceProcessorContext*, Destructible*) {}
5656
void PluginBase::RegisterDataframes(TraceProcessorContext*,
57-
Destructible*,
58-
std::vector<PluginDataframe>&) {}
57+
Destructible*,
58+
std::vector<PluginDataframe>&) {}
5959
void PluginBase::RegisterStaticTableFunctions(
6060
TraceProcessorContext*,
6161
Destructible*,
6262
std::vector<std::unique_ptr<StaticTableFunction>>&) {}
63-
void PluginBase::RegisterSqliteModules(
64-
TraceProcessorContext*,
65-
Destructible*,
66-
std::vector<SqliteModuleRegistration>&) {}
63+
void PluginBase::RegisterSqliteModules(TraceProcessorContext*,
64+
Destructible*,
65+
std::vector<SqliteModuleRegistration>&) {
66+
}
6767
std::string PluginBase::GetAfterEofSql() {
6868
return {};
6969
}

src/trace_processor/core/plugin/plugin.h

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,8 @@ SqliteModuleRegistration MakeSqliteModule(std::string name,
6666
reg.name = std::move(name);
6767
reg.module = &Module::kModule;
6868
reg.context = ctx;
69-
reg.is_state_manager =
70-
std::is_base_of_v<sqlite::ModuleStateManagerBase,
71-
typename Module::Context>;
69+
reg.is_state_manager = std::is_base_of_v<sqlite::ModuleStateManagerBase,
70+
typename Module::Context>;
7271
return reg;
7372
}
7473

@@ -84,9 +83,8 @@ SqliteModuleRegistration MakeSqliteModule(
8483
reg.destructor = [](void* p) {
8584
delete static_cast<typename Module::Context*>(p);
8685
};
87-
reg.is_state_manager =
88-
std::is_base_of_v<sqlite::ModuleStateManagerBase,
89-
typename Module::Context>;
86+
reg.is_state_manager = std::is_base_of_v<sqlite::ModuleStateManagerBase,
87+
typename Module::Context>;
9088
return reg;
9189
}
9290

@@ -145,18 +143,15 @@ class PluginBase {
145143
// 1. Compile-time: forces #include of dep headers -> forces GN dep
146144
// 2. Link-time: if dep's .cc isn't compiled, GN dep missing -> build fails
147145
// 3. Runtime: topological sort verifies all deps are registered
148-
template <typename Self,
149-
typename Storage = void,
150-
typename... Deps>
146+
template <typename Self, typename Storage = void, typename... Deps>
151147
class Plugin : public PluginBase {
152148
public:
153149
static constexpr const void* kPluginId = PluginTag<Self>::Id();
154150
static constexpr std::array<const void*, sizeof...(Deps)> kDepIds = {
155151
PluginTag<Deps>::Id()...};
156152

157153
// Override these in the concrete plugin class.
158-
virtual std::unique_ptr<Storage> CreatePluginStorage(
159-
TraceProcessorContext*) {
154+
virtual std::unique_ptr<Storage> CreatePluginStorage(TraceProcessorContext*) {
160155
return nullptr;
161156
}
162157
virtual void RegisterImporters(TraceProcessorContext*, Storage*) {}
@@ -167,26 +162,23 @@ class Plugin : public PluginBase {
167162
TraceProcessorContext*,
168163
Storage*,
169164
std::vector<std::unique_ptr<StaticTableFunction>>&) {}
170-
virtual void RegisterSqliteModules(
171-
TraceProcessorContext*,
172-
Storage*,
173-
std::vector<SqliteModuleRegistration>&) {}
165+
virtual void RegisterSqliteModules(TraceProcessorContext*,
166+
Storage*,
167+
std::vector<SqliteModuleRegistration>&) {}
174168

175169
private:
176170
std::unique_ptr<Destructible> CreateStorage(
177171
TraceProcessorContext* ctx) final {
178172
return static_cast<Self*>(this)->CreatePluginStorage(ctx);
179173
}
180-
void RegisterImporters(TraceProcessorContext* ctx,
181-
Destructible* s) final {
182-
static_cast<Self*>(this)->RegisterImporters(
183-
ctx, static_cast<Storage*>(s));
174+
void RegisterImporters(TraceProcessorContext* ctx, Destructible* s) final {
175+
static_cast<Self*>(this)->RegisterImporters(ctx, static_cast<Storage*>(s));
184176
}
185177
void RegisterDataframes(TraceProcessorContext* ctx,
186178
Destructible* s,
187179
std::vector<PluginDataframe>& tables) final {
188-
static_cast<Self*>(this)->RegisterDataframes(
189-
ctx, static_cast<Storage*>(s), tables);
180+
static_cast<Self*>(this)->RegisterDataframes(ctx, static_cast<Storage*>(s),
181+
tables);
190182
}
191183
void RegisterStaticTableFunctions(
192184
TraceProcessorContext* ctx,
@@ -218,9 +210,8 @@ class Plugin<Self, void, Deps...> : public PluginBase {
218210
virtual void RegisterStaticTableFunctions(
219211
TraceProcessorContext*,
220212
std::vector<std::unique_ptr<StaticTableFunction>>&) {}
221-
virtual void RegisterSqliteModules(
222-
TraceProcessorContext*,
223-
std::vector<SqliteModuleRegistration>&) {}
213+
virtual void RegisterSqliteModules(TraceProcessorContext*,
214+
std::vector<SqliteModuleRegistration>&) {}
224215

225216
private:
226217
void RegisterImporters(TraceProcessorContext* ctx, Destructible*) final {

src/trace_processor/perfetto_sql/engine/perfetto_sql_engine.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,11 @@ class PerfettoSqlEngine {
145145
}
146146

147147
// Registers a virtual table module from a plugin's SqliteModuleRegistration.
148-
void RegisterSqliteModuleForPlugin(
149-
const char* name,
150-
const sqlite3_module* module,
151-
void* ctx,
152-
void (*destructor)(void*),
153-
bool is_state_manager) {
148+
void RegisterSqliteModuleForPlugin(const char* name,
149+
const sqlite3_module* module,
150+
void* ctx,
151+
void (*destructor)(void*),
152+
bool is_state_manager) {
154153
if (is_state_manager) {
155154
virtual_module_state_managers_.push_back(
156155
static_cast<sqlite::ModuleStateManagerBase*>(ctx));

src/trace_processor/trace_processor_impl.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,8 @@ class TraceProcessorImpl : public TraceProcessor,
173173
const Config& config,
174174
PerfettoSqlEngine* engine);
175175

176-
static void IncludeAfterEofPrelude(
177-
PerfettoSqlEngine*,
178-
const std::vector<PluginEntry>& plugins);
176+
static void IncludeAfterEofPrelude(PerfettoSqlEngine*,
177+
const std::vector<PluginEntry>& plugins);
179178

180179
const Config config_;
181180

0 commit comments

Comments
 (0)