Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(457)

Side by Side Diff: systrace/atrace_helper/jni/atrace_process_dump.h

Issue 2946033002: Android systrace: Optimize memory dumps. (Closed)
Patch Set: for review Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ATRACE_PROCESS_DUMP_H_
6 #define ATRACE_PROCESS_DUMP_H_
7
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include <unistd.h>
11
12 #include <set>
13 #include <string>
14
15 #include "process_info.h"
16
17 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.
18 public:
19 // Config is either:
20 // 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.
21 // "apps" - all Android apps launched from Zygote.
22 // "all" - all non-kernel processes.
23 void SetFullDumpConfig(const std::string& config);
24 void EnableGraphicsStats() { graphics_stats_ = true; }
25 void EnablePrintSmaps() { print_smaps_ = true; }
26 void SetDumpCount(int count) { dump_count_ = count; }
27 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.
28
29 void RunAndPrintJson(FILE* stream);
30 void Stop() { CloseTimer(); }
31
32 private:
33 void SerializeSnapshot(
34 const InstantProcessInfo* snapshot, const std::set<int>& smaps_pids);
35 void SerializeProcessInfo(
36 const PersistentProcessInfo::ProcessMap* processes);
37
38 void SetupTimer();
39 bool WaitForTimer();
40 void CloseTimer();
41
42 int dump_count_;
43 int dump_interval_ms_;
44
45 int timer_fd_;
46 FILE* out_;
47
48 int self_pid_;
49 bool graphics_stats_ = false;
50 bool print_smaps_ = false;
51 bool full_dump_all_ = false;
52 bool full_dump_apps_ = false;
53 std::set<std::string> full_dump_whitelist_;
54 };
55
56 #endif // ATRACE_PROCESS_DUMP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698