• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
18
19package perfetto.protos;
20
21// Configuration for managed app heap graph snapshots.
22message JavaHprofConfig {
23  // If dump_interval_ms != 0, the following configuration is used.
24  message ContinuousDumpConfig {
25    // ms to wait before first continuous dump.
26    // A dump is always created at the beginning of the trace.
27    optional uint32 dump_phase_ms = 1;
28    // ms to wait between following dumps.
29    optional uint32 dump_interval_ms = 2;
30    // If true, scans all the processes to find `process_cmdline` and filter by
31    // `min_anonymous_memory_kb` only at data source start. Default on Android
32    // S-.
33    //
34    // If false, rescans all the processes to find on every dump. Default on
35    // Android T+.
36    optional bool scan_pids_only_on_start = 3;
37  }
38
39  // Command line allowlist, matched against the /proc/<pid>/cmdline (not the
40  // comm string). The semantics of this field were changed since its original
41  // introduction.
42  //
43  // On Android T+ (13+), this field can specify a single wildcard (*), and
44  // the profiler will attempt to match it in two possible ways:
45  // * if the pattern starts with a '/', then it is matched against the first
46  //   segment of the cmdline (i.e. argv0). For example "/bin/e*" would match
47  //   "/bin/echo".
48  // * otherwise the pattern is matched against the part of argv0
49  //   corresponding to the binary name (this is unrelated to /proc/pid/exe).
50  //   For example "echo" would match "/bin/echo".
51  //
52  // On Android S (12) and below, both this pattern and /proc/pid/cmdline get
53  // normalized prior to an exact string comparison. Normalization is as
54  // follows: (1) trim everything beyond the first null or "@" byte; (2) if
55  // the string contains forward slashes, trim everything up to and including
56  // the last one.
57  //
58  // Implementation note: in either case, at most 511 characters of cmdline
59  // are considered.
60  repeated string process_cmdline = 1;
61
62  // For watermark based triggering or local debugging.
63  repeated uint64 pid = 2;
64
65  // Only profile target if it was installed by one of the packages given.
66  // Special values are:
67  // * @system: installed on the system partition
68  // * @product: installed on the product partition
69  // * @null: sideloaded
70  // Supported on Android 12+.
71  repeated string target_installed_by = 7;
72
73  // Dump at a predefined interval.
74  optional ContinuousDumpConfig continuous_dump_config = 3;
75
76  // Do not profile processes whose anon RSS + swap < given value.
77  optional uint32 min_anonymous_memory_kb = 4;
78
79  // Include the process' /proc/self/smaps.
80  // This only shows maps that:
81  // * start with /system
82  // * start with /vendor
83  // * start with /data/app
84  // * contain "extracted in memory from Y", where Y matches any of the above
85  optional bool dump_smaps = 5;
86
87  // Exclude objects of the following types from the profile. This can be
88  // useful if lots of uninteresting objects, e.g. "sun.misc.Cleaner".
89  repeated string ignored_types = 6;
90}
91