Skip to content

Commit

Permalink
Update configuration/options summary in svg
Browse files Browse the repository at this point in the history
Some of the comments summarizing the configuration/options could be
confusing.  E.g., "f" was used for "Filtering", but "-f" is the
command-line option used to specify the sample frequency.  Also, "hz"
was used but there is no command-line option or config directive that
mentions "hertz".

Change the summmary to use the names from the config file.  Update the
sample config file so it is more obvious what is parsed as a float,
and also include "Cmdline", which was missing.
  • Loading branch information
jamuir committed Jan 28, 2025
1 parent a15bcaf commit ac94b73
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
11 changes: 6 additions & 5 deletions src/bootchart.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@

[Bootchart]
#Samples=500
#Frequency=25
#Frequency=25.0
#Relative=no
#Filter=yes
#Output=<folder name, defaults to /run/log>
#Init=/path/to/init-binary
#Output=<directory name, defaults to /run/log>
#Init=<path to init, defaults to the systemd binary>
#PlotMemoryUsage=no
#PlotEntropyGraph=no
#ScaleX=100
#ScaleY=20
#ScaleX=100.0
#ScaleY=20.0
#ControlGroup=no
#PerCPU=no
#Cmdline=no
25 changes: 17 additions & 8 deletions src/svg.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,23 @@ static void svg_header(FILE *of, struct list_sample_data *head, double graph_sta
fprintf(of, "<!-- such as Chrome, Chromium, or Firefox. Other applications that -->\n");
fprintf(of, "<!-- render these files properly but more slowly are ImageMagick, gimp, -->\n");
fprintf(of, "<!-- inkscape, etc. To display the files on your system, just point -->\n");
fprintf(of, "<!-- your browser to file:///run/log/ and click. This bootchart was -->\n\n");

fprintf(of, "<!-- generated by bootchart version %s, running with options: -->\n", VERSION);
fprintf(of, "<!-- hz=\"%f\" n=\"%d\" -->\n", arg_hz, arg_samples_len);
fprintf(of, "<!-- x=\"%f\" y=\"%f\" -->\n", arg_scale_x, arg_scale_y);
fprintf(of, "<!-- rel=\"%d\" f=\"%d\" -->\n", arg_relative, arg_filter);
fprintf(of, "<!-- p=\"%d\" e=\"%d\" -->\n", arg_pss, arg_entropy);
fprintf(of, "<!-- o=\"%s\" i=\"%s\" -->\n\n", arg_output_path, arg_init_path);
fprintf(of, "<!-- your browser to file:///run/log (the default location) and click. -->\n\n");

fprintf(of, "<!-- This file was generated by bootchart version %s, running with configuration: -->\n\n", VERSION);

fprintf(of, "<!-- Samples=%d -->\n", arg_samples_len);
fprintf(of, "<!-- Frequency=%f -->\n", arg_hz);
fprintf(of, "<!-- Relative=%d -->\n", arg_relative);
fprintf(of, "<!-- Filter=%d -->\n", arg_filter);
fprintf(of, "<!-- Output=%s -->\n", arg_output_path);
fprintf(of, "<!-- Init=%s -->\n", arg_init_path);
fprintf(of, "<!-- PlotMemoryUsage=%d -->\n", arg_pss);
fprintf(of, "<!-- PlotEntropyGraph=%d -->\n", arg_entropy);
fprintf(of, "<!-- ScaleX=%f -->\n", arg_scale_x);
fprintf(of, "<!-- ScaleY=%f -->\n", arg_scale_y);
fprintf(of, "<!-- ControlGroup=%d -->\n", arg_show_cgroup);
fprintf(of, "<!-- PerCPU=%d -->\n", arg_percpu);
fprintf(of, "<!-- Cmdline=%d -->\n\n", arg_show_cmdline);

/* style sheet */
fprintf(of, "<defs>\n <style type=\"text/css\">\n <![CDATA[\n");
Expand Down

0 comments on commit ac94b73

Please sign in to comment.