ftrace_procfs: refactor tracefs mount search and add evt->id lookup
traced_perf will want to use tracefs to resolve group/name to an
event id. But it doesn't yet need the full proto translation table.
Including the new function as part of this patch in preparation.
Tested locally, tracing still finds the tracefs under one of the two
paths.
Change-Id: Ifc1529f1166311edfb27dc82fdcbe7d61b3f6a36
diff --git a/Android.bp b/Android.bp
index 6bca042..80c3129 100644
--- a/Android.bp
+++ b/Android.bp
@@ -526,6 +526,7 @@
":perfetto_src_traced_probes_filesystem_filesystem",
":perfetto_src_traced_probes_ftrace_format_parser_format_parser",
":perfetto_src_traced_probes_ftrace_ftrace",
+ ":perfetto_src_traced_probes_ftrace_ftrace_procfs",
":perfetto_src_traced_probes_initial_display_state_initial_display_state",
":perfetto_src_traced_probes_metatrace_metatrace",
":perfetto_src_traced_probes_packages_list_packages_list",
@@ -1076,6 +1077,7 @@
":perfetto_src_traced_probes_filesystem_filesystem",
":perfetto_src_traced_probes_ftrace_format_parser_format_parser",
":perfetto_src_traced_probes_ftrace_ftrace",
+ ":perfetto_src_traced_probes_ftrace_ftrace_procfs",
":perfetto_src_traced_probes_initial_display_state_initial_display_state",
":perfetto_src_traced_probes_metatrace_metatrace",
":perfetto_src_traced_probes_packages_list_packages_list",
@@ -1332,6 +1334,7 @@
":perfetto_src_traced_probes_filesystem_filesystem",
":perfetto_src_traced_probes_ftrace_format_parser_format_parser",
":perfetto_src_traced_probes_ftrace_ftrace",
+ ":perfetto_src_traced_probes_ftrace_ftrace_procfs",
":perfetto_src_traced_probes_initial_display_state_initial_display_state",
":perfetto_src_traced_probes_metatrace_metatrace",
":perfetto_src_traced_probes_packages_list_packages_list",
@@ -1732,6 +1735,7 @@
":perfetto_src_traced_probes_filesystem_filesystem",
":perfetto_src_traced_probes_ftrace_format_parser_format_parser",
":perfetto_src_traced_probes_ftrace_ftrace",
+ ":perfetto_src_traced_probes_ftrace_ftrace_procfs",
":perfetto_src_traced_probes_ftrace_integrationtests",
":perfetto_src_traced_probes_ftrace_test_support",
":perfetto_src_traced_probes_initial_display_state_initial_display_state",
@@ -7947,13 +7951,20 @@
"src/traced/probes/ftrace/ftrace_config_utils.cc",
"src/traced/probes/ftrace/ftrace_controller.cc",
"src/traced/probes/ftrace/ftrace_data_source.cc",
- "src/traced/probes/ftrace/ftrace_procfs.cc",
"src/traced/probes/ftrace/ftrace_stats.cc",
"src/traced/probes/ftrace/printk_formats_parser.cc",
"src/traced/probes/ftrace/proto_translation_table.cc",
],
}
+// GN: //src/traced/probes/ftrace:ftrace_procfs
+filegroup {
+ name: "perfetto_src_traced_probes_ftrace_ftrace_procfs",
+ srcs: [
+ "src/traced/probes/ftrace/ftrace_procfs.cc",
+ ],
+}
+
// GN: //src/traced/probes/ftrace:integrationtests
filegroup {
name: "perfetto_src_traced_probes_ftrace_integrationtests",
@@ -8817,6 +8828,7 @@
":perfetto_src_traced_probes_ftrace_format_parser_format_parser",
":perfetto_src_traced_probes_ftrace_format_parser_unittests",
":perfetto_src_traced_probes_ftrace_ftrace",
+ ":perfetto_src_traced_probes_ftrace_ftrace_procfs",
":perfetto_src_traced_probes_ftrace_test_messages_cpp_gen",
":perfetto_src_traced_probes_ftrace_test_messages_lite_gen",
":perfetto_src_traced_probes_ftrace_test_messages_zero_gen",