#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/descendant.h"
#include <algorithm>
#include <cinttypes>
#include <cstdint>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "perfetto/base/logging.h"
#include "perfetto/base/status.h"
#include "perfetto/ext/base/status_or.h"
#include "perfetto/trace_processor/basic_types.h"
#include "src/trace_processor/db/column/types.h"
#include "src/trace_processor/db/column_storage.h"
#include "src/trace_processor/db/table.h"
#include "src/trace_processor/db/typed_column.h"
#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/tables_py.h"
#include "src/trace_processor/storage/trace_storage.h"
#include "src/trace_processor/tables/slice_tables_py.h"
#include "src/trace_processor/types/trace_processor_context.h"
#include "src/trace_processor/util/status_macros.h"
namespace perfetto::trace_processor {
namespace tables {
DescendantSliceTable::~DescendantSliceTable() = default;
DescendantSliceByStackTable::~DescendantSliceByStackTable() = default;
}
namespace {
template <typename ChildTable, typename ParentTable, typename ConstraintType>
std::unique_ptr<Table> ExtendWithStartId(
ConstraintType constraint_id,
const ParentTable& table,
std::vector<typename ParentTable::RowNumber> parent_rows) { … }
base::Status GetDescendants(
const tables::SliceTable& slices,
SliceId starting_id,
std::vector<tables::SliceTable::RowNumber>& row_numbers_accumulator) { … }
}
Descendant::Descendant(Type type, const TraceStorage* storage)
: … { … }
base::StatusOr<std::unique_ptr<Table>> Descendant::ComputeTable(
const std::vector<SqlValue>& arguments) { … }
Table::Schema Descendant::CreateSchema() { … }
std::string Descendant::TableName() { … }
uint32_t Descendant::EstimateRowCount() { … }
std::optional<std::vector<tables::SliceTable::RowNumber>>
Descendant::GetDescendantSlices(const tables::SliceTable& slices,
SliceId slice_id) { … }
}