summaryrefslogtreecommitdiff
path: root/services/inputflinger/InputManager.cpp
diff options
context:
space:
mode:
author Prabir Pradhan <prabirmsp@google.com> 2023-08-18 15:55:32 +0000
committer Prabir Pradhan <prabirmsp@google.com> 2023-08-22 20:33:57 +0000
commita37bad12c3b730eeb8a6dc40a0a78019f28a607e (patch)
treeb48b488571ea4e0e3b7e67e170437876b97fc01e /services/inputflinger/InputManager.cpp
parenta2235188e179bd45fe0669791c7d4ee45e6d4560 (diff)
Improve existing InputDispatcher traces
Previously, we traced using ATRACE_NAME inside an if condition after checking if atrace was enabled. This was so that we could avoid the addtional overhead of formatting the trace string when there's no ongoing trace. Since ATRACE_NAME is expected to be scoped trace of the call, doing it inside an if condition means the scope of the trace ends immediately once we leave the inner scope of the conditional. This essentially makes all of our scoped traces point traces. We get around this by adding a new helper macro ATRACE_NAME_IF that takes a lambda that formats the message. This way, we can avoid the formatting overhead and ensure the entire scope of the method is traced. Bug: 210460522 Test: manual: take a trace with Perfetto Change-Id: Ibee1e7dc5021296bdb5871dec59d8d4978fcf0c9
Diffstat (limited to 'services/inputflinger/InputManager.cpp')
0 files changed, 0 insertions, 0 deletions