-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
systemd-analyze: Add JSON and table output to systemd-analyze's plot #25790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
00487c4 to
d149a1c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks pretty good. some minor comments
d149a1c to
5325714
Compare
5325714 to
30209e3
Compare
|
btw, we generally do line breaks at 109ch, as |
Would you mind giving an example of this? I've been following surrounding code for how to deal with formatting on the most part. |
30209e3 to
9ebfe6b
Compare
|
needs a rebase |
9ebfe6b to
eec53b8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add brief tests for the new settings in test/units/testsuite-65.sh.
src/analyze/analyze-plot.c
Outdated
| const BootTimes* boot, | ||
| const char* pretty_times) { | ||
| int m = 1, y = 0; | ||
| UnitTimes* u; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please drop it here, and declare in each for loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last for loop relies on using u as it was previously changed by the for loop before.
src/analyze/analyze-plot.c
Outdated
| @@ -229,7 +216,7 @@ int verb_plot(int argc, char *argv[], void *userdata) { | |||
| if (boot->kernel_done_time > 0) | |||
| m++; | |||
|
|
|||
| for (u = times; u->has_data; u++) { | |||
| for (u = (UnitTimes*)times; u->has_data; u++) { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (UnitTimes *u = times; u->has_data; u++) {
eec53b8 to
8101826
Compare
|
lgtm. but the ci didn't like it, but it looks like that is the CI's fault, some network issue. could you rebase and push again, to trigger this again? |
8101826 to
a23be57
Compare
We wanted to have programmatic access to the data presented in systemd-analyze's plot's SVG output, so this PR adds the ability to output
plotdata as JSON or table format. This is controlled by using the--JSON=and--tablecommand line options.Note:
The
show_tablefunction insrc/analyze/analyze-plot.cappears a few times throughout the project so it might be worth re-factoring it intoshared/.