trace->io = (struct blk_io_trace *)trace->cur;
}
-int is_io_event(struct blk_io_trace *test)
+static int is_io_event(struct blk_io_trace *test)
{
char *message;
if (!(test->action & BLK_TC_ACT(BLK_TC_NOTIFY)))
return found;
}
-int parse_fio_bank_message(struct trace *trace, u64 *bank_ret, u64 *offset_ret,
+static int parse_fio_bank_message(struct trace *trace, u64 *bank_ret, u64 *offset_ret,
u64 *num_banks_ret)
{
char *s;
}
}
-u64 map_io(struct trace *trace, struct blk_io_trace *io)
+static u64 map_io(struct trace *trace, struct blk_io_trace *io)
{
struct dev_info *di = lookup_dev(trace, io);
u64 val = trace->io->sector << 9;
return gld;
}
-void free_line_data(struct graph_line_data *gld)
-{
- free(gld->label);
- free(gld);
-}
-
struct graph_dot_data *alloc_dot_data(unsigned int min_seconds,
unsigned int max_seconds,
u64 min_offset, u64 max_offset,
return gdd;
}
-void free_dot_data(struct graph_dot_data *gdd)
-{
- free(gdd);
-}
-
void set_gdd_bit(struct graph_dot_data *gdd, u64 offset, double bytes, double time)
{
double bytes_per_row = (double)(gdd->max_offset - gdd->min_offset + 1) / gdd->rows;
}
}
-void print_gdd(struct graph_dot_data *gdd)
-{
- int col = 0;
- int row = 0;
- int arr_index;
- u64 val;
- int bit_index;
- int bit_mod;
-
- for (row = gdd->rows - 1; row >= 0; row--) {
- for (col = 0; col < gdd->cols; col++) {
- bit_index = row * gdd->cols + col;
- arr_index = bit_index / sizeof(unsigned long);
- bit_mod = bit_index % sizeof(unsigned long);
-
- val = gdd->data[arr_index];
- if (val & (1 << bit_mod))
- printf("*");
- else
- printf(" ");
- }
- printf("\n");
- }
-}
-
static double rolling_avg(struct graph_line_pair *data, int index, int distance)
{
double sum = 0;
write(fd, defs_close, strlen(defs_close));
}
-void write_drop_shadow(struct plot *plot)
-{
- snprintf(line, line_len, "<rect x=\"0\" y=\"%d\" width=\"%d\" height=\"%d\" fill=\"white\"/>\n",
- plot->start_y_offset, plot->total_width, 45);
- write(plot->fd, line, strlen(line));
-
- snprintf(line, line_len, "<path d=\"M %d %d h %d v %d h %d t %d %d V %d H %d Z\" "
- "fill=\"white\" filter=\"url(#shadow)\"/>",
- 0, plot->start_y_offset,
- plot->total_width - graph_left_pad / 2,
- -plot->total_height, 24, 1, 1,
- plot->start_y_offset + 10, 0);
- write(plot->fd, line, strlen(line));
-
- snprintf(line, line_len, "<path d=\"M %d %d H %d V %d h %d V %d H %d Z\" "
- "fill=\"white\"/>",
- 0, plot->start_y_offset - 15, /* start */
- plot->total_width - graph_left_pad / 2 - 10, /* hline over */
- plot->start_y_offset - plot->total_height, /* vline up */
- 15, /*hline over */
- plot->start_y_offset, /* vline back down */
- 0);
- write(plot->fd, line, strlen(line));
-
- plot->start_y_offset += 45;
-}
-
/* svg y offset for the traditional 0,0 (bottom left corner) of the plot */
static int axis_y(void)
{
int svg_io_graph(struct plot *plot, struct graph_dot_data *gdd);
int svg_line_graph(struct plot *plot, struct graph_line_data *gld, char *color, int thresh1, int thresh2);
struct graph_line_data *alloc_line_data(unsigned int min_seconds, unsigned int max_seconds, unsigned int stop_seconds);
-void free_line_data(struct graph_line_data *gld);
struct graph_dot_data *alloc_dot_data(unsigned int min_seconds, unsigned int max_seconds, u64 min_offset, u64 max_offset, unsigned int stop_seconds, char *color, char *label);
-void free_dot_data(struct graph_dot_data *gdd);
void set_gdd_bit(struct graph_dot_data *gdd, u64 offset, double bytes, double time);
-void print_gdd(struct graph_dot_data *gdd);
void write_svg_header(int fd);
struct plot *alloc_plot(void);
int close_plot(struct plot *plot);
void set_ylabel(struct plot *plot, char *label);
void scale_line_graph_bytes(u64 *max, char **units, u64 factor);
void scale_line_graph_time(u64 *max, char **units);
-void write_drop_shadow(struct plot *plot);
void write_drop_shadow_line(struct plot *plot);
void svg_write_legend(struct plot *plot);
void svg_add_legend(struct plot *plot, char *text, char *extra, char *color);