Lines Matching defs:of
2 This file is part of systemd.
10 under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation; either version 2.1 of the License, or
15 WITHOUT ANY WARRANTY; without even the implied warranty of
19 You should have received a copy of the GNU Lesser General Public License
74 static void svg_header(FILE *of, struct list_sample_data *head, double graph_start, int n_cpus) {
95 fprintf(of, "<?xml version=\"1.0\" standalone=\"no\"?>\n");
96 fprintf(of, "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" ");
97 fprintf(of, "\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n");
99 //fprintf(of, "<g transform=\"translate(10,%d)\">\n", 1000 + 150 + (pcount * 20));
100 fprintf(of, "<svg width=\"%.0fpx\" height=\"%.0fpx\" version=\"1.1\" ", w, h);
101 fprintf(of, "xmlns=\"http://www.w3.org/2000/svg\">\n\n");
104 fprintf(of, "<!-- This file is a bootchart SVG file. It is best rendered in a browser -->\n");
105 fprintf(of, "<!-- such as Chrome, Chromium, or Firefox. Other applications that -->\n");
106 fprintf(of, "<!-- render these files properly but more slowly are ImageMagick, gimp, -->\n");
107 fprintf(of, "<!-- inkscape, etc. To display the files on your system, just point -->\n");
108 fprintf(of, "<!-- your browser to file:///run/log/ and click. This bootchart was -->\n\n");
110 fprintf(of, "<!-- generated by bootchart version %s, running with options: -->\n", VERSION);
111 fprintf(of, "<!-- hz=\"%f\" n=\"%d\" -->\n", arg_hz, arg_samples_len);
112 fprintf(of, "<!-- x=\"%f\" y=\"%f\" -->\n", arg_scale_x, arg_scale_y);
113 fprintf(of, "<!-- rel=\"%d\" f=\"%d\" -->\n", arg_relative, arg_filter);
114 fprintf(of, "<!-- p=\"%d\" e=\"%d\" -->\n", arg_pss, arg_entropy);
115 fprintf(of, "<!-- o=\"%s\" i=\"%s\" -->\n\n", arg_output_path, arg_init_path);
118 fprintf(of, "<defs>\n <style type=\"text/css\">\n <![CDATA[\n");
120 fprintf(of, " rect { stroke-width: 1; }\n");
121 fprintf(of, " rect.bg { fill: rgb(255,255,255); }\n");
122 fprintf(of, " rect.cpu { fill: rgb(64,64,240); stroke-width: 0; fill-opacity: 0.7; }\n");
123 fprintf(of, " rect.wait { fill: rgb(240,240,0); stroke-width: 0; fill-opacity: 0.7; }\n");
124 fprintf(of, " rect.bi { fill: rgb(240,128,128); stroke-width: 0; fill-opacity: 0.7; }\n");
125 fprintf(of, " rect.bo { fill: rgb(192,64,64); stroke-width: 0; fill-opacity: 0.7; }\n");
126 fprintf(of, " rect.ps { fill: rgb(192,192,192); stroke: rgb(128,128,128); fill-opacity: 0.7; }\n");
127 fprintf(of, " rect.krnl { fill: rgb(240,240,0); stroke: rgb(128,128,128); fill-opacity: 0.7; }\n");
128 fprintf(of, " rect.box { fill: rgb(240,240,240); stroke: rgb(192,192,192); }\n");
129 fprintf(of, " rect.clrw { stroke-width: 0; fill-opacity: 0.7;}\n");
130 fprintf(of, " line { stroke: rgb(64,64,64); stroke-width: 1; }\n");
131 fprintf(of, "// line.sec1 { }\n");
132 fprintf(of, " line.sec5 { stroke-width: 2; }\n");
133 fprintf(of, " line.sec01 { stroke: rgb(224,224,224); stroke-width: 1; }\n");
134 fprintf(of, " line.dot { stroke-dasharray: 2 4; }\n");
135 fprintf(of, " line.idle { stroke: rgb(64,64,64); stroke-dasharray: 10 6; stroke-opacity: 0.7; }\n");
137 fprintf(of, " .run { font-size: 8; font-style: italic; }\n");
138 fprintf(of, " text { font-family: Verdana, Helvetica; font-size: 10; }\n");
139 fprintf(of, " text.sec { font-size: 8; }\n");
140 fprintf(of, " text.t1 { font-size: 24; }\n");
141 fprintf(of, " text.t2 { font-size: 12; }\n");
142 fprintf(of, " text.idle { font-size: 18; }\n");
144 fprintf(of, " ]]>\n </style>\n</defs>\n\n");
147 static int svg_title(FILE *of, const char *build, int pscount, double log_start, int overrun) {
199 fprintf(of, "<text class=\"t1\" x=\"0\" y=\"30\">Bootchart for %s - %s</text>\n",
201 fprintf(of, "<text class=\"t2\" x=\"20\" y=\"50\">System: %s %s %s %s</text>\n",
203 fprintf(of, "<text class=\"t2\" x=\"20\" y=\"65\">CPU: %s</text>\n", cpu);
205 fprintf(of, "<text class=\"t2\" x=\"20\" y=\"80\">Disk: %s</text>\n", model);
206 fprintf(of, "<text class=\"t2\" x=\"20\" y=\"95\">Boot options: %s</text>\n", cmdline);
207 fprintf(of, "<text class=\"t2\" x=\"20\" y=\"110\">Build: %s</text>\n", build);
208 fprintf(of, "<text class=\"t2\" x=\"20\" y=\"125\">Log start time: %.03fs</text>\n", log_start);
209 fprintf(of, "<text class=\"t2\" x=\"20\" y=\"140\">Idle time: ");
212 fprintf(of, "%.03fs", idletime);
214 fprintf(of, "Not detected");
216 fprintf(of, "</text>\n");
217 fprintf(of, "<text class=\"sec\" x=\"20\" y=\"155\">Graph data: %.03f samples/sec, recorded %i total, dropped %i samples, %i processes, %i filtered</text>\n",
223 static void svg_graph_box(FILE *of, struct list_sample_data *head, int height, double graph_start) {
237 fprintf(of, "<rect class=\"box\" x=\"%.03f\" y=\"0\" width=\"%.03f\" height=\"%.03f\" />\n",
246 fprintf(of, " <line class=\"sec5\" x1=\"%.03f\" y1=\"0\" x2=\"%.03f\" y2=\"%.03f\" />\n",
251 fprintf(of, " <line class=\"sec1\" x1=\"%.03f\" y1=\"0\" x2=\"%.03f\" y2=\"%.03f\" />\n",
256 fprintf(of, " <line class=\"sec01\" x1=\"%.03f\" y1=\"0\" x2=\"%.03f\" y2=\"%.03f\" />\n",
263 fprintf(of, " <text class=\"sec\" x=\"%.03f\" y=\"%.03f\" >%.01fs</text>\n",
286 static void svg_pss_graph(FILE *of,
300 fprintf(of, "\n\n<!-- Pss memory size graph -->\n");
302 fprintf(of, "\n <text class=\"t2\" x=\"5\" y=\"-15\">Memory allocation - Pss</text>\n");
305 svg_graph_box(of, head, 100, graph_start);
308 fprintf(of, " <line class=\"sec01\" x1=\"%.03f\" y1=\"%.0f\" x2=\"%.03f\" y2=\"%.0f\"/>\n",
313 fprintf(of, " <text class=\"sec\" x=\"%.03f\" y=\"%.0f\">%dM</text>\n",
317 fprintf(of, "\n");
356 fprintf(of, " <rect class=\"clrw\" style=\"fill: %s\" x=\"%.03f\" y=\"%.03f\" width=\"%.03f\" height=\"%.03f\" />\n",
364 /* now plot the ones that are of significant size */
381 fprintf(of, " <rect class=\"clrw\" style=\"fill: %s\" x=\"%.03f\" y=\"%.03f\" width=\"%.03f\" height=\"%.03f\" />\n",
397 fprintf(of, " <rect class=\"clrw\" style=\"fill: %s\" x=\"%.03f\" y=\"%.03f\" width=\"%.03f\" height=\"%.03f\" />\n",
449 /* now plot the ones that are of significant size */
469 fprintf(of, " <text x=\"%.03f\" y=\"%.03f\"><![CDATA[%s]]> [%i]</text>\n",
486 fprintf(of, " <text x=\"%.03f\" y=\"%.03f\"><![CDATA[%s]]> [%i]</text>\n",
498 fprintf(of, "\n\n<!-- PSS map - csv format -->\n");
510 fprintf(of, "<!-- %s [%d] pss=", enc_name, ps->pid);
515 fprintf(of, "%d," , ps->sample->pss);
518 fprintf(of, " -->\n");
523 static void svg_io_bi_bar(FILE *of,
537 fprintf(of, "<!-- IO utilization graph - In -->\n");
538 fprintf(of, "<text class=\"t2\" x=\"5\" y=\"-15\">IO utilization - read</text>\n");
552 svg_graph_box(of, head, 5, graph_start);
619 fprintf(of, "<rect class=\"bi\" x=\"%.03f\" y=\"%.03f\" width=\"%.03f\" height=\"%.03f\" />\n",
627 fprintf(of, " <text class=\"sec\" x=\"%.03f\" y=\"%.03f\">%0.2fmb/sec</text>\n",
637 static void svg_io_bo_bar(FILE *of,
650 fprintf(of, "<!-- IO utilization graph - out -->\n");
651 fprintf(of, "<text class=\"t2\" x=\"5\" y=\"-15\">IO utilization - write</text>\n");
665 svg_graph_box(of, head, 5, graph_start);
731 fprintf(of, "<rect class=\"bo\" x=\"%.03f\" y=\"%.03f\" width=\"%.03f\" height=\"%.03f\" />\n",
739 fprintf(of, " <text class=\"sec\" x=\"%.03f\" y=\"%.03f\">%0.2fmb/sec</text>\n",
749 static void svg_cpu_bar(FILE *of, struct list_sample_data *head, int n_cpus, int cpu_num, double graph_start) {
751 fprintf(of, "<!-- CPU utilization graph -->\n");
754 fprintf(of, "<text class=\"t2\" x=\"5\" y=\"-15\">CPU[overall] utilization</text>\n");
756 fprintf(of, "<text class=\"t2\" x=\"5\" y=\"-15\">CPU[%d] utilization</text>\n", cpu_num);
759 svg_graph_box(of, head, 5, graph_start);
788 fprintf(of, "<rect class=\"cpu\" x=\"%.03f\" y=\"%.03f\" width=\"%.03f\" height=\"%.03f\" />\n",
798 static void svg_wait_bar(FILE *of, struct list_sample_data *head, int n_cpus, int cpu_num, double graph_start) {
800 fprintf(of, "<!-- Wait time aggregation box -->\n");
803 fprintf(of, "<text class=\"t2\" x=\"5\" y=\"-15\">CPU[overall] wait</text>\n");
805 fprintf(of, "<text class=\"t2\" x=\"5\" y=\"-15\">CPU[%d] wait</text>\n", cpu_num);
808 svg_graph_box(of, head, 5, graph_start);
837 fprintf(of, "<rect class=\"wait\" x=\"%.03f\" y=\"%.03f\" width=\"%.03f\" height=\"%.03f\" />\n",
847 static void svg_entropy_bar(FILE *of, struct list_sample_data *head, double graph_start) {
849 fprintf(of, "<!-- entropy pool graph -->\n");
851 fprintf(of, "<text class=\"t2\" x=\"5\" y=\"-15\">Entropy pool size</text>\n");
853 svg_graph_box(of, head, 5, graph_start);
858 fprintf(of, "<rect class=\"cpu\" x=\"%.03f\" y=\"%.03f\" width=\"%.03f\" height=\"%.03f\" />\n",
869 * walk the list of processes and return the next one to be
915 static void svg_do_initcall(FILE *of, struct list_sample_data *head, int count_only, double graph_start) {
929 fprintf(of, "<!-- initcall -->\n");
930 fprintf(of, "<text class=\"t2\" x=\"5\" y=\"-15\">Kernel init threads</text>\n");
932 svg_graph_box(of, head, kcount, graph_start);
978 fprintf(of, "<!-- thread=\"%s\" time=\"%.3f\" elapsed=\"%d\" result=\"%d\" -->\n",
985 fprintf(of, " <rect class=\"krnl\" x=\"%.03f\" y=\"%.03f\" width=\"%.03f\" height=\"%.03f\" />\n",
992 fprintf(of, " <text x=\"%.03f\" y=\"%.03f\">%s <tspan class=\"run\">%.03fs</tspan></text>\n",
1001 static void svg_ps_bars(FILE *of,
1015 fprintf(of, "<!-- Process graph -->\n");
1016 fprintf(of, "<text class=\"t2\" x=\"5\" y=\"-15\">Processes</text>\n");
1019 svg_graph_box(of, head, pcount, graph_start);
1036 /* leave some trace of what we actually filtered etc. */
1037 fprintf(of, "<!-- %s [%i] ppid=%i runtime=%.03fs -->\n", enc_name, ps->pid,
1053 fprintf(of, " <line class=\"dot\" x1=\"%.03f\" y1=\"%.03f\" x2=\"%.03f\" y2=\"%.03f\" />\n",
1062 fprintf(of, " <rect class=\"ps\" x=\"%.03f\" y=\"%.03f\" width=\"%.03f\" height=\"%.03f\" />\n",
1095 fprintf(of, " <rect class=\"wait\" x=\"%.03f\" y=\"%.03f\" width=\"%.03f\" height=\"%.03f\" />\n",
1102 fprintf(of, " <rect class=\"cpu\" x=\"%.03f\" y=\"%.03f\" width=\"%.03f\" height=\"%.03f\" />\n",
1117 /* text label of process name */
1118 fprintf(of, " <text x=\"%.03f\" y=\"%.03f\"><![CDATA[%s]]> [%i]<tspan class=\"run\">%.03fs</tspan> %s</text>\n",
1128 fprintf(of, " <line class=\"dot\" x1=\"%.03f\" y1=\"%.03f\" x2=\"%.03f\" y2=\"%.03f\" />\n",
1136 fprintf(of, " <line class=\"dot\" x1=\"%.03f\" y1=\"%.03f\" x2=\"%.03f\" y2=\"%.03f\" />\n",
1145 fprintf(of, "\n");
1184 * our definition of "idle":
1191 fprintf(of, "\n<!-- idle detected at %.03f seconds -->\n", idletime);
1192 fprintf(of, "<line class=\"idle\" x1=\"%.03f\" y1=\"%.03f\" x2=\"%.03f\" y2=\"%.03f\" />\n",
1197 fprintf(of, "<text class=\"idle\" x=\"%.03f\" y=\"%.03f\">%.01fs</text>\n",
1208 static void svg_top_ten_cpu(FILE *of, struct ps_struct *ps_first) {
1231 fprintf(of, "<text class=\"t2\" x=\"20\" y=\"0\">Top CPU consumers:</text>\n");
1233 fprintf(of, "<text class=\"t3\" x=\"20\" y=\"%d\">%3.03fs - <![CDATA[%s]]> [%d]</text>\n",
1240 static void svg_top_ten_pss(FILE *of, struct ps_struct *ps_first) {
1264 fprintf(of, "<text class=\"t2\" x=\"20\" y=\"0\">Top PSS consumers:</text>\n");
1266 fprintf(of, "<text class=\"t3\" x=\"20\" y=\"%d\">%dK - <![CDATA[%s]]> [%d]</text>\n",
1273 int svg_do(FILE *of,
1294 svg_do_initcall(of, head, 1, graph_start);
1309 svg_header(of, head, graph_start, arg_percpu ? n_cpus : 0);
1310 fprintf(of, "<rect class=\"bg\" width=\"100%%\" height=\"100%%\" />\n\n");
1312 fprintf(of, "<g transform=\"translate(10,400)\">\n");
1313 svg_io_bi_bar(of, head, n_samples, graph_start, interval);
1314 fprintf(of, "</g>\n\n");
1316 fprintf(of, "<g transform=\"translate(10,%.03f)\">\n", 400.0 + (arg_scale_y * offset));
1317 svg_io_bo_bar(of, head, n_samples, graph_start, interval);
1318 fprintf(of, "</g>\n\n");
1322 fprintf(of, "<g transform=\"translate(10,%.03f)\">\n", 400.0 + (arg_scale_y * offset));
1323 svg_cpu_bar(of, head, n_cpus, c, graph_start);
1324 fprintf(of, "</g>\n\n");
1327 fprintf(of, "<g transform=\"translate(10,%.03f)\">\n", 400.0 + (arg_scale_y * offset));
1328 svg_wait_bar(of, head, n_cpus, c, graph_start);
1329 fprintf(of, "</g>\n\n");
1334 fprintf(of, "<g transform=\"translate(10,%.03f)\">\n", 400.0 + (arg_scale_y * offset));
1335 svg_do_initcall(of, head, 0, graph_start);
1336 fprintf(of, "</g>\n\n");
1340 fprintf(of, "<g transform=\"translate(10,%.03f)\">\n", 400.0 + (arg_scale_y * offset) + ksize);
1341 svg_ps_bars(of, head, n_samples, n_cpus, ps_first, graph_start, interval);
1342 fprintf(of, "</g>\n\n");
1344 fprintf(of, "<g transform=\"translate(10, 0)\">\n");
1345 r = svg_title(of, build, pscount, log_start, overrun);
1346 fprintf(of, "</g>\n\n");
1351 fprintf(of, "<g transform=\"translate(10,200)\">\n");
1352 svg_top_ten_cpu(of, ps_first);
1353 fprintf(of, "</g>\n\n");
1356 fprintf(of, "<g transform=\"translate(10,%.03f)\">\n", 400.0 + (arg_scale_y * offset) + ksize + psize);
1357 svg_entropy_bar(of, head, graph_start);
1358 fprintf(of, "</g>\n\n");
1362 fprintf(of, "<g transform=\"translate(10,%.03f)\">\n", 400.0 + (arg_scale_y * offset) + ksize + psize + esize);
1363 svg_pss_graph(of, head, ps_first, graph_start);
1364 fprintf(of, "</g>\n\n");
1366 fprintf(of, "<g transform=\"translate(410,200)\">\n");
1367 svg_top_ten_pss(of, ps_first);
1368 fprintf(of, "</g>\n\n");
1372 fprintf(of, "\n</svg>\n");