logd: missing klogd content

(cherry pick from commit 03e60840003726cdd88b75f21ffac6f2f431dd5e)

- regression in log_strtok_r (part deux) In commit
      'logd: fix kernel logline stutter'
  4c722959e6018207fd5e5cfbc17dfada2eef8ca8 we introduced log_strtok_r.
  as a replacement for strtok_r that dealt with a problem with
  some kernel log messages. Fix is to refine definition of
  is_timestamp to not match on patterns like [0], requiring
  a single period. Another fix is to refine definition of
  is_prio to properly escape non-digit content.
- Missing content because SYSLOG_ACTION_SIZE_BUFFER with added logging
  is too short for full read of SYSLOG_ACTION_READ_ALL dropping
  initial content. Add a margin for additional 1024 bytes.
- Absolute _first_ log entry has sequence number of 1, which is
  specifically dropped, start sequence count at 1 rather than 0.
- Remove trailing space for efficiency.
- If tag exists but no content, trick into kernel logging.

Bug: 21851884
Change-Id: I0867a555a3bca09bbf18d18e75e41dffffe57a23
3 files changed
tree: c93292576d3610366846fe44964267e17cde9eb0
  1. liblog/
  2. logcat/
  3. logd/
  4. logwrapper/