1 /* 2 * Copyright (C) 2019 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 #ifndef SRC_TRACING_TEST_TRACING_MODULE_H_ 18 #define SRC_TRACING_TEST_TRACING_MODULE_H_ 19 20 // Note: No non-client API header includes are allowed here. 21 22 namespace perfetto { 23 class TrackEventSessionObserver; 24 namespace internal { 25 struct TrackEventIncrementalState; 26 } // namespace internal 27 } // namespace perfetto 28 29 namespace tracing_module { 30 31 void InitializeCategories(); 32 void AddSessionObserver(perfetto::TrackEventSessionObserver* observer); 33 void RemoveSessionObserver(perfetto::TrackEventSessionObserver* observer); 34 bool IsEnabled(); 35 void EmitTrackEvents(); 36 void EmitTrackEvents2(); 37 void EmitTrackEventsFromAllNamespaces(); 38 perfetto::internal::TrackEventIncrementalState* GetIncrementalState(); 39 40 // These functions are used to check the instruction size overhead track events. 41 void FunctionWithOneTrackEvent(); 42 void FunctionWithOneTrackEventWithTypedArgument(); 43 void FunctionWithOneScopedTrackEvent(); 44 void FunctionWithOneTrackEventWithDebugAnnotations(); 45 void FunctionWithOneTrackEventWithCustomTrack(); 46 void FunctionWithOneCounterEvent(); 47 48 // Legacy events. 49 void FunctionWithOneLegacyEvent(); 50 void FunctionWithOneScopedLegacyEvent(); 51 52 } // namespace tracing_module 53 54 void TestDeprecatedNamespacing(); 55 56 #endif // SRC_TRACING_TEST_TRACING_MODULE_H_ 57