Analysing boot time

matthew stanger stangerm2 at gmail.com
Thu Feb 14 16:59:00 UTC 2019


>
> But how does systemd measure the "boot time" of each? Is it only the
> time needed by the daemon to be exposed in DBus? Or what?

For 'Type=dbus' services, which most of the distro's use in MM's service
file. Systemd will consider the unit started immediately after the main
service process has been forked off and the service has acquired a name on
the D-Bus bus, as configured by 'BusName='.

Martin I'd highly recommend using the new udev whitelist feature, in newer
MM versions. Since you mention you're embedded & almost surely know the
expected modem which will be used with your device. In practice, it will
save some very real boot time on your device, though as mentioned above
depending on where dbus bus acquisition is in MM startup (I'm not sure
where exactly it occurs in the code code) the 'systemd-analyze' may mislead
you that it hasn't booted faster. You will surely see a faster time from
boot to connection though. Here's an example:

[Service]
Type=dbus
BusName=org.freedesktop.ModemManager1
ExecStart=/usr/sbin/ModemManager --filter-policy=WHITELIST-ONLY

cat /lib/udev/rules.d/78-mm-whitelist-internal-modem.rules
ACTION!="add|change|move", GOTO="mm_whitelist_internal_modem_end"
        ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0061",
ENV{ID_MM_DEVICE_PROCESS}="1"
        LABEL="mm_whitelist_internal_modem_end"



On Thu, Feb 14, 2019 at 9:21 AM Aleksander Morgado <aleksander at aleksander.es>
wrote:

> > > on my embedded system, "systemd-analyze blame" says:
> > >
> > >           15.254s ModemManager.service
> > >           10.562s NetworkManager.service
> > >                   ...
> > >
> > > I.e. MM and NM are the two slowest services in terms of start time.
> > > Is there anything I can do about it or try to find out, why they
> > > take so much time?
> >
> > Which versions of both?  MM is likely the probing delay, and recent
> > versions of MM have stricter rules on what gets probed and what
> > doesn't, which could cut down its startup time.
> >
>
> But how does systemd measure the "boot time" of each? Is it only the
> time needed by the daemon to be exposed in DBus? Or what?
>
> --
> Aleksander
> https://aleksander.es
> _______________________________________________
> ModemManager-devel mailing list
> ModemManager-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/modemmanager-devel/attachments/20190214/dde6c369/attachment.html>


More information about the ModemManager-devel mailing list