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
17DROP VIEW IF EXISTS start_procs;
18
19CREATE VIEW IF NOT EXISTS start_procs AS
20WITH
21  start_procs_raw AS (
22      SELECT * from tracing_mark_write_split WHERE atrace_message LIKE 'Start proc: %'
23  ),
24  start_procs_substr AS (
25      -- note: "12" is len("Start proc: ")+1. sqlite indices start at 1.
26      SELECT raw_ftrace_entry_id, atrace_pid, SUBSTR(atrace_message, 13) AS process_name FROM start_procs_raw
27  )
28SELECT * from start_procs_substr;
29
30SELECT * from start_procs;
31