diff options
| author | 2023-08-24 14:02:13 +0000 | |
|---|---|---|
| committer | 2023-08-24 14:02:13 +0000 | |
| commit | cde5086ba5d624f98c3227d7528a9ae38f6b5874 (patch) | |
| tree | b5047c634cca1b2e7c67479ac52ace2156462492 /include/input/TraceTools.h | |
| parent | e3ce97eab1b86e366e1d55cdfd6221221b35cf77 (diff) | |
| parent | 6d1cb0125e748eb90510e5f50c315fa1fa2132a9 (diff) | |
Merge changes I65538cd3,I4da2cff3,Ibee1e7dc into main
* changes:
Remove tracing for InputDispatcher::enqueueDispatchEntryLocked
Trace all InputListener stages
Improve existing InputDispatcher traces
Diffstat (limited to 'include/input/TraceTools.h')
| -rw-r--r-- | include/input/TraceTools.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/input/TraceTools.h b/include/input/TraceTools.h new file mode 100644 index 0000000000..70b23c5875 --- /dev/null +++ b/include/input/TraceTools.h @@ -0,0 +1,25 @@ +/* + * Copyright 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include <utils/Trace.h> +#include <optional> + +#define ATRACE_NAME_IF(condition, messageProvider) \ + const auto _trace_token = condition \ + ? std::make_optional<android::ScopedTrace>(ATRACE_TAG, messageProvider().c_str()) \ + : std::nullopt |