Bug 60112 - systemd-analyze: rewrite in C
Summary: systemd-analyze: rewrite in C
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-31 10:10 UTC by Marc-Antoine Perennou
Modified: 2013-02-13 23:06 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
move struct unit_info from systemctl to dbus-common (1.97 KB, patch)
2013-01-31 10:11 UTC, Marc-Antoine Perennou
Details | Splinter Review
introduce bus_parse_unit_info in dbus-common (2.55 KB, patch)
2013-01-31 10:11 UTC, Marc-Antoine Perennou
Details | Splinter Review
use bus_parse_unit_info in systemctl (6.08 KB, patch)
2013-01-31 10:12 UTC, Marc-Antoine Perennou
Details | Splinter Review
rewrite systemd-analyze in C (39.51 KB, patch)
2013-01-31 10:12 UTC, Marc-Antoine Perennou
Details | Splinter Review
move systemctl dot to systemd-analyze (33.26 KB, patch)
2013-01-31 10:13 UTC, Marc-Antoine Perennou
Details | Splinter Review
move systemctl dot to systemd-analyze (33.26 KB, patch)
2013-01-31 10:21 UTC, Marc-Antoine Perennou
Details | Splinter Review
systemd-analyze: rewrite in C. Merged approach. (39.04 KB, patch)
2013-02-06 14:53 UTC, Simon Peeters
Details | Splinter Review
move systemctl dot to systemd-analyze depgraph (30.66 KB, patch)
2013-02-07 01:48 UTC, Simon Peeters
Details | Splinter Review

Description Marc-Antoine Perennou 2013-01-31 10:10:33 UTC
Currently, systemd-analyze is written in python.
This is a complete rewrite of it in C, allowing us to move systemctl dot in it.
A new configure switch has been added to disable it since it requires cairo.
Comment 1 Marc-Antoine Perennou 2013-01-31 10:11:28 UTC
Created attachment 73980 [details] [review]
move struct unit_info from systemctl to dbus-common
Comment 2 Marc-Antoine Perennou 2013-01-31 10:11:59 UTC
Created attachment 73981 [details] [review]
introduce bus_parse_unit_info in dbus-common
Comment 3 Marc-Antoine Perennou 2013-01-31 10:12:25 UTC
Created attachment 73982 [details] [review]
use bus_parse_unit_info in systemctl
Comment 4 Marc-Antoine Perennou 2013-01-31 10:12:46 UTC
Created attachment 73983 [details] [review]
rewrite systemd-analyze in C
Comment 5 Marc-Antoine Perennou 2013-01-31 10:13:12 UTC
Created attachment 73984 [details] [review]
move systemctl dot to systemd-analyze
Comment 6 Marc-Antoine Perennou 2013-01-31 10:21:23 UTC
Created attachment 73985 [details] [review]
move systemctl dot to systemd-analyze
Comment 7 Lennart Poettering 2013-02-04 21:12:20 UTC
Hmm, how does this relate to this work:

http://lists.freedesktop.org/archives/systemd-devel/2013-February/008617.html

Can we merge both approaches?
Comment 8 Auke Kok 2013-02-04 21:41:38 UTC
(In reply to comment #7)
> Hmm, how does this relate to this work:
> 
> http://lists.freedesktop.org/archives/systemd-devel/2013-February/008617.html
> 
> Can we merge both approaches?

Ouch! How unfortunate!

I'll have to investigate, I certainly do not want either effort to be lost. Give me some time to compare and read the code.
Comment 9 Auke Kok 2013-02-04 21:43:14 UTC
First thoughts: we should really not link against cairo here, so I'm heavily leaning towards Simon's approach.
Comment 10 Simon Peeters 2013-02-06 14:53:46 UTC
Created attachment 74291 [details] [review]
systemd-analyze: rewrite in C. Merged approach.

This patch sits on top of Marc-Antoine's first three patches.

It combines my previous version with some ideas from Marc-Antoine's version.

I did not yet merge systemctl dot because i have 2 questions about it:
 - how do we do this without breaking the interface stability promise?
   just exec systemd-analyze from systemctl and change the docs to refer to systemd-analyze?
 - "dot" is somehow ambiguous since it just refers to the output format.
   so while we are changing the interface, maybe we could come up with something more descriptive.
   "dependency-graph" or just "dep-graph"?
   other ideas?
Comment 11 Kay Sievers 2013-02-06 15:20:32 UTC
(In reply to comment #10)
> Created attachment 74291 [details] [review] [review]
> systemd-analyze: rewrite in C. Merged approach.
> 
> This patch sits on top of Marc-Antoine's first three patches.
> 
> It combines my previous version with some ideas from Marc-Antoine's version.
> 
> I did not yet merge systemctl dot because i have 2 questions about it:
>  - how do we do this without breaking the interface stability promise?

It's a "debug tool". I see no problem really to move it. It never really
belonged into systemctl from today's view.

>    just exec systemd-analyze from systemctl and change the docs to refer to
> systemd-analyze?

Change the docs to reflect the new location only.

>  - "dot" is somehow ambiguous since it just refers to the output format.
>    so while we are changing the interface, maybe we could come up with
> something more descriptive.
>    "dependency-graph" or just "dep-graph"?
>    other ideas?

Sounds fine. It will also allow us to add an output format option if some
fancy new format is better than dot.
Comment 12 Auke Kok 2013-02-06 19:31:03 UTC
Agreed with Kay's comments - should be resolvable easily as well.
Comment 13 Simon Peeters 2013-02-07 01:48:10 UTC
Created attachment 74315 [details] [review]
move systemctl dot to systemd-analyze depgraph
Comment 14 Gary van der Merwe 2013-02-11 11:04:25 UTC
Please note that this also duplicates Bug # 37809 .
Comment 15 Auke Kok 2013-02-11 18:01:17 UTC
(In reply to comment #14)
> Please note that this also duplicates Bug # 37809 .

I've closed this one as "wontfix" - basically rejecting the other implementation. I'm not sure what proper bugzilla procedures are but this isn't a duplicate as the other bug specifically asks for a vala implementation instead. This way seems a bit more precise to me.
Comment 16 Lennart Poettering 2013-02-11 23:40:23 UTC
Hmm, do we really want to rename this from "dot" to "depgraph"? "dot" might not be the same name, but is "depgraph" really that much better? At least in my mind "dot" is closely associated with graph theory, so I think "dot" is actually an OK name?

Do you expect more verbs that would output dot files, so you want to keep the avenue open?

Opinions?
Comment 17 Auke Kok 2013-02-11 23:55:09 UTC
(In reply to comment #16)
> Opinions?

I have no problems with 'dot' really...
Comment 18 Auke Kok 2013-02-13 23:06:49 UTC
Merged after a few minor changes - I kept the dot command "dot" in the end.

thanks to everyone for putting in the effort!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.