1syntax = "proto2"; 2 3package uprobestats.protos; 4 5message UprobestatsConfig { 6 7 // A Task consists of one or more probes that target the same process and are 8 // activated and deactivated together. 9 message Task { 10 11 // A ProbeConfig defines the spec of a single probe, including which BPF to 12 // use and where to place the probe. 13 message ProbeConfig { 14 15 // Name of the BPF program and function. E.g. 16 // prog_BitmapAllocation_uprobe_bitmap_constructor_heap. Note that this 17 // does not include the full BPF program path. 18 optional string bpf_name = 1; 19 20 // Path to an executable or a library. E.g. 21 // /system/framework/arm64/boot-framework.oat. This is made a repeated 22 // paths to allow backup paths to be provided. Sometimes a library may be 23 // re-compiled by ART and stored in a different location. uprobestats 24 // would try to place the probe on each of the paths in the order 25 // specified here until the probe is successfully placed. 26 // Superseded by `fully_qualified_class_name`, `method_name`, and `fully_qualified_parameters`. 27 repeated string file_paths = 2; 28 29 // Full method signature. E.g. 30 // void android.content.pm.PackageManagerInternal.finishPackageInstall(int, boolean) 31 // Superseded by `fully_qualified_class_name`, `method_name`, and `fully_qualified_parameters`. 32 optional string method_signature = 3; 33 34 // Fully qualified class name of the method being targeted. E.g. 35 // "android.content.pm.PackageManagerInternal" 36 // Supersedes `file_paths` and `method_signature` 37 optional string fully_qualified_class_name = 4; 38 // Method name of the method being targeted. E.g. "finishPackageInstall" 39 // Supersedes `file_paths` and `method_signature` 40 optional string method_name = 5; 41 // Fully qualified parameters list of the method being targeted. E.g. ["int", "boolean"] 42 // Supersedes `file_paths` and `method_signature` 43 repeated string fully_qualified_parameters = 6; 44 } 45 46 repeated ProbeConfig probe_configs = 1; 47 48 // Name of the FDs that the BPF programs write to. E.g. 49 // map_BitmapAllocation_output_buf. Note that this does not include the full file path. 50 repeated string bpf_maps = 2; 51 52 // Name of the process to be probed, e.g. system_server. 53 optional string target_process_name = 3; 54 55 // How long the probes should remain active. 56 optional int32 duration_seconds = 4; 57 58 message StatsdLoggingConfig { 59 optional int64 atom_id = 1; 60 // The positions of any arguments to the method call that should be sent to the atom. 61 // These arguments MUST be primitive types (e.g. bool, int), NOT complex objects 62 // (that will be nothing but pointers). The positions should be ordered in the same 63 // order as the corresponding fields of the atom to be populated. 64 // 65 // For example, given the method: 66 // `void startThing(int argA, int argB, int argC)` 67 // and the atom: 68 // ``` 69 // proto StartAppInvocations { 70 // optional int logged_arg_b = 1; 71 // optional int logged_arg_a = 2; 72 // } 73 // ``` 74 // The config value should be [1, 0], meaning the 2nd argument is actually the 75 // first field in the atom, and vice versa. 76 repeated int32 primitive_argument_positions = 2; 77 } 78 optional StatsdLoggingConfig statsd_logging_config = 5; 79 80 } 81 82 repeated Task tasks = 1; 83} 84