#include "src/trace_processor/importers/json/json_trace_tokenizer.h"
#include <cctype>
#include <cstddef>
#include <cstdint>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include "perfetto/base/logging.h"
#include "perfetto/base/status.h"
#include "perfetto/ext/base/string_utils.h"
#include "perfetto/ext/base/string_view.h"
#include "perfetto/trace_processor/trace_blob_view.h"
#include "src/trace_processor/importers/json/json_utils.h"
#include "src/trace_processor/importers/systrace/systrace_line.h"
#include "src/trace_processor/sorter/trace_sorter.h"
#include "src/trace_processor/storage/stats.h"
#include "src/trace_processor/util/status_macros.h"
namespace perfetto::trace_processor {
namespace {
std::string FormatErrorContext(const char* s, const char* e) { … }
base::Status AppendUnescapedCharacter(char c,
bool is_escaping,
std::string* key) { … }
enum class ReadStringRes { … };
ReadStringRes ReadOneJsonString(const char* start,
const char* end,
std::string* key,
const char** next) { … }
enum class SkipValueRes { … };
SkipValueRes SkipOneJsonValue(const char* start,
const char* end,
const char** next) { … }
base::Status SetOutAndReturn(const char* ptr, const char** out) { … }
}
ReadDictRes ReadOneJsonDict(const char* start,
const char* end,
base::StringView* value,
const char** next) { … }
ReadKeyRes ReadOneJsonKey(const char* start,
const char* end,
std::string* key,
const char** next) { … }
base::Status ExtractValueForJsonKey(base::StringView dict,
const std::string& key,
std::optional<std::string>* value) { … }
ReadSystemLineRes ReadOneSystemTraceLine(const char* start,
const char* end,
std::string* line,
const char** next) { … }
JsonTraceTokenizer::JsonTraceTokenizer(TraceProcessorContext* ctx)
: … { … }
JsonTraceTokenizer::~JsonTraceTokenizer() = default;
base::Status JsonTraceTokenizer::Parse(TraceBlobView blob) { … }
base::Status JsonTraceTokenizer::ParseInternal(const char* start,
const char* end,
const char** out) { … }
base::Status JsonTraceTokenizer::HandleTraceEvent(const char* start,
const char* end,
const char** out) { … }
base::Status JsonTraceTokenizer::HandleDictionaryKey(const char* start,
const char* end,
const char** out) { … }
base::Status JsonTraceTokenizer::HandleSystemTraceEvent(const char* start,
const char* end,
const char** out) { … }
base::Status JsonTraceTokenizer::NotifyEndOfFile() { … }
}