#include "src/trace_processor/db/column/string_storage.h"
#include <algorithm>
#include <cstdint>
#include <functional>
#include <iterator>
#include <memory>
#include <optional>
#include <string>
#include <unordered_set>
#include <utility>
#include <vector>
#include "perfetto/base/logging.h"
#include "perfetto/ext/base/status_or.h"
#include "perfetto/ext/base/string_view.h"
#include "perfetto/trace_processor/basic_types.h"
#include "src/trace_processor/containers/bit_vector.h"
#include "src/trace_processor/containers/null_term_string_view.h"
#include "src/trace_processor/containers/string_pool.h"
#include "src/trace_processor/db/column/data_layer.h"
#include "src/trace_processor/db/column/types.h"
#include "src/trace_processor/db/column/utils.h"
#include "src/trace_processor/tp_metatrace.h"
#include "src/trace_processor/util/glob.h"
#include "src/trace_processor/util/regex.h"
#include "protos/perfetto/trace_processor/metatrace_categories.pbzero.h"
namespace perfetto::trace_processor::column {
namespace {
struct Greater { … };
struct GreaterEqual { … };
struct Less { … };
struct LessEqual { … };
struct NotEqual { … };
struct Glob { … };
struct GlobFullStringPool { … };
struct Regex { … };
struct RegexFullStringPool { … };
struct IsNull { … };
struct IsNotNull { … };
uint32_t LowerBoundIntrinsic(StringPool* pool,
const StringPool::Id* data,
NullTermStringView val,
Range search_range) { … }
uint32_t UpperBoundIntrinsic(StringPool* pool,
const StringPool::Id* data,
NullTermStringView val,
Range search_range) { … }
}
StringStorage::StoragePtr StringStorage::GetStoragePtr() { … }
StringStorage::ChainImpl::ChainImpl(StringPool* string_pool,
const std::vector<StringPool::Id>* data,
bool is_sorted)
: … { … }
SingleSearchResult StringStorage::ChainImpl::SingleSearch(FilterOp op,
SqlValue sql_val,
uint32_t i) const { … }
SearchValidationResult StringStorage::ChainImpl::ValidateSearchConstraints(
FilterOp op,
SqlValue val) const { … }
RangeOrBitVector StringStorage::ChainImpl::SearchValidated(
FilterOp op,
SqlValue sql_val,
Range search_range) const { … }
void StringStorage::ChainImpl::IndexSearchValidated(FilterOp op,
SqlValue sql_val,
Indices& indices) const { … }
BitVector StringStorage::ChainImpl::LinearSearch(FilterOp op,
SqlValue sql_val,
Range range) const { … }
Range StringStorage::ChainImpl::BinarySearchIntrinsic(
FilterOp op,
SqlValue sql_val,
Range search_range) const { … }
void StringStorage::ChainImpl::StableSort(Token* start,
Token* end,
SortDirection direction) const { … }
void StringStorage::ChainImpl::Distinct(Indices& indices) const { … }
std::optional<Token> StringStorage::ChainImpl::MaxElement(
Indices& indices) const { … }
std::optional<Token> StringStorage::ChainImpl::MinElement(
Indices& indices) const { … }
SqlValue StringStorage::ChainImpl::Get_AvoidUsingBecauseSlow(
uint32_t index) const { … }
}