svg.c revision 1f3523baf7418adf3b2738b3917ef956a8414ab7
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering bootchart.c - This file is part of systemd-bootchart
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering Copyright (C) 2009-2013 Intel Coproration
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering Auke Kok <auke-jan.h.kok@intel.com>
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering systemd is free software; you can redistribute it and/or modify it
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering under the terms of the GNU Lesser General Public License as published by
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering (at your option) any later version.
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering systemd is distributed in the hope that it will be useful, but
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering Lesser General Public License for more details.
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering You should have received a copy of the GNU Lesser General Public License
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
b92bea5d2a9481de69bb627a7b442a9f58fca43dZbigniew Jędrzejewski-Szmek#define kb_to_graph(m) ((m) * scale_y * 0.0001)
46b131574fdd7d77c15a0919ca9010cad7aa6ac7Lennart Poettering#define to_color(n) (192.0 - ((n) * 192.0))
b92bea5d2a9481de69bb627a7b442a9f58fca43dZbigniew Jędrzejewski-Szmek#define max(x, y) (((x) > (y)) ? (x) : (y))
b92bea5d2a9481de69bb627a7b442a9f58fca43dZbigniew Jędrzejewski-Szmek#define min(x, y) (((x) < (y)) ? (x) : (y))
46b131574fdd7d77c15a0919ca9010cad7aa6ac7Lennart Poettering#define svg(a...) do { snprintf(str, 8092, ## a); fputs(str, of); fflush(of); } while (0)
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poetteringstatic int pcount = 0;
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poetteringstatic int kcount = 0;
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poetteringstatic float psize = 0;
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poetteringstatic float ksize = 0;
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poetteringstatic float esize = 0;
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poetteringstatic void svg_header(void)
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering /* min width is about 1600px due to the label */
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering w = 150.0 + 10.0 + time_to_graph(sampletime[samples-1] - graph_start);
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering /* height is variable based on pss, psize, ksize */
178cc7700c23ac088cd7190d7854282075028d91Lennart Poettering h = 400.0 + (scale_y * 30.0) /* base graphs and title */
178cc7700c23ac088cd7190d7854282075028d91Lennart Poettering + (pss ? (100.0 * scale_y) + (scale_y * 7.0) : 0.0) /* pss estimate */
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("<?xml version=\"1.0\" standalone=\"no\"?>\n");
ccf23ad5faf228d450d263d7291156a948b61af2Christian Seiler svg("<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" ");
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n");
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering //svg("<g transform=\"translate(10,%d)\">\n", 1000 + 150 + (pcount * 20));
ccf23ad5faf228d450d263d7291156a948b61af2Christian Seiler svg("<svg width=\"%.0fpx\" height=\"%.0fpx\" version=\"1.1\" ",
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("xmlns=\"http://www.w3.org/2000/svg\">\n\n");
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering /* write some basic info as a comment, including some help */
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("<!-- This file is a bootchart SVG file. It is best rendered in a browser -->\n");
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("<!-- such as Chrome, Chromium, or Firefox. Other applications that -->\n");
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("<!-- render these files properly but more slowly are ImageMagick, gimp, -->\n");
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("<!-- inkscape, etc. To display the files on your system, just point -->\n");
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("<!-- your browser to file:///run/log/ and click. This bootchart was -->\n\n");
178cc7700c23ac088cd7190d7854282075028d91Lennart Poettering svg("<!-- generated by bootchart version %s, running with options: -->\n", VERSION);
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("<!-- hz=\"%f\" n=\"%d\" -->\n", hz, samples_len);
178cc7700c23ac088cd7190d7854282075028d91Lennart Poettering svg("<!-- x=\"%f\" y=\"%f\" -->\n", scale_x, scale_y);
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("<!-- rel=\"%d\" f=\"%d\" -->\n", relative, filter);
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("<!-- p=\"%d\" e=\"%d\" -->\n", pss, entropy);
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("<!-- o=\"%s\" i=\"%s\" -->\n\n", output_path, init_path);
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering /* style sheet */
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("<defs>\n <style type=\"text/css\">\n <![CDATA[\n");
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg(" rect.cpu { fill: rgb(64,64,240); stroke-width: 0; fill-opacity: 0.7; }\n");
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg(" rect.wait { fill: rgb(240,240,0); stroke-width: 0; fill-opacity: 0.7; }\n");
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg(" rect.bi { fill: rgb(240,128,128); stroke-width: 0; fill-opacity: 0.7; }\n");
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg(" rect.bo { fill: rgb(192,64,64); stroke-width: 0; fill-opacity: 0.7; }\n");
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg(" rect.ps { fill: rgb(192,192,192); stroke: rgb(128,128,128); fill-opacity: 0.7; }\n");
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg(" rect.krnl { fill: rgb(240,240,0); stroke: rgb(128,128,128); fill-opacity: 0.7; }\n");
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg(" rect.box { fill: rgb(240,240,240); stroke: rgb(192,192,192); }\n");
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg(" rect.clrw { stroke-width: 0; fill-opacity: 0.7;}\n");
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg(" line { stroke: rgb(64,64,64); stroke-width: 1; }\n");
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg(" line.sec5 { stroke-width: 2; }\n");
3b3154df7e2773332bb814e167187367a0ccae4aLennart Poettering svg(" line.sec01 { stroke: rgb(224,224,224); stroke-width: 1; }\n");
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg(" line.dot { stroke-dasharray: 2 4; }\n");
3b97fcbd28f92a1e51887fef5de8844a89bde523Lennart Poettering svg(" line.idle { stroke: rgb(64,64,64); stroke-dasharray: 10 6; stroke-opacity: 0.7; }\n");
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg(" .run { font-size: 8; font-style: italic; }\n");
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg(" text { font-family: Verdana, Helvetica; font-size: 10; }\n");
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering fd = openat(procfd, "cmdline", O_RDONLY);
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering /* extract root fs so we can find disk model name in sysfs */
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering /* FIXME: this works only in the simple case */
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering sprintf(filename, "block/%s/device/model", rootbdev);
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering fprintf(stderr, "Error reading disk model for %s\n", rootbdev);
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering /* various utsname parameters */
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering fprintf(stderr, "Error getting uname info\n");
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", localtime(&t));
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering fd = openat(procfd, "cpuinfo", O_RDONLY);
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("<text class=\"t1\" x=\"0\" y=\"30\">Bootchart for %s - %s</text>\n",
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("<text class=\"t2\" x=\"20\" y=\"50\">System: %s %s %s %s</text>\n",
e88baee88fad8bc59d33b55a7a2d640ef9e16cd6Zbigniew Jędrzejewski-Szmek uts.sysname, uts.release, uts.version, uts.machine);
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("<text class=\"t2\" x=\"20\" y=\"65\">CPU: %s</text>\n",
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("<text class=\"t2\" x=\"20\" y=\"80\">Disk: %s</text>\n",
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("<text class=\"t2\" x=\"20\" y=\"95\">Boot options: %s</text>\n",
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("<text class=\"t2\" x=\"20\" y=\"110\">Build: %s</text>\n",
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("<text class=\"t2\" x=\"20\" y=\"125\">Log start time: %.03fs</text>\n", log_start);
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("<text class=\"t2\" x=\"20\" y=\"140\">Idle time: ");
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("<text class=\"sec\" x=\"20\" y=\"155\">Graph data: %.03f samples/sec, recorded %i total, dropped %i samples, %i processes, %i filtered</text>\n",
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering hz, samples_len, overrun, pscount, pfiltered);
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering double d = 0.0;
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering /* outside box, fill */
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("<rect class=\"box\" x=\"%.03f\" y=\"0\" width=\"%.03f\" height=\"%.03f\" />\n",
e88baee88fad8bc59d33b55a7a2d640ef9e16cd6Zbigniew Jędrzejewski-Szmek time_to_graph(sampletime[samples-1] - graph_start),
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering for (d = graph_start; d <= sampletime[samples-1];
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering d += (scale_x < 2.0 ? 60.0 : scale_x < 10.0 ? 1.0 : 0.1)) {
5809560d858f45351856d6fe786a8117306dd0f2Lennart Poettering /* lines for each second */
5809560d858f45351856d6fe786a8117306dd0f2Lennart Poettering if (i % 50 == 0)
5809560d858f45351856d6fe786a8117306dd0f2Lennart Poettering svg(" <line class=\"sec5\" x1=\"%.03f\" y1=\"0\" x2=\"%.03f\" y2=\"%.03f\" />\n",
5809560d858f45351856d6fe786a8117306dd0f2Lennart Poettering else if (i % 10 == 0)
5809560d858f45351856d6fe786a8117306dd0f2Lennart Poettering svg(" <line class=\"sec1\" x1=\"%.03f\" y1=\"0\" x2=\"%.03f\" y2=\"%.03f\" />\n",
5809560d858f45351856d6fe786a8117306dd0f2Lennart Poettering svg(" <line class=\"sec01\" x1=\"%.03f\" y1=\"0\" x2=\"%.03f\" y2=\"%.03f\" />\n",
5809560d858f45351856d6fe786a8117306dd0f2Lennart Poettering /* time label */
5809560d858f45351856d6fe786a8117306dd0f2Lennart Poettering if (i % 10 == 0)
5809560d858f45351856d6fe786a8117306dd0f2Lennart Poettering svg(" <text class=\"sec\" x=\"%.03f\" y=\"%.03f\" >%.01fs</text>\n",
5809560d858f45351856d6fe786a8117306dd0f2Lennart Poettering/* xml comments must not contain "--" */
5809560d858f45351856d6fe786a8117306dd0f2Lennart Poetteringstatic char* xml_comment_encode(const char* name) {
5809560d858f45351856d6fe786a8117306dd0f2Lennart Poettering for (p = enc_name; *p; p++)
5809560d858f45351856d6fe786a8117306dd0f2Lennart Poetteringstatic void svg_pss_graph(void)
5809560d858f45351856d6fe786a8117306dd0f2Lennart Poettering svg("\n\n<!-- Pss memory size graph -->\n");
5809560d858f45351856d6fe786a8117306dd0f2Lennart Poettering svg("\n <text class=\"t2\" x=\"5\" y=\"-15\">Memory allocation - Pss</text>\n");
5809560d858f45351856d6fe786a8117306dd0f2Lennart Poettering /* vsize 1000 == 1000mb */
5809560d858f45351856d6fe786a8117306dd0f2Lennart Poettering /* draw some hlines for usable memory sizes */
5809560d858f45351856d6fe786a8117306dd0f2Lennart Poettering for (i = 100000; i < 1000000; i += 100000) {
5809560d858f45351856d6fe786a8117306dd0f2Lennart Poettering svg(" <line class=\"sec01\" x1=\"%.03f\" y1=\"%.0f\" x2=\"%.03f\" y2=\"%.0f\"/>\n",
5809560d858f45351856d6fe786a8117306dd0f2Lennart Poettering time_to_graph(sampletime[samples-1] - graph_start),
5809560d858f45351856d6fe786a8117306dd0f2Lennart Poettering svg(" <text class=\"sec\" x=\"%.03f\" y=\"%.0f\">%dM</text>\n",
5809560d858f45351856d6fe786a8117306dd0f2Lennart Poettering time_to_graph(sampletime[samples-1] - graph_start) + 5,
5809560d858f45351856d6fe786a8117306dd0f2Lennart Poettering /* now plot the graph itself */
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering /* put all the small pss blocks into the bottom */
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering if (ps->sample[i].pss <= (100 * scale_y))
8457f8d6ac7adc6c6ef31378e6e7761cce522141Lennart Poettering svg(" <rect class=\"clrw\" style=\"fill: %s\" x=\"%.03f\" y=\"%.03f\" width=\"%.03f\" height=\"%.03f\" />\n",
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering "rgb(64,64,64)",
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering time_to_graph(sampletime[i - 1] - graph_start),
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering time_to_graph(sampletime[i] - sampletime[i - 1]),
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering /* now plot the ones that are of significant size */
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering /* don't draw anything smaller than 2mb */
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering if (ps->sample[i].pss > (100 * scale_y)) {
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg(" <rect class=\"clrw\" style=\"fill: %s\" x=\"%.03f\" y=\"%.03f\" width=\"%.03f\" height=\"%.03f\" />\n",
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering time_to_graph(sampletime[i - 1] - graph_start),
40b71e89bae4e51768db4dc50ec64c1e9c96eec4Sebastian Thorarensen time_to_graph(sampletime[i] - sampletime[i - 1]),
8457f8d6ac7adc6c6ef31378e6e7761cce522141Lennart Poettering /* overlay all the text labels */
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering /* put all the small pss blocks into the bottom */
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering if (ps->sample[i].pss <= (100 * scale_y))
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering /* now plot the ones that are of significant size */
3b3154df7e2773332bb814e167187367a0ccae4aLennart Poettering /* don't draw anything smaller than 2mb */
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering if (ps->sample[i].pss > (100 * scale_y)) {
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering /* draw a label with the process / PID */
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering if ((i == 1) || (ps->sample[i - 1].pss <= (100 * scale_y)))
46b131574fdd7d77c15a0919ca9010cad7aa6ac7Lennart Poettering svg(" <text x=\"%.03f\" y=\"%.03f\"><![CDATA[%s]]> [%i]</text>\n",
b92bea5d2a9481de69bb627a7b442a9f58fca43dZbigniew Jędrzejewski-Szmek time_to_graph(sampletime[i] - graph_start),
03ee5c38cb0da193dd08733fb4c0c2809cee6a99Lennart Poettering kb_to_graph(1000000.0 - bottom - ((top - bottom) / 2)),
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering /* debug output - full data dump */
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("\n\n<!-- PSS map - csv format -->\n");
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("<!-- %s [%d] pss=", enc_name, ps->pid);
d682b3a7e7c7c2941a4d3e193f1e330dbc9fae89Lennart Poettering for (i = 0; i < samples ; i++) {
4a62c710b62a5a3c7a8a278b810b9d5b5a0c8f4fMichal Schmidtstatic void svg_io_bi_bar(void)
35e2e347d38cc2f8bd7c38a0d8a5129f5fbb0ab9Lennart Poettering svg("<!-- IO utilization graph - In -->\n");
178cc7700c23ac088cd7190d7854282075028d91Lennart Poettering svg("<text class=\"t2\" x=\"5\" y=\"-15\">IO utilization - read</text>\n");
178cc7700c23ac088cd7190d7854282075028d91Lennart Poettering * calculate rounding range
178cc7700c23ac088cd7190d7854282075028d91Lennart Poettering * We need to round IO data since IO block data is not updated on
178cc7700c23ac088cd7190d7854282075028d91Lennart Poettering * each poll. Applying a smoothing function loses some burst data,
178cc7700c23ac088cd7190d7854282075028d91Lennart Poettering * so keep the smoothing range short.
178cc7700c23ac088cd7190d7854282075028d91Lennart Poettering /* surrounding box */
int start;
int stop;
double tot;
max_here = i;
int start;
int stop;
double tot;
double pbi;
if (i == max_here) {
static void svg_io_bo_bar(void)
double range;
int max_here = 0;
int start;
int stop;
double tot;
max_here = i;
int start;
int stop;
double tot;
double pbo;
if (i == max_here) {
static void svg_cpu_bar(void)
double trt;
double ptrt;
for (c = 0; c < cpus; c++)
static void svg_wait_bar(void)
double twt;
double ptwt;
for (c = 0; c < cpus; c++)
static void svg_entropy_bar(void)
if (!ps)
return ps;
return NULL;
if (!filter)
int ret;
int usecs;
kcount = 0;
if (!count_only) {
kcount = 0;
while (!feof(f)) {
func[z] = 0;
if (count_only) {
kcount++;
func,
kcount++;
static void svg_ps_bars(void)
int pid;
double starttime;
if (!ps)
if(!enc_name)
ps_to_graph(j),
ps_to_graph(j),
svg(" <text x=\"%.03f\" y=\"%.03f\"><![CDATA[%s]]> [%i]<tspan class=\"run\">%.03fs</tspan></text>\n",
double crt;
double brt;
for (c = 0; c < cpus; c++)
idletime);
-scale_y,
idletime);
static void svg_top_ten_cpu(void)
static void svg_top_ten_pss(void)
pcount++;
pfiltered++;
svg_header();
svg_cpu_bar();
svg_wait_bar();
if (kcount) {
svg_do_initcall(0);
svg_ps_bars();
if (entropy) {
if (pss) {