[Nix-dev] How to plug systemd-bootchart into kernel args?

Mateusz Czaplinski czapkofan at gmail.com
Wed Jul 13 14:52:20 CEST 2016


cool! :) and I know too well how it works with this getting carried
away stuff ;) by the way, wouldn't you by any chance fancy getting
carried away on some kind of udev events instrumentation/logging? ;P
Back to the matter - in the meantime, I've actually also advanced with
the stuff a bit, so I'll try to confront my solution with yours when I
get back home later today, and reply with my thoughts on the PR (or
send a competing PR ;P so that stuff can again grind to a halt in
discussions and bikeshedding, eh :/ )

Still, just a few quick notes now, replying to what you wrote above in
the email:
- as to the graph, I've found out that systemd-bootchart is kinda
broken in this regard; I've got a patch, I'll explain more in comments
to the PR, and also obviously will try to send it upstream. In short
words, the tool currently works correctly in this regard only if
CONFIG_SCHED_DEBUG=y too.
- as to the kernel option(s): in my personal opinion, I think it could
be OK if the flags were applied to the kernel *only* if bootchart was
enabled as NixOS *module*, i.e. xyz.systemd.bootchart.enable = true;
or something like that. IIUC, this would have to put burden of
recompiling the kernel (something like 1h+) on user (no Hydra
support), so I think there should probably be a big warning/note about
that in the module's/option's meta information?

Cheers! :)
/Mateusz.

On Wed, Jul 13, 2016 at 2:51 AM, Nikolay Amiantov <ab at fmap.me> wrote:
> I've looked into possibility of plugging this, got a little carried away
> and in the end implemented most of it [1]. I'm sorry, I don't generally
> like taking fun implementing things away from people (helping is better
> since it provokes learning)!
>
> However, this is not finished yet -- generated SVGs are suspicious
> because they contain no processes for me. It would be cool if you'd
> finish testing this because my motivation has worn off (initially I
> wanted to measure impact of different splash screen service
> configurations on boot times).
>
> However I'm happy to help, please ask questions regarding this code in
> the PR! I've tried to make it as straightforward as possible.
>
> Note that this requires a controversial change in our standard kernel
> config, which means both you'd need to recompile your kernel and we'd
> need to get a green light from people responsible for kernel config
> decisions to get it mainlined.
>
> 1: https://github.com/NixOS/nixpkgs/pull/16902
>
> On 07/12/2016 07:09 PM, Mateusz Czaplinski wrote:
>> I'm mostly interested in analyzing what happens during systemd. I seem
>> to understand systemd-bootchart should provide somewhat more detailed
>> analysis of what's going on - e.g. like in
>> https://wiki.apertis.org/Docs/System_startup#systemd-bootchart. I find
>> the basic "systemd-analyze plot" somewhat too opaque for the noob I
>> am... to tell the truth, I'd love to collect as much information as
>> possible from wherever possible. E.g. some udev-related stuff looks
>> highly suspicious in my plot (I have long red bar for my disk); but I
>> couldn't find yet if/how it is possible to log the timing of udev
>> events during boot... So, was hoping bootchart could maybe help me at
>> least in some way...?
>>
>> I'd be very grateful for any hints on how to plug systemd-bootstrap at
>> any stage/point up to systemd start. I'm OK with patching nixpkgs (and
>> `nixos-rebuild -I nixpkgs=~/nixpkgs switch`); anything is ok, though
>> I'd sure be extra grateful for "style/approach" guidance which could
>> result in a pull request that could be useful/make life easier for
>> future users.
>>
>> /Mateusz.
>
> --
> Nikolay.


More information about the nix-dev mailing list