diff options
author | Yi Jin <jinyithu@google.com> | 2017-11-06 17:17:27 -0800 |
---|---|---|
committer | Yi Jin <jinyithu@google.com> | 2017-11-14 13:22:25 -0800 |
commit | 0eb223496c3dee6bd0a33ea4fa664fb92ef557cc (patch) | |
tree | bfaa7a6ae9751f1ff5acc34253b0cc5d7773d6c3 /cmds/incidentd/src/Section.cpp | |
parent | a379f499c8e27d2c18b7089feb18c7f0a44e0433 (diff) |
Implement Cpu Freq Section
When poll from sysfs, revents return POLLERR by default, handles
this edge case in this cl.
Bug: 68774444
Test: unit tested + on device tests
Change-Id: I23540299c026d3e7676497f56690e9f8646a47bd
Diffstat (limited to 'cmds/incidentd/src/Section.cpp')
-rw-r--r-- | cmds/incidentd/src/Section.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cmds/incidentd/src/Section.cpp b/cmds/incidentd/src/Section.cpp index 892bcca17b86..c08b9ea80c04 100644 --- a/cmds/incidentd/src/Section.cpp +++ b/cmds/incidentd/src/Section.cpp @@ -232,6 +232,7 @@ FileSection::FileSection(int id, const char* filename, const int64_t timeoutMs) mFilename(filename) { name = filename; + mIsSysfs = strncmp(filename, "/sys/", 5) == 0; } FileSection::~FileSection() {} @@ -264,7 +265,7 @@ FileSection::Execute(ReportRequestSet* requests) const // parent process status_t readStatus = buffer.readProcessedDataInStream(fd, p2cPipe.writeFd(), c2pPipe.readFd(), - this->timeoutMs); + this->timeoutMs, mIsSysfs); if (readStatus != NO_ERROR || buffer.timedOut()) { ALOGW("FileSection '%s' failed to read data from incident helper: %s, timedout: %s, kill: %s", this->name.string(), strerror(-readStatus), buffer.timedOut() ? "true" : "false", |