[oe-commits] Koen Kooi : systemd: add kernel time and summary into svg plot

git version control git at git.openembedded.org
Fri Sep 23 05:46:12 UTC 2011


Module: meta-openembedded.git
Branch: master
Commit: 54ab502d4f53cab9411c29bb04dab7ae81b002ed
URL:    http://git.openembedded.org/?p=meta-openembedded.git&a=commit;h=54ab502d4f53cab9411c29bb04dab7ae81b002ed

Author: Koen Kooi <koen at dominion.thruhere.net>
Date:   Thu Sep 22 16:46:47 2011 +0200

systemd: add kernel time and summary into svg plot

Signed-off-by: Koen Kooi <koen at dominion.thruhere.net>

---

 ...1-analyze-always-draw-1s-marker-for-scale.patch |   42 +++++++++
 ...-report-startup-time-in-plot-mode-as-well.patch |   38 ++++++++
 ...003-analyze-draw-kernel-boot-time-as-well.patch |   95 ++++++++++++++++++++
 meta-oe/recipes-core/systemd/systemd_git.bb        |    5 +-
 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 0000000..6097893
--- /dev/null
+++ b/meta-oe/recipes-core/systemd/systemd/0001-analyze-always-draw-1s-marker-for-scale.patch
@@ -0,0 +1,42 @@
+From 0797320a7a8d6a8bd899a4149322486db7f5baa2 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen at dominion.thruhere.net>
+Date: Thu, 22 Sep 2011 11:27:13 +0200
+Subject: [PATCH 1/3] analyze: always draw 1s marker for scale
+
+In situations like this:
+
+root at omap4430-panda:~# systemd-analyze
+Startup finished in 1499ms (kernel) + 916ms (userspace) = 2416ms
+
+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.
+
+Signed-off-by: Koen Kooi <koen at dominion.thruhere.net>
+---
+ src/systemd-analyze |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/systemd-analyze b/src/systemd-analyze
+index ae7dcfb..649d0e1 100755
+--- a/src/systemd-analyze
++++ b/src/systemd-analyze
+@@ -147,7 +147,7 @@ elif sys.argv[1] == 'plot':
+         context.set_line_width(1)
+         context.set_source_rgb(0.7, 0.7, 0.7)
+ 
+-        for x in range(0, (finish_time - start_time)/10000, 100):
++        for x in range(0, max((finish_time - start_time)/10000,110), 100):
+                 context.move_to(x, 0)
+                 context.line_to(x, height-border*2)
+ 
+@@ -163,7 +163,7 @@ elif sys.argv[1] == 'plot':
+         banner = "Running on %s (%s %s) %s" % (os.uname()[1], os.uname()[2], os.uname()[3], os.uname()[4])
+         draw_text(context, 0, -15, banner, hcenter = 0, vcenter = 1)
+ 
+-        for x in range(0, (finish_time - start_time)/10000, 100):
++        for x in range(0, max((finish_time - start_time)/10000,110), 100):
+                 draw_text(context, x, -5, "%lus" % (x/100), vcenter = 0, hcenter = 0)
+ 
+         y = 0
+-- 
+1.6.6.1
+
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 0000000..67b7b77
--- /dev/null
+++ b/meta-oe/recipes-core/systemd/systemd/0002-analyze-report-startup-time-in-plot-mode-as-well.patch
@@ -0,0 +1,38 @@
+From 88b284f5c079536f5151c3f1dcfc0e692ef26da6 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen at dominion.thruhere.net>
+Date: Thu, 22 Sep 2011 14:55:17 +0200
+Subject: [PATCH 2/3] analyze: report startup time in plot mode as well
+
+It now prints something like "Startup finished in 1507ms (kernel) + 850ms (userspace) = 2357ms" below the legend.
+
+Signed-off-by: Koen Kooi <koen at dominion.thruhere.net>
+---
+ src/systemd-analyze |   12 ++++++++++++
+ 1 files changed, 12 insertions(+), 0 deletions(-)
+
+diff --git a/src/systemd-analyze b/src/systemd-analyze
+index 649d0e1..d0db984 100755
+--- a/src/systemd-analyze
++++ b/src/systemd-analyze
+@@ -221,6 +221,18 @@ elif sys.argv[1] == 'plot':
+ 
+         draw_text(context, 0, height-border*2, "Legend: Red = Activating; Pink = Active; Dark Pink = Deactivating", hcenter = 0, vcenter = -1)
+ 
++        if initrd_time > 0:                                                                                  
++                draw_text(context, 0, height-border*2 + bar_height, "Startup finished in %lums (kernel) + %lums (initrd) + %lums (userspace) = %lums" % ( \
++                        initrd_time/1000, \
++                        (start_time - initrd_time)/1000, \
++                        (finish_time - start_time)/1000, \
++                        finish_time/1000), hcenter = 0, vcenter = -1)
++        else:                                                                                                                                  
++                draw_text(context, 0, height-border*2 + bar_height, "Startup finished in %lums (kernel) + %lums (userspace) = %lums" % ( \
++                        start_time/1000, \
++                        (finish_time - start_time)/1000, \
++                        finish_time/1000), hcenter = 0, vcenter = -1)
++	
+         surface.finish()
+ elif sys.argv[1] in ("help", "--help", "-h"):
+         help()
+-- 
+1.6.6.1
+
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 0000000..670800d
--- /dev/null
+++ b/meta-oe/recipes-core/systemd/systemd/0003-analyze-draw-kernel-boot-time-as-well.patch
@@ -0,0 +1,95 @@
+From 3dd45de5dffb30f3b32490736eb56024a79f51c4 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen at dominion.thruhere.net>
+Date: Thu, 22 Sep 2011 15:24:32 +0200
+Subject: [PATCH 3/3] analyze: draw kernel boot time as well
+
+Sample output: http://dominion.thruhere.net/koen/angstrom/systemd/omap4430-panda-201109221422.svg
+
+Signed-off-by: Koen Kooi <koen at dominion.thruhere.net>
+---
+
+This is just a start to see if something like this is acceptable, feedback welcome!
+
+ src/systemd-analyze |   20 +++++++++++++-------
+ 1 files changed, 13 insertions(+), 7 deletions(-)
+
+diff --git a/src/systemd-analyze b/src/systemd-analyze
+index d0db984..480f7aa 100755
+--- a/src/systemd-analyze
++++ b/src/systemd-analyze
+@@ -116,7 +116,8 @@ elif sys.argv[1] == 'plot':
+         data = acquire_time_data()
+         s = sorted(data, key = lambda i: i[1])
+ 
+-        count = 0
++        # start at one to account for the kernel bar
++        count = 1
+ 
+         for name, ixt, aet, axt, iet in s:
+ 
+@@ -130,7 +131,7 @@ elif sys.argv[1] == 'plot':
+         bar_space = bar_height * 0.1
+ 
+         # 1000px = 10s, 1px = 10ms
+-        width = (finish_time - start_time)/10000 + border*2
++        width = (finish_time)/10000 + border*2
+         height = count * (bar_height + bar_space) + border * 2
+ 
+         if width < 1000:
+@@ -147,7 +148,7 @@ elif sys.argv[1] == 'plot':
+         context.set_line_width(1)
+         context.set_source_rgb(0.7, 0.7, 0.7)
+ 
+-        for x in range(0, max((finish_time - start_time)/10000,110), 100):
++        for x in range(0, max((finish_time)/10000,110), 100):
+                 context.move_to(x, 0)
+                 context.line_to(x, height-border*2)
+ 
+@@ -163,11 +164,16 @@ elif sys.argv[1] == 'plot':
+         banner = "Running on %s (%s %s) %s" % (os.uname()[1], os.uname()[2], os.uname()[3], os.uname()[4])
+         draw_text(context, 0, -15, banner, hcenter = 0, vcenter = 1)
+ 
+-        for x in range(0, max((finish_time - start_time)/10000,110), 100):
++        for x in range(0, max((finish_time)/10000,110), 100):
+                 draw_text(context, x, -5, "%lus" % (x/100), vcenter = 0, hcenter = 0)
+ 
+         y = 0
+ 
++        # draw box for kernel boot time
++        draw_box(context, 0, y, start_time/10000, bar_height, 0.8, 0.6, 0.6)
++        draw_text(context, 10, y + bar_height/2, "kernel", hcenter = 0)
++        y += bar_height + bar_space
++	
+         for name, ixt, aet, axt, iet in s:
+ 
+                 drawn = False
+@@ -176,7 +182,7 @@ elif sys.argv[1] == 'plot':
+                 if ixt >= start_time and ixt <= finish_time:
+ 
+                         # Activating
+-                        a = ixt - start_time
++                        a = ixt
+                         b = min(filter(lambda x: x >= ixt, (aet, axt, iet, finish_time))) - ixt
+ 
+                         draw_box(context, a/10000, y, b/10000, bar_height, 1, 0, 0)
+@@ -188,7 +194,7 @@ elif sys.argv[1] == 'plot':
+                 if aet >= start_time and aet <= finish_time:
+ 
+                         # Active
+-                        a = aet - start_time
++                        a = aet
+                         b = min(filter(lambda x: x >= aet, (axt, iet, finish_time))) - aet
+ 
+                         draw_box(context, a/10000, y, b/10000, bar_height, .8, .6, .6)
+@@ -200,7 +206,7 @@ elif sys.argv[1] == 'plot':
+                 if axt >= start_time and axt <= finish_time:
+ 
+                         # Deactivating
+-                        a = axt - start_time
++                        a = axt
+                         b = min(filter(lambda x: x >= axt, (iet, finish_time))) - axt
+ 
+                         draw_box(context, a/10000, y, b/10000, bar_height, .6, .4, .4)
+-- 
+1.6.6.1
+
diff --git a/meta-oe/recipes-core/systemd/systemd_git.bb b/meta-oe/recipes-core/systemd/systemd_git.bb
index 7312fe1..fd20a68 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
 PKGV = "v${GITPKGVTAG}"
 
 PV = "git"
-PR = "r1"
+PR = "r3"
 
 inherit autotools vala perlnative
 
 SRCREV = "a2f5666d06fe8233025738047115bb9e3959df3e"
 
 SRC_URI = "git://anongit.freedesktop.org/systemd;protocol=git \
+           file://0001-analyze-always-draw-1s-marker-for-scale.patch \
+           file://0002-analyze-report-startup-time-in-plot-mode-as-well.patch \
+           file://0003-analyze-draw-kernel-boot-time-as-well.patch \
            ${UCLIBCPATCHES} \
           "
 UCLIBCPATCHES = ""





More information about the Openembedded-commits mailing list