• 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_PRELUDE_FUNCTIONS_LAYOUT_FUNCTIONS_H_
16 #define SRC_TRACE_PROCESSOR_PRELUDE_FUNCTIONS_LAYOUT_FUNCTIONS_H_
17 
18 #include <sqlite3.h>
19 
20 #include "perfetto/base/status.h"
21 
22 namespace perfetto::trace_processor {
23 
24 class TraceProcessorContext;
25 
26 // Implements INTERNAL_LAYOUT(ts, dur) window aggregate function.
27 // This function takes a set of slices (ordered by ts) and computes depths
28 // allowing them to be displayed on a single track in a non-overlapping manner,
29 // while trying to minimising total height.
30 //
31 // TODO(altimin): this should support grouping sets of sets of slices (aka
32 // "tracks") by passing 'track_id' parameter. The complication is that we will
33 // need to know the max depth for each "track", so it's punted for now.
34 struct LayoutFunctions {
35   static base::Status Register(sqlite3* db, TraceProcessorContext* context);
36 };
37 
38 }  // namespace perfetto::trace_processor
39 
40 #endif  // SRC_TRACE_PROCESSOR_PRELUDE_FUNCTIONS_LAYOUT_FUNCTIONS_H_
41