diff options
Diffstat (limited to 'cmds/statsd/src/logd/LogEvent.h')
-rw-r--r-- | cmds/statsd/src/logd/LogEvent.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/cmds/statsd/src/logd/LogEvent.h b/cmds/statsd/src/logd/LogEvent.h index 24d624d9d9be..3d5b2abc7e3a 100644 --- a/cmds/statsd/src/logd/LogEvent.h +++ b/cmds/statsd/src/logd/LogEvent.h @@ -18,6 +18,8 @@ #include "FieldValue.h" +#include <android/frameworks/stats/1.0/types.h> +#include <android/os/StatsLogEventWrapper.h> #include <android/util/ProtoOutputStream.h> #include <log/log_event_list.h> #include <log/log_read.h> @@ -27,6 +29,8 @@ #include <string> #include <vector> +using namespace android::frameworks::stats::V1_0; + namespace android { namespace os { namespace statsd { @@ -61,6 +65,8 @@ public: */ explicit LogEvent(log_msg& msg); + explicit LogEvent(const StatsLogEventWrapper& statsLogEventWrapper); + /** * Constructs a LogEvent with synthetic data for testing. Must call init() before reading. */ @@ -69,6 +75,40 @@ public: // For testing. The timestamp is used as both elapsed real time and logd timestamp. explicit LogEvent(int32_t tagId, int64_t timestampNs); + // For testing. The timestamp is used as both elapsed real time and logd timestamp. + explicit LogEvent(int32_t tagId, int64_t timestampNs, int32_t uid); + + /** + * Constructs a KeyValuePairsAtom LogEvent from value maps. + */ + explicit LogEvent(int32_t tagId, int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, + int32_t uid, + const std::map<int32_t, int32_t>& int_map, + const std::map<int32_t, int64_t>& long_map, + const std::map<int32_t, std::string>& string_map, + const std::map<int32_t, float>& float_map); + + explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, + const SpeakerImpedance& speakerImpedance); + + explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, + const HardwareFailed& hardwareFailed); + + explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, + const PhysicalDropDetected& physicalDropDetected); + + explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, + const ChargeCycles& chargeCycles); + + explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, + const BatteryHealthSnapshotArgs& batteryHealthSnapshotArgs); + + explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, + const SlowIo& slowIo); + + explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, + const BatteryCausedShutdown& batteryCausedShutdown); + ~LogEvent(); /** @@ -110,6 +150,11 @@ public: bool write(float value); bool write(const std::vector<AttributionNodeInternal>& nodes); bool write(const AttributionNodeInternal& node); + bool writeKeyValuePairs(int32_t uid, + const std::map<int32_t, int32_t>& int_map, + const std::map<int32_t, int64_t>& long_map, + const std::map<int32_t, std::string>& string_map, + const std::map<int32_t, float>& float_map); /** * Return a string representation of this event. |