• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (C) 2023 The Android Open Source Project
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //      http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef SRC_TRACE_PROCESSOR_PERFETTO_SQL_INTRINSICS_FUNCTIONS_LAYOUT_FUNCTIONS_H_
16 #define SRC_TRACE_PROCESSOR_PERFETTO_SQL_INTRINSICS_FUNCTIONS_LAYOUT_FUNCTIONS_H_
17 
18 #include <sqlite3.h>
19 
20 #include "perfetto/base/status.h"
21 #include "src/trace_processor/perfetto_sql/engine/perfetto_sql_engine.h"
22 
23 namespace perfetto::trace_processor {
24 
25 class TraceProcessorContext;
26 
27 // Implements INTERNAL_LAYOUT(ts, dur) window aggregate function.
28 // This function takes a set of slices (ordered by ts) and computes depths
29 // allowing them to be displayed on a single track in a non-overlapping manner,
30 // while trying to minimise the total height.
31 //
32 // TODO(altimin): this should support grouping sets of sets of slices (aka
33 // "tracks") by passing 'track_id' parameter. The complication is that we will
34 // need to know the max depth for each "track", so it's punted for now.
35 base::Status RegisterLayoutFunctions(PerfettoSqlEngine& engine);
36 
37 }  // namespace perfetto::trace_processor
38 
39 #endif  // SRC_TRACE_PROCESSOR_PERFETTO_SQL_INTRINSICS_FUNCTIONS_LAYOUT_FUNCTIONS_H_
40