Lines Matching refs:cp
299 const char* cp = nullptr; in sniffTime() local
301 cp = now.strptime(buf, "[ %s.%q]"); // can index beyond buffer bounds in sniffTime()
302 if (cp && (cp > &buf[len - 1])) cp = nullptr; in sniffTime()
304 if (cp) { in sniffTime()
305 len -= cp - buf; in sniffTime()
306 if ((len > 0) && isspace(*cp)) { in sniffTime()
307 ++cp; in sniffTime()
310 buf = cp; in sniffTime()
315 if (((b = android::strnstr(cp, len, suspendStr))) && in sniffTime()
316 (((b += strlen(suspendStr)) - cp) < len)) { in sniffTime()
317 len -= b - cp; in sniffTime()
319 } else if (((b = android::strnstr(cp, len, resumeStr))) && in sniffTime()
320 (((b += strlen(resumeStr)) - cp) < len)) { in sniffTime()
321 len -= b - cp; in sniffTime()
323 } else if (((b = android::strnstr(cp, len, healthdStr))) && in sniffTime()
324 (((b += strlen(healthdStr)) - cp) < len) && in sniffTime()
325 ((b = android::strnstr(b, len -= b - cp, batteryStr))) && in sniffTime()
326 (((b += strlen(batteryStr)) - cp) < len)) { in sniffTime()
332 } else if (((b = android::strnstr(cp, len, suspendedStr))) && in sniffTime()
333 (((b += strlen(suspendStr)) - cp) < len)) { in sniffTime()
334 len -= b - cp; in sniffTime()
371 const char* cp = buf; in sniffPid() local
374 if (((ssize_t)strnlen(cp, len) == len) && cp[len]) { in sniffPid()
378 if ((len > 9) && (cp[0] == 'c') && isdigit(cp[1]) && in sniffPid()
379 (isdigit(cp[2]) || (cp[2] == ' ')) && (cp[3] == ' ')) { in sniffPid()
383 if (isdigit(cp[i])) { in sniffPid()
385 } else if (gotDigit || (cp[i] != ' ')) { in sniffPid()
389 if ((i == 9) && (cp[i] == ' ')) { in sniffPid()
392 if (sscanf(cp + 4, "%d%c", &pid, &dummy) == 2) { in sniffPid()
393 buf = cp + 10; // skip-it-all in sniffPid()
400 if (*cp == '[') { in sniffPid()
403 if (sscanf(cp, "[%d:%*[a-z_./0-9:A-Z]]%c", &pid, &dummy) == 2) { in sniffPid()
408 ++cp; in sniffPid()
417 const char* cp = buf; in parseKernelPrio() local
418 if ((len > 0) && (*cp == '<')) { in parseKernelPrio()
420 while (--len && isdigit(*++cp)) { in parseKernelPrio()
421 pri = (pri * 10) + *cp - '0'; in parseKernelPrio()
423 if ((len > 0) && (*cp == '>')) { in parseKernelPrio()
424 ++cp; in parseKernelPrio()
426 cp = buf; in parseKernelPrio()
429 buf = cp; in parseKernelPrio()
437 const char* cp = android::strnstr(buf, len, suspendStr); in synchronize() local
438 if (!cp) { in synchronize()
439 cp = android::strnstr(buf, len, resumeStr); in synchronize()
440 if (!cp) return; in synchronize()
443 if (rp && (rp < cp)) cp = rp; in synchronize()
447 --cp; in synchronize()
448 } while ((cp > buf) && (*cp != '\n')); in synchronize()
449 if (*cp == '\n') { in synchronize()
450 ++cp; in synchronize()
452 parseKernelPrio(cp, len - (cp - buf)); in synchronize()
454 log_time now = sniffTime(cp, len - (cp - buf), true); in synchronize()
457 if (!suspended || (suspended > cp)) { in synchronize()
460 cp = suspended; in synchronize()
463 --cp; in synchronize()
464 } while ((cp > buf) && (*cp != '\n')); in synchronize()
465 if (*cp == '\n') { in synchronize()
466 ++cp; in synchronize()
468 parseKernelPrio(cp, len - (cp - buf)); in synchronize()
470 sniffTime(cp, len - (cp - buf), true); in synchronize()
620 const char* cp; in log() local
621 for (cp = et; (taglen > 0) && isspace(*cp); ++cp, --taglen) { in log()
627 if (*cp == ':') { in log()
634 p = cp + 1; in log()
635 } else if ((taglen > size) && (tolower(*bt) == tolower(*cp))) { in log()
637 if (!fastcmp<strncasecmp>(bt + 1, cp + 1, size - 1)) { // no match in log()
643 const char* b = cp; in log()
644 cp += size; in log()
646 while ((--taglen > 0) && !isspace(*++cp) && (*cp != ':')) { in log()
649 for (e = cp; (taglen > 0) && isspace(*cp); ++cp, --taglen) { in log()
651 if ((taglen > 0) && (*cp == ':')) { in log()
654 p = cp + 1; in log()
662 !fastcmp<strncmp>(bt + 1, cp + 1, size - hostlen - 1)) { in log()
663 const char* b = cp; in log()
664 cp += size - hostlen; in log()
666 if (*cp == '.') { in log()
667 while ((--taglen > 0) && !isspace(*++cp) && in log()
668 (*cp != ':')) { in log()
671 for (e = cp; (taglen > 0) && isspace(*cp); in log()
672 ++cp, --taglen) { in log()
674 if ((taglen > 0) && (*cp == ':')) { in log()
677 p = cp + 1; in log()
687 while ((--taglen > 0) && !isspace(*++cp) && (*cp != ':')) { in log()
690 for (e = cp; (taglen > 0) && isspace(*cp); ++cp, --taglen) { in log()
693 if ((taglen > 0) && (*cp == ':')) { in log()
696 p = cp + 1; in log()