blob: 539eaac14293f31953ea7a3abb6ab560923e8722 [file] [log] [blame]
Primiano Tucci463af6f2018-09-09 15:10:42 +01001/*
Lalit Maganti8320e6d2019-03-14 18:49:33 +00002 * Copyright (C) 2019 The Android Open Source Project
Primiano Tucci463af6f2018-09-09 15:10:42 +01003 *
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
Lalit Maganti8320e6d2019-03-14 18:49:33 +000017#ifndef SRC_TRACE_PROCESSOR_COUNTER_DEFINITIONS_TABLE_H_
18#define SRC_TRACE_PROCESSOR_COUNTER_DEFINITIONS_TABLE_H_
Primiano Tucci463af6f2018-09-09 15:10:42 +010019
Ioannis Ilkos9c03cbd2019-03-12 18:30:43 +000020#include "src/trace_processor/storage_table.h"
Eric Seckler972225e2019-04-18 11:07:12 +010021#include "src/trace_processor/trace_storage.h"
Primiano Tucci463af6f2018-09-09 15:10:42 +010022
23namespace perfetto {
24namespace trace_processor {
25
Lalit Maganti8320e6d2019-03-14 18:49:33 +000026class CounterDefinitionsTable : public StorageTable {
Primiano Tucci463af6f2018-09-09 15:10:42 +010027 public:
Primiano Tucci463af6f2018-09-09 15:10:42 +010028 static void RegisterTable(sqlite3* db, const TraceStorage* storage);
29
Lalit Maganti8320e6d2019-03-14 18:49:33 +000030 CounterDefinitionsTable(sqlite3*, const TraceStorage*);
Primiano Tucci463af6f2018-09-09 15:10:42 +010031
Lalit Magantibea54162019-01-08 11:08:03 +000032 // StorageTable implementation.
33 StorageSchema CreateStorageSchema() override;
Lalit Maganti9e566402019-01-08 11:17:04 +000034 uint32_t RowCount() override;
Primiano Tucci463af6f2018-09-09 15:10:42 +010035 int BestIndex(const QueryConstraints&, BestIndexInfo*) override;
36
Ioannis Ilkos5d0edd12019-02-04 15:39:52 +000037 private:
Lalit Maganti8320e6d2019-03-14 18:49:33 +000038 uint32_t EstimateCost(const QueryConstraints&);
39
Primiano Tucci463af6f2018-09-09 15:10:42 +010040 const TraceStorage* const storage_;
41};
Eric Seckler972225e2019-04-18 11:07:12 +010042
Primiano Tucci463af6f2018-09-09 15:10:42 +010043} // namespace trace_processor
44} // namespace perfetto
45
Lalit Maganti8320e6d2019-03-14 18:49:33 +000046#endif // SRC_TRACE_PROCESSOR_COUNTER_DEFINITIONS_TABLE_H_