xref: /aosp_15_r20/external/cronet/base/tracing/stdlib/chrome/histograms.sql (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1-- Copyright 2023 The Chromium Authors
2-- Use of this source code is governed by a BSD-style license that can be
3-- found in the LICENSE file.
4
5DROP VIEW IF EXISTS chrome_histograms;
6
7-- A helper view on top of the histogram events emitted by Chrome.
8-- Requires "disabled-by-default-histogram_samples" Chrome category.
9CREATE PERFETTO TABLE chrome_histograms(
10  -- The name of the histogram.
11  name STRING,
12  -- The value of the histogram sample.
13  value INT,
14  -- Alias of |slice.ts|.
15  ts INT,
16  -- Thread name.
17  thread_name STRING,
18  -- Utid of the thread.
19  utid INT,
20  -- Tid of the thread.
21  tid INT,
22  -- Process name.
23  process_name STRING,
24  -- Upid of the process.
25  upid INT,
26  -- Pid of the process.
27  pid INT
28) AS
29SELECT
30  extract_arg(slice.arg_set_id, "chrome_histogram_sample.name") as name,
31  extract_arg(slice.arg_set_id, "chrome_histogram_sample.sample") as value,
32  ts,
33  thread.name as thread_name,
34  thread.utid as utid,
35  thread.tid as tid,
36  process.name as process_name,
37  process.upid as upid,
38  process.pid as pid
39FROM slice
40JOIN thread_track ON thread_track.id = slice.track_id
41JOIN thread USING (utid)
42JOIN process USING (upid)
43WHERE
44  slice.name = "HistogramSample"
45  AND category = "disabled-by-default-histogram_samples";