Trace Processor: Add RestoreInitialTables() method
Deletes all tables and views created by the user/UI
after loadinig the trace. Will be used by the UI with
the RPC+HTTP mode to reuse the same trace processor
instance.
Bug: 143074239
Change-Id: I4cefb0f8cbd7e6bec9124b0208a128d568698484
diff --git a/src/trace_processor/trace_processor_shell.cc b/src/trace_processor/trace_processor_shell.cc
index 25ffb6f..3745634 100644
--- a/src/trace_processor/trace_processor_shell.cc
+++ b/src/trace_processor/trace_processor_shell.cc
@@ -444,7 +444,8 @@
"Available commands:\n"
".quit, .q Exit the shell.\n"
".help This text.\n"
- ".dump FILE Export the trace as a sqlite database.\n");
+ ".dump FILE Export the trace as a sqlite database.\n"
+ ".reset Destroys all tables/view created by the user.\n");
}
int StartInteractiveShell(uint32_t column_width) {
@@ -467,6 +468,8 @@
} else if (strcmp(command, "dump") == 0 && strlen(arg)) {
if (ExportTraceToDatabase(arg) != 0)
PERFETTO_ELOG("Database export failed");
+ } else if (strcmp(command, "reset") == 0) {
+ g_tp->RestoreInitialTables();
} else {
PrintShellUsage();
}