<feed xmlns='http://www.w3.org/2005/Atom'>
<title>system_core/logd/LogKlog.cpp, branch replicant-6.0</title>
<subtitle>system/core
</subtitle>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/system_core/'/>
<entry>
<title>logd: optimize code hotspots</title>
<updated>2015-11-01T12:29:12+00:00</updated>
<author>
<name>Mark Salyzyn</name>
<email>salyzyn@google.com</email>
</author>
<published>2015-10-02T16:22:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/system_core/commit/?id=75e80775d98d1d6e4fd3e6f3a8059a23413e031e'/>
<id>75e80775d98d1d6e4fd3e6f3a8059a23413e031e</id>
<content type='text'>
Discovered that we had a few libc hotspots. Adjust code to generally
reduce or nullify the number of calls to malloc, free, strlen,
strcmp, strncmp, memcmp &amp; strncasecmp. Total gain looks to be about
3% of logd's processing time. malloc still contributes to 3%, but all
others are now total 0.5%.

Bug: 23685592
Change-Id: Ife721121667969260cdb8b055524ae90f5911278
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Discovered that we had a few libc hotspots. Adjust code to generally
reduce or nullify the number of calls to malloc, free, strlen,
strcmp, strncmp, memcmp &amp; strncasecmp. Total gain looks to be about
3% of logd's processing time. malloc still contributes to 3%, but all
others are now total 0.5%.

Bug: 23685592
Change-Id: Ife721121667969260cdb8b055524ae90f5911278
</pre>
</div>
</content>
</entry>
<entry>
<title>logd: log_strtok_r deal with nuls</title>
<updated>2015-11-01T12:29:12+00:00</updated>
<author>
<name>Mark Salyzyn</name>
<email>salyzyn@google.com</email>
</author>
<published>2015-09-02T14:39:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/system_core/commit/?id=c5a324fe084901a93215498f983703e483d9c000'/>
<id>c5a324fe084901a93215498f983703e483d9c000</id>
<content type='text'>
Rename to log_strntok_r and change from dealing with strings
to dealing with a string and an associated length.

Bug: 23517551
Change-Id: Ia72f1305a53f55eeef9861ac378fb8205fd2378e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rename to log_strntok_r and change from dealing with strings
to dealing with a string and an associated length.

Bug: 23517551
Change-Id: Ia72f1305a53f55eeef9861ac378fb8205fd2378e
</pre>
</div>
</content>
</entry>
<entry>
<title>logd: klogd deal with nuls in dmesg</title>
<updated>2015-11-01T12:29:12+00:00</updated>
<author>
<name>Mark Salyzyn</name>
<email>salyzyn@google.com</email>
</author>
<published>2015-09-04T18:37:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/system_core/commit/?id=0d139dd7bb2d85c8a9b7e41f9898c1e44215e3ab'/>
<id>0d139dd7bb2d85c8a9b7e41f9898c1e44215e3ab</id>
<content type='text'>
Switch to using string and length in all transactions, treating
trailing nuls the same as spaces.

ToDo: change dumpstate (bugreport) to use logcat -b printable _regardless_

Bug: 23517551
Change-Id: I42162365e6bf8ed79d356e7b689a673902116fdb
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Switch to using string and length in all transactions, treating
trailing nuls the same as spaces.

ToDo: change dumpstate (bugreport) to use logcat -b printable _regardless_

Bug: 23517551
Change-Id: I42162365e6bf8ed79d356e7b689a673902116fdb
</pre>
</div>
</content>
</entry>
<entry>
<title>logd: klogd: sniff for time correction on Mediatek</title>
<updated>2015-11-01T12:29:12+00:00</updated>
<author>
<name>Mark Salyzyn</name>
<email>salyzyn@google.com</email>
</author>
<published>2015-09-01T20:09:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/system_core/commit/?id=f3337cb9c39deb52d42f32595190ef3298115761'/>
<id>f3337cb9c39deb52d42f32595190ef3298115761</id>
<content type='text'>
Need some more flexibility when parsing kernel messages
cluttered with extra fluff. This is the minimal relaxation
we can do to the rules to ensure that we work on all
possible devices and kernels when sniffing for time
correction information.

We want to minimize any future maintenance, keep in mind
klogd is a "userdebug" or "eng" feature and is disabled
in "user" builds. Manage expectations.

