*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Parts of this file were imported from Jens Axboe's blktrace sources (also GPL)
*/
static char *colors[] = {
"blue", "darkgreen",
- "red", "aqua",
- "orange", "darkviolet",
+ "red",
+ "darkviolet",
+ "orange",
+ "aqua",
"brown", "#00FF00",
"yellow", "coral",
"black", "darkred",
return ret;
}
+char *pick_fio_color(void)
+{
+ static int fio_color_index;
+ char *ret = colors[fio_color_index];
+
+ if (!ret) {
+ fio_color_index = 0;
+ ret = colors[fio_color_index];
+ }
+ fio_color_index += 2;
+ return ret;
+}
+
static int cpu_color_index;
char *pick_cpu_color(void)
/* Round to power of 10 */
step = exp(floor(log(step) / log10) * log10);
/* Scale down step to provide enough ticks */
- while ((last - first) / (step * mini_step[cur_mini_step]) > num_ticks
- && cur_mini_step < TICK_MINI_STEPS)
+ while (cur_mini_step < TICK_MINI_STEPS
+ && (last - first) / (step * mini_step[cur_mini_step]) > num_ticks)
cur_mini_step++;
- step *= mini_step[cur_mini_step - 1];
+
+ if (cur_mini_step > 0)
+ step *= mini_step[cur_mini_step - 1];
return step;
}
"<circle cx=\"%.2f\" cy=\"%.2f\" "
"stroke=\"black\" stroke-width=\"6\" "
"r=\"%.2f\" fill=\"none\"/>\n",
- -spindle_steps * 1.2, center_x, center_y, center_x, center_y, graph_width_extra / 2);
+ spindle_steps * 1.2, center_x, center_y, center_x, center_y, graph_width_extra / 2);
write(plot->fd, line, strlen(line));
snprintf(line, line_len, "<circle cx=\"%.2f\" cy=\"%.2f\" "
"stroke=\"none\" fill=\"red\" r=\"%.2f\"/>\n</g>\n",
snprintf(line, line_len, "<path transform=\"rotate(%.4f, %.2f, %.2f)\" "
"d=\"M %.2f %.2f a %.2f %.2f 0 0 1 0 5\" "
"stroke=\"%s\" stroke-width=\"4\"/>\n",
- rot, center_x, center_y,
+ -rot, center_x, center_y,
axis_x_off_double(graph_width_extra / 2 + radius) + 8, center_y,
radius, radius, pph->color);