Index: systrace/atrace_helper/jni/atrace_process_dump.h |
diff --git a/systrace/atrace_helper/jni/atrace_process_dump.h b/systrace/atrace_helper/jni/atrace_process_dump.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4aaac76ee17a7933af1d7ce7ffcdfb8716d80b52 |
--- /dev/null |
+++ b/systrace/atrace_helper/jni/atrace_process_dump.h |
@@ -0,0 +1,56 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef ATRACE_PROCESS_DUMP_H_ |
+#define ATRACE_PROCESS_DUMP_H_ |
+ |
+#include <stdio.h> |
+#include <stdlib.h> |
+#include <unistd.h> |
+ |
+#include <set> |
+#include <string> |
+ |
+#include "process_info.h" |
+ |
+class AtraceProcessDump { |
Primiano Tucci (use gerrit)
2017/06/22 07:55:51
some lines of comment explaining what this class d
kraynov
2017/06/22 09:19:44
Done.
|
+ public: |
+ // Config is either: |
+ // comma-separated list - only processes with named in the list. |
Primiano Tucci (use gerrit)
2017/06/22 07:55:51
i'd just say here: comma-separate list of process
kraynov
2017/06/22 09:19:44
Done.
|
+ // "apps" - all Android apps launched from Zygote. |
+ // "all" - all non-kernel processes. |
+ void SetFullDumpConfig(const std::string& config); |
+ void EnableGraphicsStats() { graphics_stats_ = true; } |
+ void EnablePrintSmaps() { print_smaps_ = true; } |
+ void SetDumpCount(int count) { dump_count_ = count; } |
+ void SetDumpFrequency(int interval_ms) { dump_interval_ms_ = interval_ms; } |
Primiano Tucci (use gerrit)
2017/06/22 07:55:51
You call the setter Frequency but the argument is
kraynov
2017/06/22 09:19:44
Done.
|
+ |
+ void RunAndPrintJson(FILE* stream); |
+ void Stop() { CloseTimer(); } |
+ |
+ private: |
+ void SerializeSnapshot( |
+ const InstantProcessInfo* snapshot, const std::set<int>& smaps_pids); |
+ void SerializeProcessInfo( |
+ const PersistentProcessInfo::ProcessMap* processes); |
+ |
+ void SetupTimer(); |
+ bool WaitForTimer(); |
+ void CloseTimer(); |
+ |
+ int dump_count_; |
+ int dump_interval_ms_; |
+ |
+ int timer_fd_; |
+ FILE* out_; |
+ |
+ int self_pid_; |
+ bool graphics_stats_ = false; |
+ bool print_smaps_ = false; |
+ bool full_dump_all_ = false; |
+ bool full_dump_apps_ = false; |
+ std::set<std::string> full_dump_whitelist_; |
+}; |
+ |
+#endif // ATRACE_PROCESS_DUMP_H_ |