[systemd-devel] [PATCH] cgtop: Add cpu time opt and become stdout sensitive

Umut Tezduyar umut at tezduyar.com
Sun Apr 7 08:23:51 PDT 2013


Hi,

I also agree that it makes most sense to have it formatted by
format_timespan. I don't think we should have 2 different outputs (if on
tty). I think it will only be confusing. If no one gets to it before me, I
will have it replaced with format_timespan sometime in the close future :).

Thanks.


On Fri, Apr 5, 2013 at 5:58 PM, Zbigniew Jędrzejewski-Szmek <
zbyszek at in.waw.pl> wrote:

> On Fri, Apr 05, 2013 at 05:44:34PM +0200, Lennart Poettering wrote:
> > On Tue, 02.04.13 18:52, Umut Tezduyar (umut at tezduyar.com) wrote:
> >
> > > +                if (arg_cpu_type == CPU_PERCENT)
> > > +                        if (g->cpu_valid)
> > > +                                printf(" %6.1f", g->cpu_fraction*100);
> > > +                        else
> > > +                                fputs("      -", stdout);
> > >                  else
> > > -                        fputs("      -", stdout);
> > > +                        printf(" %*"PRIu64, maxtcpu, g->cpu_usage)
> >
> > I wonder if this is something where format_timespan() would be
> > useful?
> >
> > Or do you want to process this further and thus want a raw value? For
> > humans the result of format_timespan() should be a lot more useful
> > though...
> I think it should use format_timespan() when !on_tty(). It's mostly
> unusable now, apart from a slight comic effect:
>
> /                             1109 2070853593984205        -        -
>    -
> /user/zbyszek/9                747                0        -        -
>    -
>
> Zbyszek
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20130407/2f907ded/attachment.html>


More information about the systemd-devel mailing list