summaryrefslogtreecommitdiff
path: root/profcollectd
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2022-02-24 14:38:36 -0800
committerYabin Cui <yabinc@google.com>2022-02-24 14:38:36 -0800
commit21f835d742bed0f9416d50791c7454ccc65fa428 (patch)
tree3b9c406b69ef81722ad0014bb20bc4414365b3f4 /profcollectd
parent17dc1b865b24d536c1bbfe94680e3fb04087e4aa (diff)
downloadextras-21f835d742bed0f9416d50791c7454ccc65fa428.tar.gz
profcollectd: add doc for testing custom configurations.
Bug: none Test: none Change-Id: I2a8ea114d44b5fe9dc122a7360d5655eaa4cf832
Diffstat (limited to 'profcollectd')
-rw-r--r--profcollectd/README.md56
1 files changed, 56 insertions, 0 deletions
diff --git a/profcollectd/README.md b/profcollectd/README.md
index dba75a2c..e9066000 100644
--- a/profcollectd/README.md
+++ b/profcollectd/README.md
@@ -37,6 +37,62 @@ are controlled by the following configurations:
Setting the frequency value to `0` disables collection for the corresponding event.
+#### Custom configuration
+
+In adb root:
+
+```
+# Record every 60s (By default, record every 10m). The actual interval will be longer than the
+# set value if the device goes to hibernation.
+oriole:/ # setprop persist.device_config.profcollect_native_boot.collection_interval 60
+
+# Each time recording, record ETM data for 1s (By default, it's 0.5s).
+oriole:/ # setprop persist.device_config.profcollect_native_boot.sampling_period 1000
+
+# Set ETM data storage limit to 50G (By default, it is 512M).
+oriole:/ # setprop persist.device_config.profcollect_native_boot.max_trace_limit 53687091200
+
+# Enable ETM data collection (By default, it's decided by the server).
+oriole:/ # setprop persist.device_config.profcollect_native_boot.enabled true
+
+# After adjusting configuration, need to restart profcollectd
+oriole:/ # setprop ctl.stop profcollectd
+# Wait for a few seconds.
+oriole:/ # setprop ctl.start profcollectd
+
+# Check if profcollectd is running
+oriole:/ # ps -e | grep profcollectd
+root 918 1 10945660 47040 binder_wait_for_work 0 S profcollectd
+
+# Check if the new configuration takes effect.
+oriole:/ # cat /data/misc/profcollectd/output/config.json
+{"version":1,"node_id":[189,15,145,225,97,167],"build_fingerprint":"google/oriole/oriole:Tiramisu/TP1A.220223.002/8211650:userdebug/dev-keys","collection_interval":{"secs":60,"nanos":0},"sampling_period":{"secs":1,"nanos":0},"binary_filter":"^/(system|apex/.+)/(bin|lib|lib64)/.+","max_trace_limit":53687091200}
+```
+
+To check existing collected ETM data:
+```
+oriole:/ # cd data/misc/profcollectd/trace/
+oriole:/data/misc/profcollectd/trace # ls
+```
+
+To check if ETM data can be collected successfully:
+```
+# Trigger one collection manually.
+oriole:/ # profcollectctl once
+Trace once
+
+# Check trace directory to see if there is a recent manual trace file.
+oriole:/ # ls /data/misc/profcollectd/trace/
+20220224-222946_manual.etmtrace
+```
+
+If there are too many trace files, we need to processing them to avoid reaching storage limit.
+It may take a long time.
+```
+oriole:/ # profcollectctl process
+Processing traces
+```
+
### Processing
The raw tracing data needs to be combined with the original binary to create the AutoFDO branch