xref: /aosp_15_r20/external/perfetto/examples/sdk/trace_categories.h (revision 6dbdd20afdafa5e3ca9b8809fa73465d530080dc)
1 /*
2  * Copyright (C) 2020 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 TRACE_CATEGORIES_H
18 #define TRACE_CATEGORIES_H
19 
20 // This source file can be built in two ways:
21 // 1. As part of the regular GN build, against standard includes.
22 // 2. To test that the amalgmated SDK works, against the perfetto.h source.
23 #ifdef PERFETTO_SDK_EXAMPLE_USE_INTERNAL_HEADERS
24 #include "perfetto/tracing/core/trace_config.h"
25 #include "perfetto/tracing/tracing.h"
26 #include "perfetto/tracing/track_event.h"
27 #include "protos/perfetto/trace/track_event/process_descriptor.gen.h"
28 #else
29 #include <perfetto.h>
30 #endif
31 
32 // The set of track event categories that the example is using.
33 PERFETTO_DEFINE_CATEGORIES(
34     perfetto::Category("rendering")
35         .SetDescription("Rendering and graphics events"),
36     perfetto::Category("network.debug")
37         .SetTags("debug")
38         .SetDescription("Verbose network events"),
39     perfetto::Category("audio.latency")
40         .SetTags("verbose")
41         .SetDescription("Detailed audio latency metrics"));
42 
43 #endif  // TRACE_CATEGORIES_H
44