diff options
| author | Koen Kooi <koen@dominion.thruhere.net> | 2011-09-22 16:46:47 +0200 |
|---|---|---|
| committer | Koen Kooi <koen@dominion.thruhere.net> | 2011-09-22 17:16:28 +0200 |
| commit | 54ab502d4f53cab9411c29bb04dab7ae81b002ed (patch) | |
| tree | 1b7b875f6ce7ade9012d50999c209acb708f763a | |
| parent | 8005a575076a765aa1e1fc7b10cea954ec974009 (diff) | |
| download | meta-openembedded-54ab502d4f53cab9411c29bb04dab7ae81b002ed.tar.gz | |
systemd: add kernel time and summary into svg plot
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
4 files changed, 179 insertions, 1 deletions
diff --git a/meta-oe/recipes-core/systemd/systemd/0001-analyze-always-draw-1s-marker-for-scale.patch b/meta-oe/recipes-core/systemd/systemd/0001-analyze-always-draw-1s-marker-for-scale.patch new file mode 100644 index 0000000000..6097893b15 --- /dev/null +++ b/meta-oe/recipes-core/systemd/systemd/0001-analyze-always-draw-1s-marker-for-scale.patch | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | From 0797320a7a8d6a8bd899a4149322486db7f5baa2 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Koen Kooi <koen@dominion.thruhere.net> | ||
| 3 | Date: Thu, 22 Sep 2011 11:27:13 +0200 | ||
| 4 | Subject: [PATCH 1/3] analyze: always draw 1s marker for scale | ||
| 5 | |||
| 6 | In situations like this: | ||
| 7 | |||
| 8 | root@omap4430-panda:~# systemd-analyze | ||
| 9 | Startup finished in 1499ms (kernel) + 916ms (userspace) = 2416ms | ||
| 10 | |||
| 11 | The svg plot will only have the 0s marker and no subsequent markers for scale. This patch forces the 1s marker to always be drawn. | ||
| 12 | |||
| 13 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
| 14 | --- | ||
| 15 | src/systemd-analyze | 4 ++-- | ||
| 16 | 1 files changed, 2 insertions(+), 2 deletions(-) | ||
| 17 | |||
| 18 | diff --git a/src/systemd-analyze b/src/systemd-analyze | ||
| 19 | index ae7dcfb..649d0e1 100755 | ||
| 20 | --- a/src/systemd-analyze | ||
| 21 | +++ b/src/systemd-analyze | ||
| 22 | @@ -147,7 +147,7 @@ elif sys.argv[1] == 'plot': | ||
| 23 | context.set_line_width(1) | ||
| 24 | context.set_source_rgb(0.7, 0.7, 0.7) | ||
| 25 | |||
| 26 | - for x in range(0, (finish_time - start_time)/10000, 100): | ||
| 27 | + for x in range(0, max((finish_time - start_time)/10000,110), 100): | ||
| 28 | context.move_to(x, 0) | ||
| 29 | context.line_to(x, height-border*2) | ||
| 30 | |||
| 31 | @@ -163,7 +163,7 @@ elif sys.argv[1] == 'plot': | ||
| 32 | banner = "Running on %s (%s %s) %s" % (os.uname()[1], os.uname()[2], os.uname()[3], os.uname()[4]) | ||
| 33 | draw_text(context, 0, -15, banner, hcenter = 0, vcenter = 1) | ||
| 34 | |||
| 35 | - for x in range(0, (finish_time - start_time)/10000, 100): | ||
| 36 | + for x in range(0, max((finish_time - start_time)/10000,110), 100): | ||
| 37 | draw_text(context, x, -5, "%lus" % (x/100), vcenter = 0, hcenter = 0) | ||
| 38 | |||
| 39 | y = 0 | ||
| 40 | -- | ||
| 41 | 1.6.6.1 | ||
| 42 | |||
diff --git a/meta-oe/recipes-core/systemd/systemd/0002-analyze-report-startup-time-in-plot-mode-as-well.patch b/meta-oe/recipes-core/systemd/systemd/0002-analyze-report-startup-time-in-plot-mode-as-well.patch new file mode 100644 index 0000000000..67b7b776dc --- /dev/null +++ b/meta-oe/recipes-core/systemd/systemd/0002-analyze-report-startup-time-in-plot-mode-as-well.patch | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | From 88b284f5c079536f5151c3f1dcfc0e692ef26da6 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Koen Kooi <koen@dominion.thruhere.net> | ||
| 3 | Date: Thu, 22 Sep 2011 14:55:17 +0200 | ||
| 4 | Subject: [PATCH 2/3] analyze: report startup time in plot mode as well | ||
| 5 | |||
| 6 | It now prints something like "Startup finished in 1507ms (kernel) + 850ms (userspace) = 2357ms" below the legend. | ||
| 7 | |||
| 8 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
| 9 | --- | ||
| 10 | src/systemd-analyze | 12 ++++++++++++ | ||
| 11 | 1 files changed, 12 insertions(+), 0 deletions(-) | ||
| 12 | |||
| 13 | diff --git a/src/systemd-analyze b/src/systemd-analyze | ||
| 14 | index 649d0e1..d0db984 100755 | ||
| 15 | --- a/src/systemd-analyze | ||
| 16 | +++ b/src/systemd-analyze | ||
| 17 | @@ -221,6 +221,18 @@ elif sys.argv[1] == 'plot': | ||
| 18 | |||
| 19 | draw_text(context, 0, height-border*2, "Legend: Red = Activating; Pink = Active; Dark Pink = Deactivating", hcenter = 0, vcenter = -1) | ||
| 20 | |||
| 21 | + if initrd_time > 0: | ||
| 22 | + draw_text(context, 0, height-border*2 + bar_height, "Startup finished in %lums (kernel) + %lums (initrd) + %lums (userspace) = %lums" % ( \ | ||
| 23 | + initrd_time/1000, \ | ||
| 24 | + (start_time - initrd_time)/1000, \ | ||
| 25 | + (finish_time - start_time)/1000, \ | ||
| 26 | + finish_time/1000), hcenter = 0, vcenter = -1) | ||
| 27 | + else: | ||
| 28 | + draw_text(context, 0, height-border*2 + bar_height, "Startup finished in %lums (kernel) + %lums (userspace) = %lums" % ( \ | ||
| 29 | + start_time/1000, \ | ||
| 30 | + (finish_time - start_time)/1000, \ | ||
| 31 | + finish_time/1000), hcenter = 0, vcenter = -1) | ||
| 32 | + | ||
| 33 | surface.finish() | ||
| 34 | elif sys.argv[1] in ("help", "--help", "-h"): | ||
| 35 | help() | ||
| 36 | -- | ||
| 37 | 1.6.6.1 | ||
| 38 | |||
diff --git a/meta-oe/recipes-core/systemd/systemd/0003-analyze-draw-kernel-boot-time-as-well.patch b/meta-oe/recipes-core/systemd/systemd/0003-analyze-draw-kernel-boot-time-as-well.patch new file mode 100644 index 0000000000..670800d087 --- /dev/null +++ b/meta-oe/recipes-core/systemd/systemd/0003-analyze-draw-kernel-boot-time-as-well.patch | |||
| @@ -0,0 +1,95 @@ | |||
| 1 | From 3dd45de5dffb30f3b32490736eb56024a79f51c4 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Koen Kooi <koen@dominion.thruhere.net> | ||
| 3 | Date: Thu, 22 Sep 2011 15:24:32 +0200 | ||
| 4 | Subject: [PATCH 3/3] analyze: draw kernel boot time as well | ||
| 5 | |||
| 6 | Sample output: http://dominion.thruhere.net/koen/angstrom/systemd/omap4430-panda-201109221422.svg | ||
| 7 | |||
| 8 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
| 9 | --- | ||
| 10 | |||
| 11 | This is just a start to see if something like this is acceptable, feedback welcome! | ||
| 12 | |||
| 13 | src/systemd-analyze | 20 +++++++++++++------- | ||
| 14 | 1 files changed, 13 insertions(+), 7 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/src/systemd-analyze b/src/systemd-analyze | ||
| 17 | index d0db984..480f7aa 100755 | ||
| 18 | --- a/src/systemd-analyze | ||
| 19 | +++ b/src/systemd-analyze | ||
| 20 | @@ -116,7 +116,8 @@ elif sys.argv[1] == 'plot': | ||
| 21 | data = acquire_time_data() | ||
| 22 | s = sorted(data, key = lambda i: i[1]) | ||
| 23 | |||
| 24 | - count = 0 | ||
| 25 | + # start at one to account for the kernel bar | ||
| 26 | + count = 1 | ||
| 27 | |||
| 28 | for name, ixt, aet, axt, iet in s: | ||
| 29 | |||
| 30 | @@ -130,7 +131,7 @@ elif sys.argv[1] == 'plot': | ||
| 31 | bar_space = bar_height * 0.1 | ||
| 32 | |||
| 33 | # 1000px = 10s, 1px = 10ms | ||
| 34 | - width = (finish_time - start_time)/10000 + border*2 | ||
| 35 | + width = (finish_time)/10000 + border*2 | ||
| 36 | height = count * (bar_height + bar_space) + border * 2 | ||
| 37 | |||
| 38 | if width < 1000: | ||
| 39 | @@ -147,7 +148,7 @@ elif sys.argv[1] == 'plot': | ||
| 40 | context.set_line_width(1) | ||
| 41 | context.set_source_rgb(0.7, 0.7, 0.7) | ||
| 42 | |||
| 43 | - for x in range(0, max((finish_time - start_time)/10000,110), 100): | ||
| 44 | + for x in range(0, max((finish_time)/10000,110), 100): | ||
| 45 | context.move_to(x, 0) | ||
| 46 | context.line_to(x, height-border*2) | ||
| 47 | |||
| 48 | @@ -163,11 +164,16 @@ elif sys.argv[1] == 'plot': | ||
| 49 | banner = "Running on %s (%s %s) %s" % (os.uname()[1], os.uname()[2], os.uname()[3], os.uname()[4]) | ||
| 50 | draw_text(context, 0, -15, banner, hcenter = 0, vcenter = 1) | ||
| 51 | |||
| 52 | - for x in range(0, max((finish_time - start_time)/10000,110), 100): | ||
| 53 | + for x in range(0, max((finish_time)/10000,110), 100): | ||
| 54 | draw_text(context, x, -5, "%lus" % (x/100), vcenter = 0, hcenter = 0) | ||
| 55 | |||
| 56 | y = 0 | ||
| 57 | |||
| 58 | + # draw box for kernel boot time | ||
| 59 | + draw_box(context, 0, y, start_time/10000, bar_height, 0.8, 0.6, 0.6) | ||
| 60 | + draw_text(context, 10, y + bar_height/2, "kernel", hcenter = 0) | ||
| 61 | + y += bar_height + bar_space | ||
| 62 | + | ||
| 63 | for name, ixt, aet, axt, iet in s: | ||
| 64 | |||
| 65 | drawn = False | ||
| 66 | @@ -176,7 +182,7 @@ elif sys.argv[1] == 'plot': | ||
| 67 | if ixt >= start_time and ixt <= finish_time: | ||
| 68 | |||
| 69 | # Activating | ||
| 70 | - a = ixt - start_time | ||
| 71 | + a = ixt | ||
| 72 | b = min(filter(lambda x: x >= ixt, (aet, axt, iet, finish_time))) - ixt | ||
| 73 | |||
| 74 | draw_box(context, a/10000, y, b/10000, bar_height, 1, 0, 0) | ||
| 75 | @@ -188,7 +194,7 @@ elif sys.argv[1] == 'plot': | ||
| 76 | if aet >= start_time and aet <= finish_time: | ||
| 77 | |||
| 78 | # Active | ||
| 79 | - a = aet - start_time | ||
| 80 | + a = aet | ||
| 81 | b = min(filter(lambda x: x >= aet, (axt, iet, finish_time))) - aet | ||
| 82 | |||
| 83 | draw_box(context, a/10000, y, b/10000, bar_height, .8, .6, .6) | ||
| 84 | @@ -200,7 +206,7 @@ elif sys.argv[1] == 'plot': | ||
| 85 | if axt >= start_time and axt <= finish_time: | ||
| 86 | |||
| 87 | # Deactivating | ||
| 88 | - a = axt - start_time | ||
| 89 | + a = axt | ||
| 90 | b = min(filter(lambda x: x >= axt, (iet, finish_time))) - axt | ||
| 91 | |||
| 92 | draw_box(context, a/10000, y, b/10000, bar_height, .6, .4, .4) | ||
| 93 | -- | ||
| 94 | 1.6.6.1 | ||
| 95 | |||
diff --git a/meta-oe/recipes-core/systemd/systemd_git.bb b/meta-oe/recipes-core/systemd/systemd_git.bb index 7312fe1532..fd20a687fe 100644 --- a/meta-oe/recipes-core/systemd/systemd_git.bb +++ b/meta-oe/recipes-core/systemd/systemd_git.bb | |||
| @@ -14,13 +14,16 @@ inherit gitpkgv | |||
| 14 | PKGV = "v${GITPKGVTAG}" | 14 | PKGV = "v${GITPKGVTAG}" |
| 15 | 15 | ||
| 16 | PV = "git" | 16 | PV = "git" |
| 17 | PR = "r1" | 17 | PR = "r3" |
| 18 | 18 | ||
| 19 | inherit autotools vala perlnative | 19 | inherit autotools vala perlnative |
| 20 | 20 | ||
| 21 | SRCREV = "a2f5666d06fe8233025738047115bb9e3959df3e" | 21 | SRCREV = "a2f5666d06fe8233025738047115bb9e3959df3e" |
| 22 | 22 | ||
| 23 | SRC_URI = "git://anongit.freedesktop.org/systemd;protocol=git \ | 23 | SRC_URI = "git://anongit.freedesktop.org/systemd;protocol=git \ |
| 24 | file://0001-analyze-always-draw-1s-marker-for-scale.patch \ | ||
| 25 | file://0002-analyze-report-startup-time-in-plot-mode-as-well.patch \ | ||
| 26 | file://0003-analyze-draw-kernel-boot-time-as-well.patch \ | ||
| 24 | ${UCLIBCPATCHES} \ | 27 | ${UCLIBCPATCHES} \ |
| 25 | " | 28 | " |
| 26 | UCLIBCPATCHES = "" | 29 | UCLIBCPATCHES = "" |
