diff options
author | Kweku Adams <kwekua@google.com> | 2017-12-20 17:59:17 -0800 |
---|---|---|
committer | Kweku Adams <kwekua@google.com> | 2018-01-02 15:49:23 -0800 |
commit | f5cc5759d55f803cd230c7a595e89e634c3c36ee (patch) | |
tree | 7632d267b45d11c144fc54e411f2151e71671176 /cmds/incident_helper/src/parsers/KernelWakesParser.cpp | |
parent | b944bc86078146c523d58d2b70d56044be3bf216 (diff) |
incidentd: parsing ps dump into proto.
Also changing from execv to execvp so that we don't have to specify the full command path.
Bug: 65750831
Test: atest incident_helper_test
Change-Id: I92191afff4e7f9a6d08ea22ecfc2de5623d3bde5
Diffstat (limited to 'cmds/incident_helper/src/parsers/KernelWakesParser.cpp')
-rw-r--r-- | cmds/incident_helper/src/parsers/KernelWakesParser.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cmds/incident_helper/src/parsers/KernelWakesParser.cpp b/cmds/incident_helper/src/parsers/KernelWakesParser.cpp index ada4a5d0ffe2..cae51abbe57f 100644 --- a/cmds/incident_helper/src/parsers/KernelWakesParser.cpp +++ b/cmds/incident_helper/src/parsers/KernelWakesParser.cpp @@ -47,10 +47,14 @@ KernelWakesParser::Parse(const int in, const int out) const // parse for each record, the line delimiter is \t only! record = parseRecord(line, TAB_DELIMITER); - if (record.size() != header.size()) { + if (record.size() < header.size()) { // TODO: log this to incident report! fprintf(stderr, "[%s]Line %d has missing fields\n%s\n", this->name.string(), nline, line.c_str()); continue; + } else if (record.size() > header.size()) { + // TODO: log this to incident report! + fprintf(stderr, "[%s]Line %d has extra fields\n%s\n", this->name.string(), nline, line.c_str()); + continue; } long long token = proto.start(KernelWakeSources::WAKEUP_SOURCES); |