Support record-tgid
Bug: 110757800
Test: builds
Change-Id: Id3235995a6bcf3678413fdf97ca4b89a5f0c340c
diff --git a/cmds/atrace/atrace.cpp b/cmds/atrace/atrace.cpp
index bce8b45..507a893 100644
--- a/cmds/atrace/atrace.cpp
+++ b/cmds/atrace/atrace.cpp
@@ -258,6 +258,9 @@
static const char* k_printTgidPath =
"options/print-tgid";
+static const char* k_recordTgidPath =
+ "options/record-tgid";
+
static const char* k_funcgraphAbsTimePath =
"options/funcgraph-abstime";
@@ -523,6 +526,9 @@
if (fileExists(k_printTgidPath)) {
return setKernelOptionEnable(k_printTgidPath, enable);
}
+ if (fileExists(k_recordTgidPath)) {
+ return setKernelOptionEnable(k_recordTgidPath, enable);
+ }
return true;
}
diff --git a/cmds/atrace/atrace.rc b/cmds/atrace/atrace.rc
index e978322..44cc410 100644
--- a/cmds/atrace/atrace.rc
+++ b/cmds/atrace/atrace.rc
@@ -19,6 +19,8 @@
chmod 0666 /sys/kernel/tracing/options/overwrite
chmod 0666 /sys/kernel/debug/tracing/options/print-tgid
chmod 0666 /sys/kernel/tracing/options/print-tgid
+ chmod 0666 /sys/kernel/debug/tracing/options/record-tgid
+ chmod 0666 /sys/kernel/tracing/options/record-tgid
chmod 0666 /sys/kernel/debug/tracing/saved_cmdlines_size
chmod 0666 /sys/kernel/tracing/saved_cmdlines_size
chmod 0666 /sys/kernel/debug/tracing/events/sched/sched_switch/enable