[systemd-devel] [PATCH v2] Bootchart: allow parse LABEL, UUID, PARTUUID for svg info

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Wed Oct 29 21:31:25 PDT 2014


On Wed, Oct 29, 2014 at 09:09:03PM +0300, Timofey Titovets wrote:
> 2014-10-29 16:20 GMT+03:00 Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>:
> > On Wed, Oct 29, 2014 at 04:16:22PM +0300, Timofey Titovets wrote:
> >> Why then developers use cmdline before?
> >> Maybe cmdline allow determine disk when bootchart working from or in initrd?
> > bootchart was merged into systemd after being developed in separate and
> > often does not follow the same conventions.
> >
> > Zbyszek
> 
> Hm.. okay.
> I did short search in systemd and can't find function to extract
> values from /proc/mounts
> It's needed to rework patch for use /proc/mounts and implement
> function to parse?
> I miss something?

/proc/self/mountinfo is probably better. Usually this is done through udev,
but since bootchart is supposed to run standalone, in this case parsing
using custom code is OK. And yes, I think that if you're fixing this code,
it is better to do it properly.

I seems that a simple sscanf() in a loop over the lines in /proc/self/mountinfo
until you hit one with "/" in the fifth field should suffice. This gives the
the major:minor info for free.

Zbyszek


More information about the systemd-devel mailing list