• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1--
2-- Copyright 2022 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--     https://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-- Creates a table view with a list of class names with a specific key
17-- from the "args" table per |package_name| & |version_code|.
18-- |package_name| and |version_code| can be NULL.
19
20DROP VIEW IF EXISTS chrome_args_class_names_per_version;
21CREATE VIEW chrome_args_class_names_per_version AS
22WITH class_info AS (
23  SELECT
24    package_list.package_name AS package_name,
25    package_list.version_code AS version_code,
26    RepeatedField(args.string_value) AS class_names
27  FROM args
28  JOIN slice
29    ON args.arg_set_id = slice.arg_set_id
30      AND args.flat_key = 'android_view_dump.activity.view.class_name'
31  JOIN thread_track
32    ON slice.track_id = thread_track.id
33  JOIN thread
34    ON thread_track.utid = thread.utid
35  JOIN process
36    ON thread.upid = process.upid
37  LEFT JOIN package_list
38    ON process.uid = package_list.uid
39  GROUP BY package_name, version_code
40)
41SELECT
42  ChromeArgsClassNames_ChromeArgsClassNamesPerVersion(
43    'package_name', package_name,
44    'version_code', version_code,
45    'class_name', class_names
46  ) AS class_names_per_version
47FROM class_info;
48
49DROP VIEW IF EXISTS chrome_args_class_names_output;
50CREATE VIEW chrome_args_class_names_output
51AS
52SELECT
53  ChromeArgsClassNames(
54    'class_names_per_version', RepeatedField(class_names_per_version)
55  )
56FROM chrome_args_class_names_per_version;
57