Lines Matching +full:- +full:8 +full:g
1 // SPDX-License-Identifier: GPL-2.0-only
3 * svghelper.c - helper functions for outputting svg
62 X = 1.0 * svg_page_width * (__time - first_time) / (last_time - first_time);
77 while (loop--) {
102 new_width = (last_time - first_time) / 5000000;
114 fprintf(svgfile, " rect { stroke-width: 1; }\n");
115 fprintf(svgfile, " rect.process { fill:rgb(180,180,180); fill-opacity:0.9; stroke-width:1; stroke:rgb( 0, 0, 0); } \n");
116 fprintf(svgfile, " rect.process2 { fill:rgb(180,180,180); fill-opacity:0.9; stroke-width:0; stroke:rgb( 0, 0, 0); } \n");
117 fprintf(svgfile, " rect.process3 { fill:rgb(180,180,180); fill-opacity:0.5; stroke-width:0; stroke:rgb( 0, 0, 0); } \n");
118 fprintf(svgfile, " rect.sample { fill:rgb( 0, 0,255); fill-opacity:0.8; stroke-width:0; stroke:rgb( 0, 0, 0); } \n");
119 fprintf(svgfile, " rect.sample_hi{ fill:rgb(255,128, 0); fill-opacity:0.8; stroke-width:0; stroke:rgb( 0, 0, 0); } \n");
120 fprintf(svgfile, " rect.error { fill:rgb(255, 0, 0); fill-opacity:0.5; stroke-width:0; stroke:rgb( 0, 0, 0); } \n");
121 fprintf(svgfile, " rect.net { fill:rgb( 0,128, 0); fill-opacity:0.5; stroke-width:0; stroke:rgb( 0, 0, 0); } \n");
122 fprintf(svgfile, " rect.disk { fill:rgb( 0, 0,255); fill-opacity:0.5; stroke-width:0; stroke:rgb( 0, 0, 0); } \n");
123 fprintf(svgfile, " rect.sync { fill:rgb(128,128, 0); fill-opacity:0.5; stroke-width:0; stroke:rgb( 0, 0, 0); } \n");
124 fprintf(svgfile, " rect.poll { fill:rgb( 0,128,128); fill-opacity:0.2; stroke-width:0; stroke:rgb( 0, 0, 0); } \n");
125 fprintf(svgfile, " rect.blocked { fill:rgb(255, 0, 0); fill-opacity:0.5; stroke-width:0; stroke:rgb( 0, 0, 0); } \n");
126 fprintf(svgfile, " rect.waiting { fill:rgb(224,214, 0); fill-opacity:0.8; stroke-width:0; stroke:rgb( 0, 0, 0); } \n");
127 fprintf(svgfile, " rect.WAITING { fill:rgb(255,214, 48); fill-opacity:0.6; stroke-width:0; stroke:rgb( 0, 0, 0); } \n");
128 fprintf(svgfile, " rect.cpu { fill:rgb(192,192,192); fill-opacity:0.2; stroke-width:0.5; stroke:rgb(128,128,128); } \n");
129 fprintf(svgfile, " rect.pstate { fill:rgb(128,128,128); fill-opacity:0.8; stroke-width:0; } \n");
130 fprintf(svgfile, " rect.c1 { fill:rgb(255,214,214); fill-opacity:0.5; stroke-width:0; } \n");
131 fprintf(svgfile, " rect.c2 { fill:rgb(255,172,172); fill-opacity:0.5; stroke-width:0; } \n");
132 fprintf(svgfile, " rect.c3 { fill:rgb(255,130,130); fill-opacity:0.5; stroke-width:0; } \n");
133 fprintf(svgfile, " rect.c4 { fill:rgb(255, 88, 88); fill-opacity:0.5; stroke-width:0; } \n");
134 fprintf(svgfile, " rect.c5 { fill:rgb(255, 44, 44); fill-opacity:0.5; stroke-width:0; } \n");
135 fprintf(svgfile, " rect.c6 { fill:rgb(255, 0, 0); fill-opacity:0.5; stroke-width:0; } \n");
136 fprintf(svgfile, " line.pstate { stroke:rgb(255,255, 0); stroke-opacity:0.8; stroke-width:2; } \n");
155 double w = time2pixels(end) - time2pixels(start);
161 fprintf(svgfile, "<g>\n");
163 fprintf(svgfile, "<rect x=\"%.8f\" width=\"%.8f\" y=\"%.1f\" height=\"%.1f\" class=\"%s\"/>\n",
169 fprintf(svgfile, "</g>\n");
174 double w = time2pixels(end) - time2pixels(start);
180 fprintf(svgfile, "<g>\n");
182 fprintf(svgfile, "<rect x=\"%.8f\" width=\"%.8f\" y=\"%.1f\" height=\"%.1f\" class=\"%s\"/>\n",
185 Yslot * SLOT_MULT + SLOT_HEIGHT - SLOT_HALF * height,
188 fprintf(svgfile, "</g>\n");
193 double w = time2pixels(end) - time2pixels(start);
199 fprintf(svgfile, "<g>\n");
201 fprintf(svgfile, "<rect x=\"%.8f\" width=\"%.8f\" y=\"%.1f\" height=\"%.1f\" class=\"%s\"/>\n",
204 Yslot * SLOT_MULT + SLOT_HEIGHT - SLOT_HEIGHT * height,
207 fprintf(svgfile, "</g>\n");
215 fprintf(svgfile, "<rect x=\"%.8f\" width=\"%.8f\" y=\"%.1f\" height=\"%.1f\" class=\"%s\"/>\n",
216 time2pixels(start), time2pixels(end)-time2pixels(start), Yslot * SLOT_MULT, SLOT_HEIGHT, type);
225 fprintf(svgfile, "<g>\n");
227 time_to_string(end - start));
231 fprintf(svgfile, "</g>\n");
242 if (svg_highlight && end - start > svg_highlight)
246 fprintf(svgfile, "<g>\n");
249 cpu, time_to_string(end - start));
252 fprintf(svgfile, "<rect x=\"%.8f\" width=\"%.8f\" y=\"%.1f\" height=\"%.1f\" class=\"%s\"/>\n",
253 time2pixels(start), time2pixels(end)-time2pixels(start), Yslot * SLOT_MULT, SLOT_HEIGHT,
256 text_size = (time2pixels(end)-time2pixels(start));
264 fprintf(svgfile, "<text x=\"%.8f\" y=\"%.8f\" font-size=\"%.8fpt\">%i</text>\n",
265 time2pixels(start), Yslot * SLOT_MULT + SLOT_HEIGHT - 1, text_size, cpu + 1);
267 fprintf(svgfile, "</g>\n");
299 if (end-start > 10 * NSEC_PER_MSEC) /* 10 msec */
302 text = time_to_string(end-start);
304 font_size = 1.0 * (time2pixels(end)-time2pixels(start));
311 fprintf(svgfile, "<g transform=\"translate(%.8f,%.8f)\">\n", time2pixels(start), Yslot * SLOT_MULT);
312 fprintf(svgfile, "<title>#%d waiting %s</title>\n", cpu, time_to_string(end - start));
315 fprintf(svgfile, "<rect x=\"0\" width=\"%.8f\" y=\"0\" height=\"%.1f\" class=\"%s\"/>\n",
316 time2pixels(end)-time2pixels(start), SLOT_HEIGHT, style);
318 fprintf(svgfile, "<text transform=\"rotate(90)\" font-size=\"%.8fpt\"> %s</text>\n",
320 fprintf(svgfile, "</g>\n");
365 fprintf(svgfile, "<g>\n");
367 fprintf(svgfile, "<rect x=\"%.8f\" width=\"%.8f\" y=\"%.1f\" height=\"%.1f\" class=\"cpu\"/>\n",
369 time2pixels(last_time)-time2pixels(first_time),
373 fprintf(svgfile, "<text x=\"%.8f\" y=\"%.8f\">%s</text>\n",
376 fprintf(svgfile, "<text transform=\"translate(%.8f,%.8f)\" font-size=\"1.25pt\">%s</text>\n",
377 10+time2pixels(first_time), cpu2y(cpu) + SLOT_MULT + SLOT_HEIGHT - 4, cpu_model());
379 fprintf(svgfile, "</g>\n");
390 if (svg_highlight && end - start >= svg_highlight)
397 fprintf(svgfile, "<g transform=\"translate(%.8f,%.8f)\">\n", time2pixels(start), cpu2y(cpu));
398 fprintf(svgfile, "<title>%d %s running %s</title>\n", pid, name, time_to_string(end - start));
401 fprintf(svgfile, "<rect x=\"0\" width=\"%.8f\" y=\"0\" height=\"%.1f\" class=\"%s\"/>\n",
402 time2pixels(end)-time2pixels(start), SLOT_MULT+SLOT_HEIGHT, type);
403 width = time2pixels(end)-time2pixels(start);
410 fprintf(svgfile, "<text transform=\"rotate(90)\" font-size=\"%.8fpt\">%s</text>\n",
413 fprintf(svgfile, "</g>\n");
425 fprintf(svgfile, "<g>\n");
431 fprintf(svgfile, "<rect class=\"%s\" x=\"%.8f\" width=\"%.8f\" y=\"%.1f\" height=\"%.1f\"/>\n",
433 time2pixels(start), time2pixels(end)-time2pixels(start),
436 width = (time2pixels(end)-time2pixels(start))/2.0;
443 fprintf(svgfile, "<text x=\"%.8f\" y=\"%.8f\" font-size=\"%.8fpt\">C%i</text>\n",
446 fprintf(svgfile, "</g>\n");
480 fprintf(svgfile, "<g>\n");
484 height = 1 + cpu2y(cpu) + SLOT_MULT + SLOT_HEIGHT - height;
485 fprintf(svgfile, "<line x1=\"%.8f\" x2=\"%.8f\" y1=\"%.1f\" y2=\"%.1f\" class=\"pstate\"/>\n",
487 fprintf(svgfile, "<text x=\"%.8f\" y=\"%.8f\" font-size=\"0.25pt\">%s</text>\n",
490 fprintf(svgfile, "</g>\n");
502 fprintf(svgfile, "<g>\n");
513 fprintf(svgfile, "<line x1=\"%.8f\" y1=\"%.2f\" x2=\"%.8f\" y2=\"%.2f\" style=\"stroke:rgb(32,255,32);stroke-width:0.009\"/>\n",
516 fprintf(svgfile, "<g transform=\"translate(%.8f,%.8f)\"><text transform=\"rotate(90)\" font-size=\"0.02pt\">%s ></text></g>\n",
520 fprintf(svgfile, "<line x1=\"%.8f\" y1=\"%.2f\" x2=\"%.8f\" y2=\"%.2f\" style=\"stroke:rgb(32,255,32);stroke-width:0.009\"/>\n",
521 time2pixels(start), row2 * SLOT_MULT - SLOT_MULT/32, time2pixels(start), row2 * SLOT_MULT);
523 fprintf(svgfile, "<g transform=\"translate(%.8f,%.8f)\"><text transform=\"rotate(90)\" font-size=\"0.02pt\">%s ></text></g>\n",
524 time2pixels(start), row2 * SLOT_MULT - SLOT_MULT/32, desc1);
528 fprintf(svgfile, "<line x1=\"%.8f\" y1=\"%.2f\" x2=\"%.8f\" y2=\"%.2f\" style=\"stroke:rgb(32,255,32);stroke-width:0.009\"/>\n",
531 fprintf(svgfile, "<g transform=\"translate(%.8f,%.8f)\"><text transform=\"rotate(90)\" font-size=\"0.02pt\">%s <</text></g>\n",
535 fprintf(svgfile, "<line x1=\"%.8f\" y1=\"%.2f\" x2=\"%.8f\" y2=\"%.2f\" style=\"stroke:rgb(32,255,32);stroke-width:0.009\"/>\n",
536 time2pixels(start), row1 * SLOT_MULT - SLOT_MULT/32, time2pixels(start), row1 * SLOT_MULT);
538 fprintf(svgfile, "<g transform=\"translate(%.8f,%.8f)\"><text transform=\"rotate(90)\" font-size=\"0.02pt\">%s <</text></g>\n",
539 time2pixels(start), row1 * SLOT_MULT - SLOT_HEIGHT/32, desc2);
546 fprintf(svgfile, "<circle cx=\"%.8f\" cy=\"%.2f\" r = \"0.01\" style=\"fill:rgb(32,255,32)\"/>\n",
549 fprintf(svgfile, "</g>\n");
560 fprintf(svgfile, "<g>\n");
566 fprintf(svgfile, "<line x1=\"%.8f\" y1=\"%.2f\" x2=\"%.8f\" y2=\"%.2f\" style=\"stroke:rgb(32,255,32);stroke-width:0.009\"/>\n",
569 fprintf(svgfile, "<line x1=\"%.8f\" y1=\"%.2f\" x2=\"%.8f\" y2=\"%.2f\" style=\"stroke:rgb(32,255,32);stroke-width:0.009\"/>\n",
575 fprintf(svgfile, "<circle cx=\"%.8f\" cy=\"%.2f\" r = \"0.01\" style=\"fill:rgb(32,255,32)\"/>\n",
578 fprintf(svgfile, "</g>\n");
586 fprintf(svgfile, "<g>\n");
593 fprintf(svgfile, "<circle cx=\"%.8f\" cy=\"%.2f\" r = \"0.01\" style=\"fill:rgb(255,128,128)\"/>\n",
595 fprintf(svgfile, "<circle cx=\"%.8f\" cy=\"%.2f\" r = \"0.01\" style=\"fill:rgb(255,128,128)\"/>\n",
598 fprintf(svgfile, "</g>\n");
606 fprintf(svgfile, "<text x=\"%.8f\" y=\"%.8f\">%s</text>\n",
615 fprintf(svgfile, "<rect x=\"%i\" width=\"%.8f\" y=\"0\" height=\"%.1f\" class=\"%s\"/>\n",
617 fprintf(svgfile, "<text transform=\"translate(%.8f, %.8f)\" font-size=\"%.8fpt\">%s</text>\n",
626 fprintf(svgfile, "<g>\n");
632 fprintf(svgfile, "</g>\n");
640 fprintf(svgfile, "<g>\n");
648 fprintf(svgfile, "</g>\n");
672 fprintf(svgfile, "<line x1=\"%.8f\" y1=\"%.2f\" x2=\"%.8f\" y2=\"%" PRIu64 "\" style=\"stroke:rgb(%i,%i,%i);stroke-width:%.3f\"/>\n",
689 #define cpumask_bits(maskp) ((maskp)->bits)
705 for (i = 0; i < t->sib_thr_nr; i++) {
706 if (!test_bit(cpu, cpumask_bits(&t->sib_thr[i])))
709 for_each_set_bit(thr, cpumask_bits(&t->sib_thr[i]), nr_cpus)
710 if (map[thr] == -1)
721 for (i = 0; i < t->sib_core_nr; i++)
722 for_each_set_bit(cpu, cpumask_bits(&t->sib_core[i]), nr_cpus)
734 return -1;
738 ret = -1;
755 int ret = -1;
757 nr_cpus = min(env->nr_cpus_online, MAX_NR_CPUS);
759 t.sib_core_nr = env->nr_sibling_cores;
760 t.sib_thr_nr = env->nr_sibling_threads;
761 t.sib_core = calloc(env->nr_sibling_cores, sizeof(cpumask_t));
762 t.sib_thr = calloc(env->nr_sibling_threads, sizeof(cpumask_t));
764 sib_core = env->sibling_cores;
765 sib_thr = env->sibling_threads;
772 for (i = 0; i < env->nr_sibling_cores; i++) {
781 for (i = 0; i < env->nr_sibling_threads; i++) {
797 topology_map[i] = -1;