[systemd-devel] [PATCH 2/2] systemd-analyze: --type cpuacct option for blame

Umut Tezduyar umut at tezduyar.com
Tue Mar 26 04:14:15 PDT 2013

Hi Auke-jan,

I have learned the existence of systemd-cgtop hard way. Thanks for making
me aware of it. It makes a lot more sense to put cpuacct information to
systemd-cgtop. I have few concerns though.

systemd-cgtop updates itself every x interval and retrieving the unit list
from systemd and asking for ControlGroup names on each of the services
could be quite expensive. At least on my embedded system, I am afraid that
retrieving this information is slower than the default "x" interval of
systemd-cgtop. I am aware that frequency of systemd-cgtop can be changed
with a command parameter.

The who purpose of my patch was being able to parse out cpuacct information
and keeping it in a database. Parsing out "systemd-analyze blame" output
would be much more easier than parsing out "systemd-cgtop -N 1". Should we
also provide some kind of output format option to systemd-cgtop?

Also, I wanted to have some kind of PIE chart of cpuacct information (I got
inspired by systemd-analyze plot). Could this be a feature of systemd-cgtop?

You could say that I have very specific requirements and advice me to have
my own program to satisfy my own needs but any input is welcome.


On Mon, Mar 25, 2013 at 9:59 PM, Kok, Auke-jan H
<auke-jan.h.kok at intel.com>wrote:

> On Sun, Mar 24, 2013 at 11:23 AM, Umut Tezduyar <umut at tezduyar.com> wrote:
> > systemd-analyze blame --type cpuacct displays cpu time
> > usage information of the cgroup. The information displayed
> > is cpuacct.usage.
> >
> > ControlGroup=cpuacct:/foo/bar for a service would work.
> > ControlGroupPersistent=yes for a oneshot service keeps
> > cpuacct around so blame can retrieve it.
> > DefaultControllers=cpuacct on system.conf can be set
> > to have cpuacct same as systemd cgroup.
> > ---
> >  src/analyze/systemd-analyze.c |  131
> +++++++++++++++++++++++++++++++++++++----
> >  1 files changed, 119 insertions(+), 12 deletions(-)
> So, I'm not against this patch per se, but, I'm wondering if it's not
> better to display this data in systemd-cgtop.
> After all, systemd-analyze is a one-time snapshot and suffers from
> data loss when services are restarted, etc.
> Having a method to show cpuacct totals in systemd-cgtop seems much
> more useful. You could modify the code to show totals instead of
> percentages, etc.
> Have you thought about doing that?
> Auke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20130326/58d53927/attachment-0001.html>

More information about the systemd-devel mailing list