Loading logd/LogStatistics.cpp +14 −8 Original line number Diff line number Diff line Loading @@ -671,8 +671,11 @@ void LogStatistics::format(char **buf, size_t sizesTotal = p->sizesTotal(); android::String8 sz(""); sz.appendFormat((sizes != sizesTotal) ? "%zu/%zu" : "%zu", sizes, sizesTotal); if (sizes == sizesTotal) { sz.appendFormat("%zu", sizes); } else { sz.appendFormat("%zu/%zu", sizes, sizesTotal); } android::String8 pd(""); pd.appendFormat("%u%c", pid, p->pidGone() ? '?' : ' '); Loading Loading @@ -783,12 +786,15 @@ void LogStatistics::format(char **buf, PidStatistics *pp = *pt; pid_t p = pp->getPid(); intermediate = string.format(oneline ? ((p == PidStatistics::gone) ? "%d/?" : "%d/%d%c") : "%d", u, p, pp->pidGone() ? '?' : '\0'); if (!oneline) { intermediate = string.format("%d", u); } else if (p == PidStatistics::gone) { intermediate = string.format("%d/?", u); } else if (pp->pidGone()) { intermediate = string.format("%d/%d?", u, p); } else { intermediate = string.format("%d/%d", u, p); } string.appendFormat(first ? "\n%-12s" : "%-12s", intermediate.string()); intermediate.clear(); Loading logd/LogWhiteBlackList.cpp +9 −4 Original line number Diff line number Diff line Loading @@ -39,10 +39,15 @@ int Prune::cmp(uid_t uid, pid_t pid) const { void Prune::format(char **strp) { if (mUid != uid_all) { asprintf(strp, (mPid != pid_all) ? "%u/%u" : "%u", mUid, mPid); if (mPid != pid_all) { asprintf(strp, "%u/%u", mUid, mPid); } else { // NB: mPid == pid_all can not happen if mUid == uid_all asprintf(strp, (mPid != pid_all) ? "/%u" : "/", mPid); asprintf(strp, "%u", mUid); } } else if (mPid != pid_all) { asprintf(strp, "/%u", mPid); } else { // NB: mPid == pid_all can not happen if mUid == uid_all asprintf(strp, "/"); } } Loading logd/tests/logd_test.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -417,7 +417,11 @@ static void dump_log_msg(const char *prefix, if (((p - cp) > 3) && !*p && ((unsigned int)(p - cp) < len)) { fprintf(stderr, "\""); while (*cp) { fprintf(stderr, (*cp != '\n') ? "%c" : "\\n", *cp); if (*cp != '\n') { fprintf(stderr, "%c", *cp); } else { fprintf(stderr, "\\n"); } ++cp; --len; } Loading Loading
logd/LogStatistics.cpp +14 −8 Original line number Diff line number Diff line Loading @@ -671,8 +671,11 @@ void LogStatistics::format(char **buf, size_t sizesTotal = p->sizesTotal(); android::String8 sz(""); sz.appendFormat((sizes != sizesTotal) ? "%zu/%zu" : "%zu", sizes, sizesTotal); if (sizes == sizesTotal) { sz.appendFormat("%zu", sizes); } else { sz.appendFormat("%zu/%zu", sizes, sizesTotal); } android::String8 pd(""); pd.appendFormat("%u%c", pid, p->pidGone() ? '?' : ' '); Loading Loading @@ -783,12 +786,15 @@ void LogStatistics::format(char **buf, PidStatistics *pp = *pt; pid_t p = pp->getPid(); intermediate = string.format(oneline ? ((p == PidStatistics::gone) ? "%d/?" : "%d/%d%c") : "%d", u, p, pp->pidGone() ? '?' : '\0'); if (!oneline) { intermediate = string.format("%d", u); } else if (p == PidStatistics::gone) { intermediate = string.format("%d/?", u); } else if (pp->pidGone()) { intermediate = string.format("%d/%d?", u, p); } else { intermediate = string.format("%d/%d", u, p); } string.appendFormat(first ? "\n%-12s" : "%-12s", intermediate.string()); intermediate.clear(); Loading
logd/LogWhiteBlackList.cpp +9 −4 Original line number Diff line number Diff line Loading @@ -39,10 +39,15 @@ int Prune::cmp(uid_t uid, pid_t pid) const { void Prune::format(char **strp) { if (mUid != uid_all) { asprintf(strp, (mPid != pid_all) ? "%u/%u" : "%u", mUid, mPid); if (mPid != pid_all) { asprintf(strp, "%u/%u", mUid, mPid); } else { // NB: mPid == pid_all can not happen if mUid == uid_all asprintf(strp, (mPid != pid_all) ? "/%u" : "/", mPid); asprintf(strp, "%u", mUid); } } else if (mPid != pid_all) { asprintf(strp, "/%u", mPid); } else { // NB: mPid == pid_all can not happen if mUid == uid_all asprintf(strp, "/"); } } Loading
logd/tests/logd_test.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -417,7 +417,11 @@ static void dump_log_msg(const char *prefix, if (((p - cp) > 3) && !*p && ((unsigned int)(p - cp) < len)) { fprintf(stderr, "\""); while (*cp) { fprintf(stderr, (*cp != '\n') ? "%c" : "\\n", *cp); if (*cp != '\n') { fprintf(stderr, "%c", *cp); } else { fprintf(stderr, "\\n"); } ++cp; --len; } Loading