Loading cmds/statsd/src/FieldValue.h +0 −12 Original line number Diff line number Diff line Loading @@ -382,10 +382,6 @@ public: inline void setUidField(bool isUid) { setBitmaskAtPos(UID_POS, isUid); } inline void setResetState(int32_t resetState) { mResetState = resetState; } // Default value = false inline bool isNested() const { return getValueFromBitmask(NESTED_POS); } Loading @@ -398,12 +394,6 @@ public: // Default value = false inline bool isUidField() const { return getValueFromBitmask(UID_POS); } // If a reset state is not sent in the StatsEvent, returns -1. Note that a // reset satate is only sent if and only if a reset should be triggered. inline int32_t getResetState() const { return mResetState; } private: inline void setBitmaskAtPos(int pos, bool value) { mBooleanBitmask &= ~(1 << pos); // clear Loading @@ -417,8 +407,6 @@ private: // This is a bitmask over all annotations stored in boolean form. Because // there are only 4 booleans, just one byte is required. uint8_t mBooleanBitmask = 0; int32_t mResetState = -1; }; /** Loading cmds/statsd/src/logd/LogEvent.cpp +1 −10 Original line number Diff line number Diff line Loading @@ -114,14 +114,6 @@ LogEvent::LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, mValues.push_back(FieldValue(Field(mTagId, getSimpleField(4)), Value(trainInfo.status))); } LogEvent::~LogEvent() { if (mContext) { // This is for the case when LogEvent is created using the test interface // but init() isn't called. android_log_destroy(&mContext); } } void LogEvent::parseInt32(int32_t* pos, int32_t depth, bool* last, uint8_t numAnnotations) { int32_t value = readNextValue<int32_t>(); addToValues(pos, depth, value, last); Loading Loading @@ -303,8 +295,7 @@ void LogEvent::parseTriggerStateResetAnnotation(uint8_t annotationType) { return; } int32_t resetState = readNextValue<int32_t>(); mValues[mValues.size() - 1].mAnnotations.setResetState(resetState); mResetState = readNextValue<int32_t>(); } void LogEvent::parseStateNestedAnnotation(uint8_t annotationType) { Loading cmds/statsd/src/logd/LogEvent.h +8 −6 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ public: explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, const InstallTrainInfo& installTrainInfo); ~LogEvent(); ~LogEvent() {} /** * Get the timestamp associated with this event. Loading Loading @@ -184,6 +184,12 @@ public: return mExclusiveStateFieldIndex; } // If a reset state is not sent in the StatsEvent, returns -1. Note that a // reset state is sent if and only if a reset should be triggered. inline int getResetState() const { return mResetState; } inline LogEvent makeCopy() { return LogEvent(*this); } Loading Loading @@ -287,11 +293,6 @@ private: // matching. std::vector<FieldValue> mValues; // This field is used when statsD wants to create log event object and write fields to it. After // calling init() function, this object would be destroyed to save memory usage. // When the log event is created from log msg, this field is never initiated. android_log_context mContext = NULL; // The timestamp set by the logd. int64_t mLogdTimestampNs; Loading @@ -312,6 +313,7 @@ private: int mUidFieldIndex = -1; int mAttributionChainIndex = -1; int mExclusiveStateFieldIndex = -1; int mResetState = -1; }; void writeExperimentIdsToProto(const std::vector<int64_t>& experimentIds, std::vector<uint8_t>* protoOut); Loading cmds/statsd/src/state/StateTracker.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ void StateTracker::onLogEvent(const LogEvent& event) { return; } const int32_t resetState = stateValue.mAnnotations.getResetState(); const int32_t resetState = event.getResetState(); if (resetState != -1) { VLOG("StateTracker new reset state: %d", resetState); handleReset(eventTimeNs, resetState); Loading cmds/statsd/tests/LogEvent_test.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -352,7 +352,7 @@ TEST(LogEventTest, TestResetStateAnnotation) { const vector<FieldValue>& values = event.getValues(); EXPECT_EQ(values.size(), 1); EXPECT_EQ(values[0].mAnnotations.getResetState(), resetState); EXPECT_EQ(event.getResetState(), resetState); } } // namespace statsd Loading Loading
cmds/statsd/src/FieldValue.h +0 −12 Original line number Diff line number Diff line Loading @@ -382,10 +382,6 @@ public: inline void setUidField(bool isUid) { setBitmaskAtPos(UID_POS, isUid); } inline void setResetState(int32_t resetState) { mResetState = resetState; } // Default value = false inline bool isNested() const { return getValueFromBitmask(NESTED_POS); } Loading @@ -398,12 +394,6 @@ public: // Default value = false inline bool isUidField() const { return getValueFromBitmask(UID_POS); } // If a reset state is not sent in the StatsEvent, returns -1. Note that a // reset satate is only sent if and only if a reset should be triggered. inline int32_t getResetState() const { return mResetState; } private: inline void setBitmaskAtPos(int pos, bool value) { mBooleanBitmask &= ~(1 << pos); // clear Loading @@ -417,8 +407,6 @@ private: // This is a bitmask over all annotations stored in boolean form. Because // there are only 4 booleans, just one byte is required. uint8_t mBooleanBitmask = 0; int32_t mResetState = -1; }; /** Loading
cmds/statsd/src/logd/LogEvent.cpp +1 −10 Original line number Diff line number Diff line Loading @@ -114,14 +114,6 @@ LogEvent::LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, mValues.push_back(FieldValue(Field(mTagId, getSimpleField(4)), Value(trainInfo.status))); } LogEvent::~LogEvent() { if (mContext) { // This is for the case when LogEvent is created using the test interface // but init() isn't called. android_log_destroy(&mContext); } } void LogEvent::parseInt32(int32_t* pos, int32_t depth, bool* last, uint8_t numAnnotations) { int32_t value = readNextValue<int32_t>(); addToValues(pos, depth, value, last); Loading Loading @@ -303,8 +295,7 @@ void LogEvent::parseTriggerStateResetAnnotation(uint8_t annotationType) { return; } int32_t resetState = readNextValue<int32_t>(); mValues[mValues.size() - 1].mAnnotations.setResetState(resetState); mResetState = readNextValue<int32_t>(); } void LogEvent::parseStateNestedAnnotation(uint8_t annotationType) { Loading
cmds/statsd/src/logd/LogEvent.h +8 −6 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ public: explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs, const InstallTrainInfo& installTrainInfo); ~LogEvent(); ~LogEvent() {} /** * Get the timestamp associated with this event. Loading Loading @@ -184,6 +184,12 @@ public: return mExclusiveStateFieldIndex; } // If a reset state is not sent in the StatsEvent, returns -1. Note that a // reset state is sent if and only if a reset should be triggered. inline int getResetState() const { return mResetState; } inline LogEvent makeCopy() { return LogEvent(*this); } Loading Loading @@ -287,11 +293,6 @@ private: // matching. std::vector<FieldValue> mValues; // This field is used when statsD wants to create log event object and write fields to it. After // calling init() function, this object would be destroyed to save memory usage. // When the log event is created from log msg, this field is never initiated. android_log_context mContext = NULL; // The timestamp set by the logd. int64_t mLogdTimestampNs; Loading @@ -312,6 +313,7 @@ private: int mUidFieldIndex = -1; int mAttributionChainIndex = -1; int mExclusiveStateFieldIndex = -1; int mResetState = -1; }; void writeExperimentIdsToProto(const std::vector<int64_t>& experimentIds, std::vector<uint8_t>* protoOut); Loading
cmds/statsd/src/state/StateTracker.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ void StateTracker::onLogEvent(const LogEvent& event) { return; } const int32_t resetState = stateValue.mAnnotations.getResetState(); const int32_t resetState = event.getResetState(); if (resetState != -1) { VLOG("StateTracker new reset state: %d", resetState); handleReset(eventTimeNs, resetState); Loading
cmds/statsd/tests/LogEvent_test.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -352,7 +352,7 @@ TEST(LogEventTest, TestResetStateAnnotation) { const vector<FieldValue>& values = event.getValues(); EXPECT_EQ(values.size(), 1); EXPECT_EQ(values[0].mAnnotations.getResetState(), resetState); EXPECT_EQ(event.getResetState(), resetState); } } // namespace statsd Loading