logd: test: statistics report chatty effective percentage
Add parsing to recognize optional chatty effective percentage field as reported in the logger statistics. Bug: 22855208 Change-Id: Id9c5e4a907ed0f9319beb9ddbfa27f4844bffc7d
This commit is contained in:
parent
7d8939ec1d
commit
f33657da4d
1 changed files with 21 additions and 1 deletions
|
@ -112,18 +112,38 @@ static char *find_benchmark_spam(char *cp)
|
|||
++cp;
|
||||
}
|
||||
benchmark = cp;
|
||||
#ifdef DEBUG
|
||||
char *end = strstr(benchmark, "\n");
|
||||
if (end == NULL) {
|
||||
end = benchmark + strlen(benchmark);
|
||||
}
|
||||
fprintf(stderr, "parse for spam counter in \"%.*s\"\n",
|
||||
(int)(end - benchmark), benchmark);
|
||||
#endif
|
||||
// content
|
||||
while (isdigit(*cp)) {
|
||||
++cp;
|
||||
}
|
||||
while (isspace(*cp)) {
|
||||
++cp;
|
||||
}
|
||||
// optional +/- field?
|
||||
if ((*cp == '-') || (*cp == '+')) {
|
||||
while (isdigit(*++cp) ||
|
||||
(*cp == '.') || (*cp == '%') || (*cp == 'X')) {
|
||||
;
|
||||
}
|
||||
while (isspace(*cp)) {
|
||||
++cp;
|
||||
}
|
||||
}
|
||||
// number of entries pruned
|
||||
unsigned long value = 0;
|
||||
while (isdigit(*cp)) {
|
||||
value = value * 10ULL + *cp - '0';
|
||||
++cp;
|
||||
}
|
||||
if (value > 100000UL) {
|
||||
if (value > 10UL) {
|
||||
break;
|
||||
}
|
||||
benchmark = NULL;
|
||||
|
|
Loading…
Reference in a new issue