1 /* 2 * Copyright (C) 2023 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #pragma once 18 19 #include <sys/cdefs.h> 20 21 // A library to enable tracing for benchmarks. 22 // It only causes ftrace events to be emitted so that we can measure 23 // performance and is not intended to enable tracing for meaningful results. 24 25 __BEGIN_DECLS 26 27 // Disable tracing for ATRACE_TAG_APP events. 28 // Terminates the app on error and writes an error message to logd and stderr. 29 void disable_app_atrace(); 30 31 // Enable ATRACE_TAG_APP events only for the specified app pattern. 32 // ATrace uses fnmatch for the pattern. 33 // Terminates the app on error and writes an error message to logd and stderr. 34 void enable_atrace_for_single_app(const char* name); 35 36 __END_DECLS