Systemd-analyze log

Does the information given in a systemd-analyze report get stored in a log?

From my observations, Ubuntu on my HP Pavilion starts considerably slower when on mains power than it does when on battery. A log might prove this.

You can use the command systemd-analyze blame to get a readout of what takes the longest to load on boot. That should tell you what is taking the most time. I’m not aware of any log that is kept that will tell you this info. But you can try this command also journalctl -bThat will give you the last systemd boot log But not sure it will be of help to you. good luck.

AIUI a primary function of systemd-analyze is reading and interpreting the contents of the journal, so there’s really no need for a log because it’s not creating the data, it’s interpreting what’s already logged. The log already exists with or without the analysis, not the other way around.

There may well be additional data it reads directly from running units, though, stuff that’s transient and doesn’t make it to the journal by default. If you wanted a log of that stuff, your best bet would probably be to write a service unit that will run systemd-analyze after each boot (once some fixed delay time has passed, to let the data accumulate), and direct that unit’s output into the journal.

2 Likes

Actually the output of systemd-analyze dump looks pretty promising as the sort of stuff you’d want to log, if you’re looking to create an archive of boot-profiling data to mine for patterns.

(Edit: Can I also just say, systemd-analyze has the weirdest kitchen-sink collection of features chucked into it.

  • systemd-analyze blame | dot | plot | critical-chain perform boot profiling.
  • systemd-analyze verify is used to discover issues with unit files.
  • systemd-analyze cat-config just… displays the contents of config files. #ForSomeReason.
  • systemd-analyze timestamp|timespan|calendar convert between human-readable and ISO-8601 time strings and generate timestamps for events that have a repeating schedule based on calendar events.
  • (Edit2: I had to add one more…)
    systemd-analyze security displays alarmist reports of service “exposure” that rate 90% of the units on my system at an 8+/10 on its own made-up badness scale, with only about half of its own units and one or two others rating “OK”. (Which appears to mean below 5, 4, or 3… I don’t have any units that fall between 2.9 and 5.9 so I can’t tell where the cutoff is.)

There’s even more, but an exhaustive list exceeds my interest level. It’s frickin’ bizarre, though.)

1 Like