Lines Matching +full:- +full:8 +full:g

1 // SPDX-License-Identifier: GPL-2.0-only
3 * svghelper.c - helper functions for outputting svg
63 X = 1.0 * svg_page_width * (__time - first_time) / (last_time - first_time);
78 while (loop--) {
103 new_width = (last_time - first_time) / 5000000;
115 fprintf(svgfile, " rect { stroke-width: 1; }\n");
116 fprintf(svgfile, " rect.process { fill:rgb(180,180,180); fill-opacity:0.9; stroke-width:1; stroke:rgb( 0, 0, 0); } \n");
117 fprintf(svgfile, " rect.process2 { fill:rgb(180,180,180); fill-opacity:0.9; stroke-width:0; stroke:rgb( 0, 0, 0); } \n");
118 fprintf(svgfile, " rect.process3 { fill:rgb(180,180,180); fill-opacity:0.5; stroke-width:0; stroke:rgb( 0, 0, 0); } \n");
119 fprintf(svgfile, " rect.sample { fill:rgb( 0, 0,255); fill-opacity:0.8; stroke-width:0; stroke:rgb( 0, 0, 0); } \n");
120 fprintf(svgfile, " rect.sample_hi{ fill:rgb(255,128, 0); fill-opacity:0.8; stroke-width:0; stroke:rgb( 0, 0, 0); } \n");
121 fprintf(svgfile, " rect.error { fill:rgb(255, 0, 0); fill-opacity:0.5; stroke-width:0; stroke:rgb( 0, 0, 0); } \n");
122 fprintf(svgfile, " rect.net { fill:rgb( 0,128, 0); fill-opacity:0.5; stroke-width:0; stroke:rgb( 0, 0, 0); } \n");
123 fprintf(svgfile, " rect.disk { fill:rgb( 0, 0,255); fill-opacity:0.5; stroke-width:0; stroke:rgb( 0, 0, 0); } \n");
124 fprintf(svgfile, " rect.sync { fill:rgb(128,128, 0); fill-opacity:0.5; stroke-width:0; stroke:rgb( 0, 0, 0); } \n");
125 fprintf(svgfile, " rect.poll { fill:rgb( 0,128,128); fill-opacity:0.2; stroke-width:0; stroke:rgb( 0, 0, 0); } \n");
126 fprintf(svgfile, " rect.blocked { fill:rgb(255, 0, 0); fill-opacity:0.5; stroke-width:0; stroke:rgb( 0, 0, 0); } \n");
127 fprintf(svgfile, " rect.waiting { fill:rgb(224,214, 0); fill-opacity:0.8; stroke-width:0; stroke:rgb( 0, 0, 0); } \n");
128 fprintf(svgfile, " rect.WAITING { fill:rgb(255,214, 48); fill-opacity:0.6; stroke-width:0; stroke:rgb( 0, 0, 0); } \n");
129 fprintf(svgfile, " rect.cpu { fill:rgb(192,192,192); fill-opacity:0.2; stroke-width:0.5; stroke:rgb(128,128,128); } \n");
130 fprintf(svgfile, " rect.pstate { fill:rgb(128,128,128); fill-opacity:0.8; stroke-width:0; } \n");
131 fprintf(svgfile, " rect.c1 { fill:rgb(255,214,214); fill-opacity:0.5; stroke-width:0; } \n");
132 fprintf(svgfile, " rect.c2 { fill:rgb(255,172,172); fill-opacity:0.5; stroke-width:0; } \n");
133 fprintf(svgfile, " rect.c3 { fill:rgb(255,130,130); fill-opacity:0.5; stroke-width:0; } \n");
134 fprintf(svgfile, " rect.c4 { fill:rgb(255, 88, 88); fill-opacity:0.5; stroke-width:0; } \n");
135 fprintf(svgfile, " rect.c5 { fill:rgb(255, 44, 44); fill-opacity:0.5; stroke-width:0; } \n");
136 fprintf(svgfile, " rect.c6 { fill:rgb(255, 0, 0); fill-opacity:0.5; stroke-width:0; } \n");
137 fprintf(svgfile, " line.pstate { stroke:rgb(255,255, 0); stroke-opacity:0.8; stroke-width:2; } \n");
156 double w = time2pixels(end) - time2pixels(start);
162 fprintf(svgfile, "<g>\n");
164 fprintf(svgfile, "<rect x=\"%.8f\" width=\"%.8f\" y=\"%.1f\" height=\"%.1f\" class=\"%s\"/>\n",
170 fprintf(svgfile, "</g>\n");
175 double w = time2pixels(end) - time2pixels(start);
181 fprintf(svgfile, "<g>\n");
183 fprintf(svgfile, "<rect x=\"%.8f\" width=\"%.8f\" y=\"%.1f\" height=\"%.1f\" class=\"%s\"/>\n",
186 Yslot * SLOT_MULT + SLOT_HEIGHT - SLOT_HALF * height,
189 fprintf(svgfile, "</g>\n");
194 double w = time2pixels(end) - time2pixels(start);
200 fprintf(svgfile, "<g>\n");
202 fprintf(svgfile, "<rect x=\"%.8f\" width=\"%.8f\" y=\"%.1f\" height=\"%.1f\" class=\"%s\"/>\n",
205 Yslot * SLOT_MULT + SLOT_HEIGHT - SLOT_HEIGHT * height,
208 fprintf(svgfile, "</g>\n");
216 fprintf(svgfile, "<rect x=\"%.8f\" width=\"%.8f\" y=\"%.1f\" height=\"%.1f\" class=\"%s\"/>\n",
217 time2pixels(start), time2pixels(end)-time2pixels(start), Yslot * SLOT_MULT, SLOT_HEIGHT, type);
226 fprintf(svgfile, "<g>\n");
228 time_to_string(end - start));
232 fprintf(svgfile, "</g>\n");
243 if (svg_highlight && end - start > svg_highlight)
247 fprintf(svgfile, "<g>\n");
250 cpu, time_to_string(end - start));
253 fprintf(svgfile, "<rect x=\"%.8f\" width=\"%.8f\" y=\"%.1f\" height=\"%.1f\" class=\"%s\"/>\n",
254 time2pixels(start), time2pixels(end)-time2pixels(start), Yslot * SLOT_MULT, SLOT_HEIGHT,
257 text_size = (time2pixels(end)-time2pixels(start));
265 fprintf(svgfile, "<text x=\"%.8f\" y=\"%.8f\" font-size=\"%.8fpt\">%i</text>\n",
266 time2pixels(start), Yslot * SLOT_MULT + SLOT_HEIGHT - 1, text_size, cpu + 1);
268 fprintf(svgfile, "</g>\n");
300 if (end-start > 10 * NSEC_PER_MSEC) /* 10 msec */
303 text = time_to_string(end-start);
305 font_size = 1.0 * (time2pixels(end)-time2pixels(start));
312 fprintf(svgfile, "<g transform=\"translate(%.8f,%.8f)\">\n", time2pixels(start), Yslot * SLOT_MULT);
313 fprintf(svgfile, "<title>#%d waiting %s</title>\n", cpu, time_to_string(end - start));
316 fprintf(svgfile, "<rect x=\"0\" width=\"%.8f\" y=\"0\" height=\"%.1f\" class=\"%s\"/>\n",
317 time2pixels(end)-time2pixels(start), SLOT_HEIGHT, style);
319 fprintf(svgfile, "<text transform=\"rotate(90)\" font-size=\"%.8fpt\"> %s</text>\n",
321 fprintf(svgfile, "</g>\n");
366 fprintf(svgfile, "<g>\n");
368 fprintf(svgfile, "<rect x=\"%.8f\" width=\"%.8f\" y=\"%.1f\" height=\"%.1f\" class=\"cpu\"/>\n",
370 time2pixels(last_time)-time2pixels(first_time),
374 fprintf(svgfile, "<text x=\"%.8f\" y=\"%.8f\">%s</text>\n",
377 fprintf(svgfile, "<text transform=\"translate(%.8f,%.8f)\" font-size=\"1.25pt\">%s</text>\n",
378 10+time2pixels(first_time), cpu2y(cpu) + SLOT_MULT + SLOT_HEIGHT - 4, cpu_model());
380 fprintf(svgfile, "</g>\n");
391 if (svg_highlight && end - start >= svg_highlight)
398 fprintf(svgfile, "<g transform=\"translate(%.8f,%.8f)\">\n", time2pixels(start), cpu2y(cpu));
399 fprintf(svgfile, "<title>%d %s running %s</title>\n", pid, name, time_to_string(end - start));
402 fprintf(svgfile, "<rect x=\"0\" width=\"%.8f\" y=\"0\" height=\"%.1f\" class=\"%s\"/>\n",
403 time2pixels(end)-time2pixels(start), SLOT_MULT+SLOT_HEIGHT, type);
404 width = time2pixels(end)-time2pixels(start);
411 fprintf(svgfile, "<text transform=\"rotate(90)\" font-size=\"%.8fpt\">%s</text>\n",
414 fprintf(svgfile, "</g>\n");
426 fprintf(svgfile, "<g>\n");
432 fprintf(svgfile, "<rect class=\"%s\" x=\"%.8f\" width=\"%.8f\" y=\"%.1f\" height=\"%.1f\"/>\n",
434 time2pixels(start), time2pixels(end)-time2pixels(start),
437 width = (time2pixels(end)-time2pixels(start))/2.0;
444 fprintf(svgfile, "<text x=\"%.8f\" y=\"%.8f\" font-size=\"%.8fpt\">C%i</text>\n",
447 fprintf(svgfile, "</g>\n");
481 fprintf(svgfile, "<g>\n");
485 height = 1 + cpu2y(cpu) + SLOT_MULT + SLOT_HEIGHT - height;
486 fprintf(svgfile, "<line x1=\"%.8f\" x2=\"%.8f\" y1=\"%.1f\" y2=\"%.1f\" class=\"pstate\"/>\n",
488 fprintf(svgfile, "<text x=\"%.8f\" y=\"%.8f\" font-size=\"0.25pt\">%s</text>\n",
491 fprintf(svgfile, "</g>\n");
503 fprintf(svgfile, "<g>\n");
514 fprintf(svgfile, "<line x1=\"%.8f\" y1=\"%.2f\" x2=\"%.8f\" y2=\"%.2f\" style=\"stroke:rgb(32,255,32);stroke-width:0.009\"/>\n",
517 fprintf(svgfile, "<g transform=\"translate(%.8f,%.8f)\"><text transform=\"rotate(90)\" font-size=\"0.02pt\">%s &gt;</text></g>\n",
521 fprintf(svgfile, "<line x1=\"%.8f\" y1=\"%.2f\" x2=\"%.8f\" y2=\"%.2f\" style=\"stroke:rgb(32,255,32);stroke-width:0.009\"/>\n",
522 time2pixels(start), row2 * SLOT_MULT - SLOT_MULT/32, time2pixels(start), row2 * SLOT_MULT);
524 fprintf(svgfile, "<g transform=\"translate(%.8f,%.8f)\"><text transform=\"rotate(90)\" font-size=\"0.02pt\">%s &gt;</text></g>\n",
525 time2pixels(start), row2 * SLOT_MULT - SLOT_MULT/32, desc1);
529 fprintf(svgfile, "<line x1=\"%.8f\" y1=\"%.2f\" x2=\"%.8f\" y2=\"%.2f\" style=\"stroke:rgb(32,255,32);stroke-width:0.009\"/>\n",
532 fprintf(svgfile, "<g transform=\"translate(%.8f,%.8f)\"><text transform=\"rotate(90)\" font-size=\"0.02pt\">%s &lt;</text></g>\n",
536 fprintf(svgfile, "<line x1=\"%.8f\" y1=\"%.2f\" x2=\"%.8f\" y2=\"%.2f\" style=\"stroke:rgb(32,255,32);stroke-width:0.009\"/>\n",
537 time2pixels(start), row1 * SLOT_MULT - SLOT_MULT/32, time2pixels(start), row1 * SLOT_MULT);
539 fprintf(svgfile, "<g transform=\"translate(%.8f,%.8f)\"><text transform=\"rotate(90)\" font-size=\"0.02pt\">%s &lt;</text></g>\n",
540 time2pixels(start), row1 * SLOT_MULT - SLOT_HEIGHT/32, desc2);
547 fprintf(svgfile, "<circle cx=\"%.8f\" cy=\"%.2f\" r = \"0.01\" style=\"fill:rgb(32,255,32)\"/>\n",
550 fprintf(svgfile, "</g>\n");
561 fprintf(svgfile, "<g>\n");
567 fprintf(svgfile, "<line x1=\"%.8f\" y1=\"%.2f\" x2=\"%.8f\" y2=\"%.2f\" style=\"stroke:rgb(32,255,32);stroke-width:0.009\"/>\n",
570 fprintf(svgfile, "<line x1=\"%.8f\" y1=\"%.2f\" x2=\"%.8f\" y2=\"%.2f\" style=\"stroke:rgb(32,255,32);stroke-width:0.009\"/>\n",
576 fprintf(svgfile, "<circle cx=\"%.8f\" cy=\"%.2f\" r = \"0.01\" style=\"fill:rgb(32,255,32)\"/>\n",
579 fprintf(svgfile, "</g>\n");
587 fprintf(svgfile, "<g>\n");
594 fprintf(svgfile, "<circle cx=\"%.8f\" cy=\"%.2f\" r = \"0.01\" style=\"fill:rgb(255,128,128)\"/>\n",
596 fprintf(svgfile, "<circle cx=\"%.8f\" cy=\"%.2f\" r = \"0.01\" style=\"fill:rgb(255,128,128)\"/>\n",
599 fprintf(svgfile, "</g>\n");
607 fprintf(svgfile, "<text x=\"%.8f\" y=\"%.8f\">%s</text>\n",
616 fprintf(svgfile, "<rect x=\"%i\" width=\"%.8f\" y=\"0\" height=\"%.1f\" class=\"%s\"/>\n",
618 fprintf(svgfile, "<text transform=\"translate(%.8f, %.8f)\" font-size=\"%.8fpt\">%s</text>\n",
627 fprintf(svgfile, "<g>\n");
633 fprintf(svgfile, "</g>\n");
641 fprintf(svgfile, "<g>\n");
649 fprintf(svgfile, "</g>\n");
673 fprintf(svgfile, "<line x1=\"%.8f\" y1=\"%.2f\" x2=\"%.8f\" y2=\"%" PRIu64 "\" style=\"stroke:rgb(%i,%i,%i);stroke-width:%.3f\"/>\n",
690 #define cpumask_bits(maskp) ((maskp)->bits)
706 for (i = 0; i < t->sib_thr_nr; i++) {
707 if (!test_bit(cpu, cpumask_bits(&t->sib_thr[i])))
710 for_each_set_bit(thr, cpumask_bits(&t->sib_thr[i]), nr_cpus)
711 if (map[thr] == -1)
722 for (i = 0; i < t->sib_core_nr; i++)
723 for_each_set_bit(cpu, cpumask_bits(&t->sib_core[i]), nr_cpus)
735 return -1;
739 ret = -1;
756 int ret = -1;
758 nr_cpus = min(env->nr_cpus_online, MAX_NR_CPUS);
760 t.sib_core_nr = env->nr_sibling_cores;
761 t.sib_thr_nr = env->nr_sibling_threads;
762 t.sib_core = calloc(env->nr_sibling_cores, sizeof(cpumask_t));
763 t.sib_thr = calloc(env->nr_sibling_threads, sizeof(cpumask_t));
765 sib_core = env->sibling_cores;
766 sib_thr = env->sibling_threads;
773 for (i = 0; i < env->nr_sibling_cores; i++) {
782 for (i = 0; i < env->nr_sibling_threads; i++) {
798 topology_map[i] = -1;