<div class="gmail_quote"><div><br class="Apple-interchange-newline">Thanks Patrick, this is exactly what I needed.<div><br></div><div>Lennert, Kay - this will make pretty graphs of the user session startup.</div><div><br></div>
<div>I've posted an example of the output here: <a href="http://foo-projects.org/~sofar/systemd-user-2.svg" target="_blank">http://foo-projects.org/~sofar/systemd-user-2.svg</a></div><div><br></div><div>Auke</div></div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br></div><div><div class="gmail_quote">On Thu, May 3, 2012 at 1:42 PM, Patrick McCarty <span dir="ltr"><<a href="mailto:patrick.mccarty@linux.intel.com" target="_blank">patrick.mccarty@linux.intel.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---<br>
src/analyze/systemd-analyze | 22 ++++++++++++++--------<br>
1 file changed, 14 insertions(+), 8 deletions(-)<br>
<br>
diff --git a/src/analyze/systemd-analyze b/src/analyze/systemd-analyze<br>
index a49fbb7..ad7bd9a 100755<br>
--- a/src/analyze/systemd-analyze<br>
+++ b/src/analyze/systemd-analyze<br>
@@ -69,9 +69,9 @@ def draw_text(context, x, y, text, size = 12, r = 0, g = 0, b = 0, vcenter = 0.5<br>
context.restore()<br>
<br>
def help():<br>
- sys.stdout.write("""systemd-analyze time<br>
-systemd-analyze blame<br>
-systemd-analyze plot<br>
+ sys.stdout.write("""systemd-analyze [--user] time<br>
+systemd-analyze [--user] blame<br>
+systemd-analyze [--user] plot<br>
<br>
Process systemd profiling information<br>
<br>
@@ -80,8 +80,14 @@ Process systemd profiling information<br>
<br>
<br>
bus = dbus.SystemBus()<br>
+command_index = 1<br>
<br>
-if len(sys.argv) <= 1 or sys.argv[1] == 'time':<br>
+if len(sys.argv) > 1 and sys.argv[1] == '--user':<br>
+ bus = dbus.SessionBus()<br>
+ command_index = 2<br>
+<br>
+<br>
+if len(sys.argv) <= command_index or sys.argv[command_index] == 'time':<br>
<br>
initrd_time, start_time, finish_time = acquire_start_time()<br>
<br>
@@ -98,7 +104,7 @@ if len(sys.argv) <= 1 or sys.argv[1] == 'time':<br>
finish_time/1000)<br>
<br>
<br>
-elif sys.argv[1] == 'blame':<br>
+elif sys.argv[command_index] == 'blame':<br>
<br>
data = acquire_time_data()<br>
s = sorted(data, key = lambda i: i[2] - i[1], reverse = True)<br>
@@ -113,7 +119,7 @@ elif sys.argv[1] == 'blame':<br>
<br>
sys.stdout.write("%6lums %s\n" % ((aet - ixt) / 1000, name))<br>
<br>
-elif sys.argv[1] == 'plot':<br>
+elif sys.argv[command_index] == 'plot':<br>
import cairo, os<br>
<br>
initrd_time, start_time, finish_time = acquire_start_time()<br>
@@ -269,8 +275,8 @@ elif sys.argv[1] == 'plot':<br>
finish_time/1000), hcenter = 0, vcenter = -1)<br>
<br>
surface.finish()<br>
-elif sys.argv[1] in ("help", "--help", "-h"):<br>
+elif sys.argv[command_index] in ("help", "--help", "-h"):<br>
help()<br>
else:<br>
- sys.stderr.write("Unknown verb '%s'.\n" % sys.argv[1])<br>
+ sys.stderr.write("Unknown verb '%s'.\n" % sys.argv[command_index])<br>
sys.exit(1)<span class="HOEnZb"><font color="#888888"><br>
<span><font color="#888888">--<br>
1.7.10<br>
<br>
_______________________________________________<br>
systemd-devel mailing list<br>
<a href="mailto:systemd-devel@lists.freedesktop.org" target="_blank">systemd-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/systemd-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/systemd-devel</a><br>
</font></span></font></span></blockquote></div><br></div>
</blockquote></div><br>