atrace: Remove funcgraphFlatPath option
atrace -k <kernel function(s)> depended on an out of tree patch
that added funcgraph-flat option to flatten the function graph
output. This patch is no longer maintained since android 4.14,
and causes tracing kernel functions with atrace to fail with:
error opening /sys/kernel/tracing/options/funcgraph-flat
Fix by removing this option from atrace, which allows using atrace
with the function graph hierarchical output.
Bug: 185858163
Test: atrack -k do_mmap
capturing trace... done
TRACE:
1052.716680 | 7) atrace-9238 | | /* trace_event_clock_sync: parent_ts=1052.716675 */
1052.716687 | 7) atrace-9238 | | /* trace_event_clock_sync: realtime_ts=1619031487907 */
1052.717302 | 4) lmkd_un-9237 | 5.534 us | do_mmap();
1052.718858 | 4) lmkd_un-9237 | 2.767 us | do_mmap();
1052.720411 | 4) lmkd_un-9237 | 2.726 us | do_mmap();
1052.721997 | 4) lmkd_un-9237 | 2.970 us | do_mmap();
1052.723580 | 4) lmkd_un-9237 | 3.011 us | do_mmap();
1052.725172 | 4) lmkd_un-9237 | 3.255 us | do_mmap();
. . .
Change-Id: I5ba1571da188c2b1abe693fa76ffc3877331aaf6
diff --git a/cmds/atrace/atrace.cpp b/cmds/atrace/atrace.cpp
index 88a5872..6f5f70d 100644
--- a/cmds/atrace/atrace.cpp
+++ b/cmds/atrace/atrace.cpp
@@ -320,9 +320,6 @@
static const char* k_funcgraphProcPath =
"options/funcgraph-proc";
-static const char* k_funcgraphFlatPath =
- "options/funcgraph-flat";
-
static const char* k_ftraceFilterPath =
"set_ftrace_filter";
@@ -700,7 +697,6 @@
ok &= setKernelOptionEnable(k_funcgraphAbsTimePath, true);
ok &= setKernelOptionEnable(k_funcgraphCpuPath, true);
ok &= setKernelOptionEnable(k_funcgraphProcPath, true);
- ok &= setKernelOptionEnable(k_funcgraphFlatPath, true);
// Set the requested filter functions.
ok &= truncateFile(k_ftraceFilterPath);