| Andreas Gampe | 9590c64 | 2017-12-27 10:57:34 -0800 | [diff] [blame] | 1 | |
| 2 | syntax = "proto2"; |
| 3 | |
| 4 | option java_package = "android.perfprofd"; |
| 5 | |
| Andreas Gampe | 9590c64 | 2017-12-27 10:57:34 -0800 | [diff] [blame] | 6 | package android.perfprofd; |
| 7 | |
| 8 | // The configuration for a profiling session. |
| 9 | message ProfilingConfig { |
| 10 | // Average number of seconds between perf profile collections (if |
| 11 | // set to 100, then over time we want to see a perf profile |
| 12 | // collected every 100 seconds). The actual time within the interval |
| 13 | // for the collection is chosen randomly. |
| 14 | optional uint32 collection_interval_in_s = 1; |
| 15 | |
| 16 | // Use the specified fixed seed for random number generation (unit |
| 17 | // testing) |
| 18 | optional uint32 use_fixed_seed = 2; |
| 19 | |
| 20 | // Number of times to iterate through main |
| 21 | // loop. Value of zero indicates that we should loop forever. |
| 22 | optional uint32 main_loop_iterations = 3; |
| 23 | |
| Andreas Gampe | 35dc175 | 2018-05-11 12:40:59 -0700 | [diff] [blame] | 24 | // Destination directory (where to write profiles). |
| Andreas Gampe | 9590c64 | 2017-12-27 10:57:34 -0800 | [diff] [blame] | 25 | optional string destination_directory = 4; |
| 26 | // Config directory (where to read configs). |
| 27 | optional string config_directory = 5; |
| 28 | // Full path to 'perf' executable. |
| 29 | optional string perf_path = 6; |
| 30 | |
| 31 | // Desired sampling period (passed to perf -c option). Small |
| 32 | // sampling periods can perturb the collected profiles, so enforce |
| Andreas Gampe | e4b2ed9 | 2018-04-04 21:06:26 -0700 | [diff] [blame] | 33 | // min/max. A value of 0 means perf default. sampling_frequency |
| 34 | // takes priority. |
| Andreas Gampe | 9590c64 | 2017-12-27 10:57:34 -0800 | [diff] [blame] | 35 | optional uint32 sampling_period = 7; |
| Andreas Gampe | e4b2ed9 | 2018-04-04 21:06:26 -0700 | [diff] [blame] | 36 | // Desired sampling frequency (passed to perf -f option). A value of 0 |
| 37 | // means using sampling_period or default. |
| 38 | optional uint32 sampling_frequency = 22; |
| Andreas Gampe | 9590c64 | 2017-12-27 10:57:34 -0800 | [diff] [blame] | 39 | // Length of time to collect samples (number of seconds for 'perf |
| 40 | // record -a' run). |
| 41 | optional uint32 sample_duration_in_s = 8; |
| 42 | |
| 43 | // If this parameter is non-zero it will cause perfprofd to |
| 44 | // exit immediately if the build type is not userdebug or eng. |
| 45 | // Currently defaults to 1 (true). |
| 46 | optional bool only_debug_build = 9; |
| 47 | |
| 48 | // If the "mpdecision" service is running at the point we are ready |
| 49 | // to kick off a profiling run, then temporarily disable the service |
| 50 | // and hard-wire all cores on prior to the collection run, provided |
| 51 | // that the duration of the recording is less than or equal to the value of |
| 52 | // 'hardwire_cpus_max_duration'. |
| 53 | optional bool hardwire_cpus = 10; |
| 54 | optional uint32 hardwire_cpus_max_duration_in_s = 11; |
| 55 | |
| 56 | // Maximum number of unprocessed profiles we can accumulate in the |
| 57 | // destination directory. Once we reach this limit, we continue |
| 58 | // to collect, but we just overwrite the most recent profile. |
| 59 | optional uint32 max_unprocessed_profiles = 12; |
| 60 | |
| 61 | // If set to 1, pass the -g option when invoking 'perf' (requests |
| 62 | // stack traces as opposed to flat profile). |
| 63 | optional bool stack_profile = 13; |
| 64 | |
| 65 | // Control collection of various additional profile tags |
| 66 | optional bool collect_cpu_utilization = 14; |
| 67 | optional bool collect_charging_state = 15; |
| 68 | optional bool collect_booting = 16; |
| 69 | optional bool collect_camera_active = 17; |
| Andreas Gampe | 9217681 | 2017-12-27 19:20:45 -0800 | [diff] [blame] | 70 | |
| 71 | // The pid of the process to profile. May be negative, in which case |
| 72 | // the whole system will be profiled. |
| 73 | optional int32 process = 18; |
| Andreas Gampe | 9543854 | 2018-01-09 16:18:35 -0800 | [diff] [blame] | 74 | |
| 75 | // Whether to use a symbolizer on-device. |
| 76 | optional bool use_elf_symbolizer = 19; |
| Andreas Gampe | 83476be | 2017-12-28 12:02:12 -0800 | [diff] [blame] | 77 | |
| 78 | // Whether to send the result to dropbox. |
| 79 | optional bool send_to_dropbox = 20; |
| Andreas Gampe | 28a379f | 2018-03-28 15:51:33 -0700 | [diff] [blame] | 80 | |
| 81 | // If true, use libz to compress the output proto. |
| 82 | optional bool compress = 21; |
| Andreas Gampe | 9590c64 | 2017-12-27 10:57:34 -0800 | [diff] [blame] | 83 | }; |