diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2017-08-23 07:30:25 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-08-23 07:30:25 +0000 |
commit | b925776f0ba1fba017fcb34e22ead92a200342f9 (patch) | |
tree | 1c846f4ff7a97cc8743b9a5503d2fff234a4edc9 | |
parent | 3bbde207fb3fe6e77ff71e89bf0b5b76d538f041 (diff) | |
parent | 3493acab586c35a9cf9baffd027950d2413d936c (diff) | |
download | ipacfg-mgr-b925776f0ba1fba017fcb34e22ead92a200342f9.tar.gz |
release-request-cff6d9b6-a564-4d17-99cb-c2d0bb282758-for-git_oc-mr1-release-4293817 snap-temp-L12800000095933585
Change-Id: Ib68791bfcc59dadc318077928ba176d4a0952f23
-rw-r--r-- | msm8998/hal/inc/HAL.h | 3 | ||||
-rw-r--r-- | msm8998/hal/inc/LocalLogBuffer.h | 3 | ||||
-rw-r--r-- | msm8998/hal/src/HAL.cpp | 11 | ||||
-rw-r--r-- | msm8998/hal/src/LocalLogBuffer.cpp | 9 |
4 files changed, 24 insertions, 2 deletions
diff --git a/msm8998/hal/inc/HAL.h b/msm8998/hal/inc/HAL.h index 24761dd..c7b7817 100644 --- a/msm8998/hal/inc/HAL.h +++ b/msm8998/hal/inc/HAL.h @@ -161,6 +161,9 @@ public: const hidl_string& /* prefix */, removeDownstream_cb /* hidl_cb */); + /* Common */ + Return<void> debug(const hidl_handle& /* fd */, const hidl_vec<hidl_string>& /* options */); + private: typedef struct BoolResult { bool success; diff --git a/msm8998/hal/inc/LocalLogBuffer.h b/msm8998/hal/inc/LocalLogBuffer.h index c23ef7d..7cefe64 100644 --- a/msm8998/hal/inc/LocalLogBuffer.h +++ b/msm8998/hal/inc/LocalLogBuffer.h @@ -65,9 +65,10 @@ public: LocalLogBuffer(string /* name */, int /* maxLogs */); void addLog(FunctionLog /* log */); void toLogcat(); + void toFd(int fd); private: deque<FunctionLog> mLogs; const string mName; const size_t mMaxLogs; }; /* LocalLogBuffer */ -#endif /* _LOCAL_LOG_BUFFER_H_ */
\ No newline at end of file +#endif /* _LOCAL_LOG_BUFFER_H_ */ diff --git a/msm8998/hal/src/HAL.cpp b/msm8998/hal/src/HAL.cpp index 22aff0f..d722e78 100644 --- a/msm8998/hal/src/HAL.cpp +++ b/msm8998/hal/src/HAL.cpp @@ -77,7 +77,7 @@ HAL* HAL::makeIPAHAL(int version, IOffloadManager* mgr) { /* ------------------------------ PRIVATE ----------------------------------- */ -HAL::HAL(IOffloadManager* mgr) : mLogs("HAL Function Calls", 50) { +HAL::HAL(IOffloadManager* mgr) : mLogs("HAL Function Calls", 100) { mIPA = mgr; mCb.clear(); mCbIpa = nullptr; @@ -594,3 +594,12 @@ Return<void> HAL::removeDownstream mLogs.addLog(fl); return Void(); } /* removeDownstream */ + +Return<void> HAL::debug +( + const hidl_handle& fd, + const hidl_vec<hidl_string>& /* options */ +) { + mLogs.toFd(fd->data[0]); + return Void(); +} /* debug */ diff --git a/msm8998/hal/src/LocalLogBuffer.cpp b/msm8998/hal/src/LocalLogBuffer.cpp index f556e40..5e89557 100644 --- a/msm8998/hal/src/LocalLogBuffer.cpp +++ b/msm8998/hal/src/LocalLogBuffer.cpp @@ -33,6 +33,7 @@ #include <deque> #include <string> #include <sys/types.h> +#include <unistd.h> #include <vector> /* Internal Includes */ @@ -124,3 +125,11 @@ void LocalLogBuffer::toLogcat() { for (size_t i = 0; i < mLogs.size(); i++) ALOGD("%s: %s", mName.c_str(), mLogs[i].toString().c_str()); } /* toLogcat */ + +void LocalLogBuffer::toFd(int fd) { + for (size_t i = 0; i < mLogs.size(); i++) { + string line = mName + " " + mLogs[i].toString(); + write(fd, line.c_str(), line.size()); + write(fd, "\n", 1); + } +} /* toFd */ |