[systemd-devel] [PATCH] bootchart: only show printable processes
WaLyong Cho
walyong.cho at samsung.com
Wed Aug 27 08:44:34 PDT 2014
On 08/27/2014 03:49 AM, Lennart Poettering wrote:
> On Tue, 26.08.14 18:11, Mantas Mikulėnas (grawity at gmail.com) wrote:
>
>> On Tue, Aug 26, 2014 at 5:07 PM, WaLyong Cho <walyong.cho at samsung.com> wrote:
>>>
>>> This case really shouldn't be happen. (But actually sometime that was
>>> happen.) Eeven if happened we maybe want to see the bootchart exclude
>>> not printable processes.
>>> ---
>>> src/bootchart/svg.c | 3 +++
>>> 1 file changed, 3 insertions(+)
>>>
>>> diff --git a/src/bootchart/svg.c b/src/bootchart/svg.c
>>> index 135883f..9b7de33 100644
>>> --- a/src/bootchart/svg.c
>>> +++ b/src/bootchart/svg.c
>>> @@ -1014,6 +1014,9 @@ static void svg_ps_bars(void) {
>>> if (!enc_name)
>>> continue;
>>>
>>> + if (!utf8_is_printable(enc_name, strlen(enc_name)))
>>> + continue;
>>> +
>>> /* leave some trace of what we actually filtered etc. */
>>> svg("<!-- %s [%i] ppid=%i runtime=%.03fs -->\n", enc_name, ps->pid,
>>> ps->ppid, ps->total);
>>
>> If the name is not printable, wouldn't it be better to show it in
>> escaped form rather than pretend it doesn't exist at all?
>
> Yeah I agree. I'd love to merge a patch that intrdouces
> utf8_escape_non_printable() or so, that works similar to
> utf8_escape_invalid(), but also escapes non-printable chars, and then
> make use of this here...
OK, but I'm confusing. We already have *cescape*. Is it not enough with
*cescape*?
>
> Just silently ignore the entry doesn't sound right, the absolute minimum
> should be to add a warning with log_warning()...
>
> Lennart
>
WaLyong
More information about the systemd-devel
mailing list