#include "src/trace_processor/importers/android_bugreport/android_log_reader.h"
#include <algorithm>
#include <chrono>
#include <cstdint>
#include <ctime>
#include <optional>
#include <string>
#include <utility>
#include "perfetto/base/status.h"
#include "perfetto/base/time.h"
#include "protos/perfetto/common/android_log_constants.pbzero.h"
#include "protos/perfetto/trace/clock_snapshot.pbzero.h"
#include "src/trace_processor/importers/android_bugreport/android_log_event.h"
#include "src/trace_processor/importers/common/clock_converter.h"
#include "src/trace_processor/importers/common/clock_tracker.h"
#include "src/trace_processor/sorter/trace_sorter.h"
#include "src/trace_processor/storage/stats.h"
#include "src/trace_processor/types/trace_processor_context.h"
#include "src/trace_processor/util/status_macros.h"
namespace perfetto::trace_processor {
namespace {
std::optional<int> ReadNumAndAdvance(base::StringView* it,
char sep,
int decimal_scale = 0) { … }
int32_t ToYear(std::chrono::seconds epoch) { … }
int32_t GetCurrentYear() { … }
int32_t GuessYear(TraceProcessorContext* context) { … }
}
AndroidLogReader::AndroidLogReader(TraceProcessorContext* context)
: … { … }
AndroidLogReader::AndroidLogReader(TraceProcessorContext* context, int32_t year)
: … { … }
AndroidLogReader::~AndroidLogReader() = default;
util::Status AndroidLogReader::ParseLine(base::StringView line) { … }
util::Status AndroidLogReader::ProcessEvent(std::chrono::nanoseconds event_ts,
AndroidLogEvent event) { … }
util::Status AndroidLogReader::SendToSorter(std::chrono::nanoseconds event_ts,
AndroidLogEvent event) { … }
void AndroidLogReader::EndOfStream(base::StringView) { … }
BufferingAndroidLogReader::~BufferingAndroidLogReader() = default;
base::Status BufferingAndroidLogReader::ProcessEvent(
std::chrono::nanoseconds event_ts,
AndroidLogEvent event) { … }
DedupingAndroidLogReader::DedupingAndroidLogReader(
TraceProcessorContext* context,
int32_t year,
std::vector<TimestampedAndroidLogEvent> events)
: … { … }
DedupingAndroidLogReader::~DedupingAndroidLogReader() { … }
base::Status DedupingAndroidLogReader::ProcessEvent(
std::chrono::nanoseconds event_ts,
AndroidLogEvent event) { … }
}