xref: /aosp_15_r20/external/perfetto/src/tracing/test/tracing_module_categories.h (revision 6dbdd20afdafa5e3ca9b8809fa73465d530080dc)
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_CATEGORIES_H_
18 #define SRC_TRACING_TEST_TRACING_MODULE_CATEGORIES_H_
19 
20 // This header defines the tracing categories (and track event data source) used
21 // in the external tracing test module. These categories are distinct from the
22 // ones defined in api_integrationtest.cc, but events for both sets of
23 // categories can be written to the same trace writer.
24 
25 #define PERFETTO_ENABLE_LEGACY_TRACE_EVENTS 1
26 
27 #include "perfetto/tracing.h"
28 
29 // Note: Using the old syntax here to ensure backwards compatibility.
30 PERFETTO_DEFINE_CATEGORIES_IN_NAMESPACE(tracing_module,
31                                         PERFETTO_CATEGORY(cat1),
32                                         PERFETTO_CATEGORY(cat2),
33                                         PERFETTO_CATEGORY(cat3),
34                                         PERFETTO_CATEGORY(cat4),
35                                         PERFETTO_CATEGORY(cat5),
36                                         PERFETTO_CATEGORY(cat6),
37                                         PERFETTO_CATEGORY(cat7),
38                                         PERFETTO_CATEGORY(cat8),
39                                         PERFETTO_CATEGORY(cat9),
40                                         PERFETTO_CATEGORY(foo));
41 
42 // Define a second set of categories in a different namespace with custom
43 // linkage attributes.
44 PERFETTO_DEFINE_CATEGORIES_IN_NAMESPACE_WITH_ATTRS(
45     tracing_extra,
46     [[maybe_unused]],
47     perfetto::Category("extra"),
48     perfetto::Category("extra2"));
49 
50 #endif  // SRC_TRACING_TEST_TRACING_MODULE_CATEGORIES_H_
51