Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f40e3819 authored by Joe Onorato's avatar Joe Onorato Committed by Android (Google) Code Review
Browse files

Merge "Introduce a new wrapper for log_msg -- LogEvent"

parents 20224639 c4dfae56
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ statsd_common_src := \
    src/config/ConfigManager.cpp \
    src/external/KernelWakelockPuller.cpp \
    src/external/StatsPullerManager.cpp \
    src/logd/LogEvent.cpp \
    src/logd/LogListener.cpp \
    src/logd/LogReader.cpp \
    src/matchers/CombinationLogMatchingTracker.cpp \
+3 −1
Original line number Diff line number Diff line
@@ -41,10 +41,12 @@ StatsLogProcessor::~StatsLogProcessor() {
}

// TODO: what if statsd service restarts? How do we know what logs are already processed before?
void StatsLogProcessor::OnLogEvent(const log_msg& msg) {
void StatsLogProcessor::OnLogEvent(const LogEvent& msg) {
    // TODO: Use EventMetric to filter the events we want to log.
    /* TODO: Convert this when we have the generic protobuf writing library in.
    EventMetricData eventMetricData = parse(msg);
    m_dropbox_writer.addEventMetricData(eventMetricData);
    */

    // pass the event to metrics managers.
    for (auto& pair : mMetricsManagers) {
+1 −2
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@

#include "frameworks/base/cmds/statsd/src/statsd_config.pb.h"

#include <log/logprint.h>
#include <stdio.h>
#include <unordered_map>

@@ -37,7 +36,7 @@ public:
    StatsLogProcessor(const sp<UidMap> &uidMap);
    virtual ~StatsLogProcessor();

    virtual void OnLogEvent(const log_msg& msg);
    virtual void OnLogEvent(const LogEvent& event);

    void OnConfigUpdated(const ConfigKey& key, const StatsdConfig& config);
    void OnConfigRemoved(const ConfigKey& key);
+2 −2
Original line number Diff line number Diff line
@@ -436,8 +436,8 @@ void StatsService::Startup() {
    mConfigManager->Startup();
}

void StatsService::OnLogEvent(const log_msg& msg) {
    mProcessor->OnLogEvent(msg);
void StatsService::OnLogEvent(const LogEvent& event) {
    mProcessor->OnLogEvent(event);
}

}  // namespace statsd
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ public:
    /**
     * Called by LogReader when there's a log event to process.
     */
    virtual void OnLogEvent(const log_msg& msg);
    virtual void OnLogEvent(const LogEvent& event);

    // TODO: public for testing since statsd doesn't run when system starts. Change to private
    // later.
Loading