Bug: 23517551
Change-Id: I026d074e14fb2550e728683e85a973bd87e78a9c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Need some more flexibility when parsing kernel messages
cluttered with extra fluff. This is the minimal relaxation
we can do to the rules to ensure that we work on all
possible devices and kernels when sniffing for time
correction information.

We want to minimize any future maintenance, keep in mind
klogd is a "userdebug" or "eng" feature and is disabled
in "user" builds. Manage expectations.

Bug: 23517551
Change-Id: I026d074e14fb2550e728683e85a973bd87e78a9c
</pre>
</div>
</content>
</entry>
<entry>
<title>logd: klogd and Mediatek part deux</title>
<updated>2015-11-01T12:29:12+00:00</updated>
<author>
<name>Mark Salyzyn</name>
<email>salyzyn@google.com</email>
</author>
<published>2015-08-26T16:30:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/system_core/commit/?id=b9aae121b6b9c690f170c30de15d0b2cd5397a46'/>
<id>b9aae121b6b9c690f170c30de15d0b2cd5397a46</id>
<content type='text'>
- switch to an open coded strnrchr
- validity checking on n, taglen and b values.

Bug: 23517551
Change-Id: I568e25c5aa6d8474835454a0e83b19c2921b7986
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- switch to an open coded strnrchr
- validity checking on n, taglen and b values.

