Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 163793
b: refs/heads/master
c: 964a0b3
h: refs/heads/master
i:
  163791: 9579214
v: v3
  • Loading branch information
Arjan van de Ven authored and Ingo Molnar committed Sep 19, 2009
1 parent 210263b commit 35383c8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3c09eebd61eaacca866cd60b50416f18640bc731
refs/heads/master: 964a0b3d2b1b1cac1d01e29b635831b3d92a3fdd
24 changes: 13 additions & 11 deletions trunk/tools/perf/util/svghelper.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ static u64 turbo_frequency, max_freq;
#define SLOT_HEIGHT 25.0
#define WIDTH 1000.0

#define MIN_TEXT_SIZE 0.001

static u64 total_height;
static FILE *svgfile;

Expand Down Expand Up @@ -104,8 +106,8 @@ void svg_sample(int Yslot, int cpu, u64 start, u64 end, const char *type)
text_size = text_size/2;
if (text_size > 1.25)
text_size = 1.25;
if (text_size > 0.0001)
fprintf(svgfile, "<text transform=\"translate(%1.6f,%1.6f)\" font-size=\"%1.6fpt\">%i</text>\n",
if (text_size > MIN_TEXT_SIZE)
fprintf(svgfile, "<text transform=\"translate(%1.8f,%1.8f)\" font-size=\"%1.6fpt\">%i</text>\n",
time2pixels(start), Yslot * SLOT_MULT + SLOT_HEIGHT - 1, text_size, cpu + 1);

}
Expand Down Expand Up @@ -146,10 +148,10 @@ void svg_cpu_box(int cpu, u64 __max_freq, u64 __turbo_freq)
cpu2y(cpu), SLOT_MULT+SLOT_HEIGHT);

sprintf(cpu_string, "CPU %i", (int)cpu+1);
fprintf(svgfile, "<text transform=\"translate(%4.1f,%4.1f)\">%s</text>\n",
fprintf(svgfile, "<text transform=\"translate(%4.8f,%4.8f)\">%s</text>\n",
10+time2pixels(first_time), cpu2y(cpu) + SLOT_HEIGHT/2, cpu_string);

fprintf(svgfile, "<text transform=\"translate(%4.1f,%4.1f)\" font-size=\"1.25pt\">%s</text>\n",
fprintf(svgfile, "<text transform=\"translate(%4.8f,%4.8f)\" font-size=\"1.25pt\">%s</text>\n",
10+time2pixels(first_time), cpu2y(cpu) + SLOT_MULT + SLOT_HEIGHT - 4, cpu_model());
}

Expand All @@ -166,8 +168,8 @@ void svg_process(int cpu, u64 start, u64 end, const char *type, const char *name
if (width > 6)
width = 6;

if (width > 0.001)
fprintf(svgfile, "<text transform=\"translate(%4.5f,%4.5f) rotate(90)\" font-size=\"%3.4fpt\">%s</text>\n",
if (width > MIN_TEXT_SIZE)
fprintf(svgfile, "<text transform=\"translate(%4.8f,%4.8f) rotate(90)\" font-size=\"%3.4fpt\">%s</text>\n",
time2pixels(start), cpu2y(cpu), width, name);
}

Expand All @@ -193,8 +195,8 @@ void svg_cstate(int cpu, u64 start, u64 end, int type)
if (width > 6)
width = 6;

if (width > 0.05)
fprintf(svgfile, "<text transform=\"translate(%4.5f,%4.5f) rotate(90)\" font-size=\"%3.4fpt\">C%i</text>\n",
if (width > MIN_TEXT_SIZE)
fprintf(svgfile, "<text transform=\"translate(%4.8f,%4.8f) rotate(90)\" font-size=\"%3.4fpt\">C%i</text>\n",
time2pixels(start), cpu2y(cpu), width, type);
}

Expand Down Expand Up @@ -234,7 +236,7 @@ void svg_pstate(int cpu, u64 start, u64 end, u64 freq)
height = 1 + cpu2y(cpu) + SLOT_MULT + SLOT_HEIGHT - height;
fprintf(svgfile, "<line x1=\"%4.8f\" x2=\"%4.8f\" y1=\"%4.1f\" y2=\"%4.1f\" class=\"pstate\"/>\n",
time2pixels(start), time2pixels(end), height, height);
fprintf(svgfile, "<text transform=\"translate(%4.1f,%4.1f)\" font-size=\"0.25pt\">%s</text>\n",
fprintf(svgfile, "<text transform=\"translate(%4.8f,%4.8f)\" font-size=\"0.25pt\">%s</text>\n",
time2pixels(start), height+0.9, HzToHuman(freq));

}
Expand Down Expand Up @@ -311,7 +313,7 @@ void svg_text(int Yslot, u64 start, const char *text)
if (!svgfile)
return;

fprintf(svgfile, "<text transform=\"translate(%4.1f,%4.1f)\">%s</text>\n",
fprintf(svgfile, "<text transform=\"translate(%4.8f,%4.8f)\">%s</text>\n",
time2pixels(start), Yslot * SLOT_MULT+SLOT_HEIGHT/2, text);
}

Expand All @@ -322,7 +324,7 @@ static void svg_legenda_box(int X, const char *text, const char *style)

fprintf(svgfile, "<rect x=\"%i\" width=\"%4.8f\" y=\"0\" height=\"%4.1f\" class=\"%s\"/>\n",
X, boxsize, boxsize, style);
fprintf(svgfile, "<text transform=\"translate(%4.1f, %4.1f)\" font-size=\"%4.4fpt\">%s</text>\n",
fprintf(svgfile, "<text transform=\"translate(%4.8f, %4.8f)\" font-size=\"%4.4fpt\">%s</text>\n",
X + boxsize + 5, boxsize, 0.8 * boxsize, text);
}

Expand Down

0 comments on commit 35383c8

Please sign in to comment.