xref: /aosp_15_r20/external/perfetto/docs/analysis/pivot-tables.md (revision 6dbdd20afdafa5e3ca9b8809fa73465d530080dc)
1# Pivot Tables
2
3Pivot Tables are a way to summarize and aggregate information about selected
4slices in a configurable way. It is available in canary and autopush channels by
5default, and can be enabled in stable by toggling a corresponding flag
6(Support > Flags > Pivot tables V2).
7
8To create a pivot table, you need to select a timeline area that contains
9slices. The table will then show an aggregation of the selected slices.
10
11## Conceptual model
12
13Pivot tables have two types of columns: pivots and aggregations. Conceptually,
14the UI requests all the data from columns of both types and then computes
15aggregate values for aggregation columns for every distinct tuple of pivot
16column values.
17
18Pivots are hierarchical, and the aggregate values are also computed for all the
19prefixes of pivot column values. For example, if you select process name,
20category, and event name (in that order) as pivots and have duration sum as the
21only aggregation columns, the following aggregate values will be computed:
22
23*   Total duration for each process
24*   Total duration for each process and category
25*   Total duration for each process, category, and event name
26
27The table rows are appropriately nested in the UI, from more general to more
28specific. Portions of the table can be collapsed and expanded.
29
30## Working with pivot table
31
32Pivot tables can be configured using dropdown menus in the table header cells.
33These can be used to:
34
35*   Add and remove pivots
36*   Add and remove aggregations
37*   Change aggregation functions
38*   Sort by aggregation columns
39