Bug: 23517551
Change-Id: I568e25c5aa6d8474835454a0e83b19c2921b7986
</pre>
</div>
</content>
</entry>
<entry>
<title>logd: klogd and Mediatek</title>
<updated>2015-11-01T12:29:12+00:00</updated>
<author>
<name>Mark Salyzyn</name>
<email>salyzyn@google.com</email>
</author>
<published>2015-08-26T16:30:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/system_core/commit/?id=16fa18971114e105f6a48156e4a4902f5fcc5235'/>
<id>16fa18971114e105f6a48156e4a4902f5fcc5235</id>
<content type='text'>
- sniff for PID in kernel log messages if available
- properly deal with klogd watermark in face of modified output
- deal more stringently with priority tag, must have [ following
- suppress process-name stutter in tag that can happen
- do not use : to demark tag if within [ ]

Mediatek-special change that adds &lt;printk_state&gt;(&lt;cpu&gt;)[&lt;pid&gt;:&lt;comm&gt;]
as a prefix to the printk messages. Along the lines of (simplified
for entertainment purposes, YMMV):

    char tbuf[50]; /* printk prefix */
    int this_cpu = smp_processor_id();
    char state = __raw_get_cpu_var(printk_state);
    unsigned tlen = snprintf(tbuf, sizeof(tbuf), "%c(%x)[%d:%s]",
               state, this_cpu, current-&gt;pid, current-&gt;comm);

Bug: 23517551
Change-Id: I568e25c5aa6d8474835454a0e83b19c2921b7985
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- sniff for PID in kernel log messages if available
- properly deal with klogd watermark in face of modified output
- deal more stringently with priority tag, must have [ following
- suppress process-name stutter in tag that can happen
- do not use : to demark tag if within [ ]

Mediatek-special change that adds &lt;printk_state&gt;(&lt;cpu&gt;)[&lt;pid&gt;:&lt;comm&gt;]
as a prefix to the printk messages. Along the lines of (simplified
for entertainment purposes, YMMV):

    char tbuf[50]; /* printk prefix */
    int this_cpu = smp_processor_id();
    char state = __raw_get_cpu_var(printk_state);
    unsigned tlen = snprintf(tbuf, sizeof(tbuf), "%c(%x)[%d:%s]",
               state, this_cpu, current-&gt;pid, current-&gt;comm);

Bug: 23517551
Change-Id: I568e25c5aa6d8474835454a0e83b19c2921b7985
</pre>
</div>
</content>
</entry>
<entry>
<title>healthd: logd: add timestamp to kernel logged battery messages</title>
<updated>2015-11-01T12:29:12+00:00</updated>
<author>
<name>Mark Salyzyn</name>
<email>salyzyn@google.com</email>
</author>
<published>2015-07-23T16:22:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/system_core/commit/?id=4f8d719dc4306c1daba79a5143217f056ace2427'/>
<id>4f8d719dc4306c1daba79a5143217f056ace2427</id>
<content type='text'>
Aid monotonic to realtime logging synchronization correction in
the Android ecosystem by providing a periodic notification.  We
now have the following messages in the kernel logs:

- PM: suspend entry %Y-%m-%d %H:%M:%S.%09q UTC
- PM: suspend exit %Y-%m-%d %H:%M:%S.%09q UTC
- Suspended for %s.%03q seconds
- healthd: battery l=100 ... %Y-%m-%d %H:%M:%S.%09q UTC

Alter klogd to resynchronize on healthd messages as well.

NB: Time using strftime format, %q is a reference to fractional
second as introduced into log_time strptime method.

Bug: 21868540
Change-Id: I854afc0a07dff9c7f26d2b2f68990e52bf90e300
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Aid monotonic to realtime logging synchronization correction in
the Android ecosystem by providing a periodic notification.  We
now have the following messages in the kernel logs:

- PM: suspend entry %Y-%m-%d %H:%M:%S.%09q UTC
- PM: suspend exit %Y-%m-%d %H:%M:%S.%09q UTC
- Suspended for %s.%03q seconds
- healthd: battery l=100 ... %Y-%m-%d %H:%M:%S.%09q UTC

Alter klogd to resynchronize on healthd messages as well.

NB: Time using strftime format, %q is a reference to fractional
second as introduced into log_time strptime method.

Bug: 21868540
Change-Id: I854afc0a07dff9c7f26d2b2f68990e52bf90e300
</pre>
</div>
</content>
</entry>
<entry>
<title>Logd: Handle unused variable and fields</title>
<updated>2015-11-01T12:29:12+00:00</updated>
<author>
<name>Andreas Gampe</name>
<email>agampe@google.com</email>
</author>
<published>2015-07-27T18:04:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/system_core/commit/?id=67c96c8d5a59e071983270ddd54bad8d0d744d95'/>
<id>67c96c8d5a59e071983270ddd54bad8d0d744d95</id>
<content type='text'>
For build-system CFLAGS clean-up.

Bug: 18632512
Change-Id: If81d6705b44e9a29f64c44c56ea633c031e831b7
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For build-system CFLAGS clean-up.

Bug: 18632512
Change-Id: If81d6705b44e9a29f64c44c56ea633c031e831b7
</pre>
</div>
</content>
</entry>
<entry>
<title>logd: refine is_prio</title>
<updated>2015-11-01T12:29:12+00:00</updated>
<author>
<name>Mark Salyzyn</name>
<email>salyzyn@google.com</email>
</author>
<published>2015-07-13T17:19:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/system_core/commit/?id=58be58ce08766780ea9941a46426942fd16cd0cf'/>
<id>58be58ce08766780ea9941a46426942fd16cd0cf</id>
<content type='text'>
- Heuristics associated with translation of kernel messages to
  Android user space logs.
- Limit is_prio to 4 characters, we got false positives on hex
  values like &lt;register contents&gt; with no alpha chars.
- x11 and other register definitions are not valid tags, en0 is
- fix some Android coding standard issues

Change-Id: Idc3dcc53a2cb75ac38628c8ef7a5d5b53f12587a
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Heuristics associated with translation of kernel messages to
  Android user space logs.
- Limit is_prio to 4 characters, we got false positives on hex
  values like &lt;register contents&gt; with no alpha chars.
- x11 and other register definitions are not valid tags, en0 is
- fix some Android coding standard issues

Change-Id: Idc3dcc53a2cb75ac38628c8ef7a5d5b53f12587a
</pre>
</div>
</content>
</entry>
<entry>
<title>logd: missing klogd content</title>
<updated>2015-06-15T21:22:02+00:00</updated>
<author>
<name>Mark Salyzyn</name>
<email>salyzyn@google.com</email>
</author>
<published>2015-06-12T21:59:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/system_core/commit/?id=d5600fd40fac5e90532ea08e22940965cfdd7710'/>
<id>d5600fd40fac5e90532ea08e22940965cfdd7710</id>
<content type='text'>
(cherry pick from commit ee49c6a670a54e0636f81f39ddc93c87c9a4d766)

- regression in log_strtok_r (part deux) In commit
      'logd: fix kernel logline stutter'
  2c3b300fd8307e8da13608197d0a89bc613de5fb 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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(cherry pick from commit ee49c6a670a54e0636f81f39ddc93c87c9a4d766)

- regression in log_strtok_r (part deux) In commit
      'logd: fix kernel logline stutter'
  2c3b300fd8307e8da13608197d0a89bc613de5fb 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
</pre>
</div>
</content>
</entry>
</feed>
