xref: /aosp_15_r20/external/perfetto/docs/data-sources/gpu.md (revision 6dbdd20afdafa5e3ca9b8809fa73465d530080dc)
1# GPU
2
3![](/docs/images/gpu-counters.png)
4
5## GPU Frequency
6
7GPU frequency can be included in the trace by adding the ftrace category.
8
9```
10data_sources: {
11    config {
12        name: "linux.ftrace"
13        ftrace_config {
14            ftrace_events: "power/gpu_frequency"
15        }
16    }
17}
18```
19
20## GPU Counters
21
22GPU counters can be configured by adding the data source to the trace config as follows:
23
24```
25data_sources: {
26    config {
27        name: "gpu.counters"
28        gpu_counter_config {
29          counter_period_ns: 1000000
30          counter_ids: 1
31          counter_ids: 3
32          counter_ids: 106
33          counter_ids: 107
34          counter_ids: 109
35        }
36    }
37}
38```
39
40The counter_ids correspond to the ones described in `GpuCounterSpec` in the data source descriptor.
41
42See the full configuration options in [gpu\_counter\_config.proto](/protos/perfetto/config/gpu/gpu_counter_config.proto)
43
44