atrace: map 'sync' to linux >= 4.9 fence tracing
Before Linux 4.9, sync was an Android staging driver. In Linux 4.9,
this was upstreamed to be part of the dma-buf framework. Many of the
details changed, including the uapi and tracing events.
Atrace now handles enabling both old and new event systems. But the
events traced differ, so any downstream software that has special-case
handling of sync/fence events will need to be updated.
Bug: 79696988
Test: adb shell atrace --list_categories
Change-Id: Idb4e4efa848f04bf77080414578c3fb7c8805782
diff --git a/cmds/atrace/atrace.cpp b/cmds/atrace/atrace.cpp
index 70164ea..9060937 100644
--- a/cmds/atrace/atrace.cpp
+++ b/cmds/atrace/atrace.cpp
@@ -186,7 +186,10 @@
{ REQ, "events/cpufreq_interactive/enable" },
} },
{ "sync", "Synchronization", 0, {
- { REQ, "events/sync/enable" },
+ // before linux kernel 4.9
+ { OPT, "events/sync/enable" },
+ // starting in linux kernel 4.9
+ { OPT, "events/fence/enable" },
} },
{ "workq", "Kernel Workqueues", 0, {
{ REQ, "events/workqueue/enable" },