[systemd-devel] [PATCH] bootchart: only show printable processes
Lennart Poettering
lennart at poettering.net
Tue Aug 26 11:49:58 PDT 2014
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...
Just silently ignore the entry doesn't sound right, the absolute minimum
should be to add a warning with log_warning()...
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list