X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fanalyze%2Fsystemd-analyze.c;h=6d97256c73977c4ab9e328b440f8c3f1ae8c9670;hp=df3d3072403e1c21f9296b5ffbd081d5db48fac6;hb=d9acfb71dbfb6e916b9752593158698b8021b28c;hpb=518d10e98508ec8181e864924484a2ca994c5d43 diff --git a/src/analyze/systemd-analyze.c b/src/analyze/systemd-analyze.c index df3d30724..6d97256c7 100644 --- a/src/analyze/systemd-analyze.c +++ b/src/analyze/systemd-analyze.c @@ -80,6 +80,8 @@ struct boot_times { usec_t finish_time; usec_t generators_start_time; usec_t generators_finish_time; + usec_t unitsload_start_time; + usec_t unitsload_finish_time; }; struct unit_times { char *name; @@ -315,7 +317,17 @@ static int acquire_boot_times(DBusConnection *bus, struct boot_times **bt) { "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager", "GeneratorsFinishTimestampMonotonic", - ×.generators_finish_time) < 0) + ×.generators_finish_time) < 0 || + bus_get_uint64_property(bus, + "/org/freedesktop/systemd1", + "org.freedesktop.systemd1.Manager", + "UnitsLoadStartTimestampMonotonic", + ×.unitsload_start_time) < 0 || + bus_get_uint64_property(bus, + "/org/freedesktop/systemd1", + "org.freedesktop.systemd1.Manager", + "UnitsLoadFinishTimestampMonotonic", + ×.unitsload_finish_time) < 0) return -EIO; if (times.finish_time <= 0) { @@ -472,7 +484,7 @@ static int analyze_plot(DBusConnection *bus) { svg("\n\n", 80.0 + width, 150.0 + (m * SCALE_Y) + - 4 * SCALE_Y /* legend */); + 5 * SCALE_Y /* legend */); /* write some basic info as a comment, including some help */ svg("\n" @@ -494,6 +506,7 @@ static int analyze_plot(DBusConnection *bus) { " rect.loader { fill: rgb(150,150,150); fill-opacity: 0.7; }\n" " rect.userspace { fill: rgb(150,150,150); fill-opacity: 0.7; }\n" " rect.generators { fill: rgb(102,204,255); fill-opacity: 0.7; }\n" + " rect.unitsload { fill: rgb( 82,184,255); fill-opacity: 0.7; }\n" " rect.box { fill: rgb(240,240,240); stroke: rgb(192,192,192); }\n" " line { stroke: rgb(64,64,64); stroke-width: 1; }\n" "// line.sec1 { }\n" @@ -535,6 +548,7 @@ static int analyze_plot(DBusConnection *bus) { } svg_bar("active", boot->userspace_time, boot->finish_time, y); svg_bar("generators", boot->generators_start_time, boot->generators_finish_time, y); + svg_bar("unitsload", boot->unitsload_start_time, boot->unitsload_finish_time, y); svg_text("left", boot->userspace_time, y, "systemd"); y++; @@ -572,6 +586,9 @@ static int analyze_plot(DBusConnection *bus) { svg_bar("generators", 0, 300000, y); svg_text("right", 400000, y, "Generators"); y++; + svg_bar("unitsload", 0, 300000, y); + svg_text("right", 400000, y, "Loading unit files"); + y++; svg("\n\n");