OSDN Git Service

Fix kernel panic when boot up
[android-x86/system-extras.git] / simpleperf / command.cpp
index 8889d7f..3416653 100644 (file)
@@ -21,7 +21,7 @@
 #include <string>
 #include <vector>
 
-#include <base/logging.h>
+#include <android-base/logging.h>
 
 bool Command::NextArgumentOrError(const std::vector<std::string>& args, size_t* pi) {
   if (*pi + 1 == args.size()) {
@@ -68,3 +68,26 @@ const std::vector<std::string> GetAllCommandNames() {
   }
   return names;
 }
+
+extern void RegisterDumpRecordCommand();
+extern void RegisterHelpCommand();
+extern void RegisterListCommand();
+extern void RegisterRecordCommand();
+extern void RegisterReportCommand();
+extern void RegisterStatCommand();
+
+class CommandRegister {
+ public:
+  CommandRegister() {
+    RegisterDumpRecordCommand();
+    RegisterHelpCommand();
+    RegisterReportCommand();
+#if defined(__linux__)
+    RegisterListCommand();
+    RegisterRecordCommand();
+    RegisterStatCommand();
+#endif
+  }
+};
+
+CommandRegister command_register;