struct trace *trace;
int ret;
int i;
- int time;
+ unsigned int time;
double user, sys, iowait, irq, soft;
double max_user = 0, max_sys = 0, max_iowait = 0,
max_irq = 0, max_soft = 0;
first_mpstat(trace);
- for (time = 0; time < tf->mpstat_stop_seconds; time ++) {
+ for (time = 0; time < tf->mpstat_stop_seconds; time++) {
for (i = 0; i < (trace->mpstat_num_cpus + 1) * MPSTAT_GRAPHS; i += MPSTAT_GRAPHS) {
ret = read_mpstat_event(trace, &user, &sys,
&iowait, &irq, &soft);
}
-static void compare_minmax_tf(struct trace_file *tf, int *max_seconds, u64 *min_offset, u64 *max_offset)
+static void compare_minmax_tf(struct trace_file *tf, unsigned int *max_seconds,
+ u64 *min_offset, u64 *max_offset)
{
if (tf->max_seconds > *max_seconds)
*max_seconds = tf->max_seconds;
*min_offset = tf->min_offset;
}
-static void set_all_minmax_tf(int min_seconds, int max_seconds, u64 min_offset, u64 max_offset)
+static void set_all_minmax_tf(unsigned int min_seconds,
+ unsigned int max_seconds,
+ u64 min_offset, u64 max_offset)
{
struct trace_file *tf;
struct list_head *traces = &all_traces;
return total_io_types;
}
-static void plot_io(struct plot *plot, int min_seconds, int max_seconds, u64 min_offset, u64 max_offset)
+static void plot_io(struct plot *plot, unsigned int min_seconds,
+ unsigned int max_seconds, u64 min_offset, u64 max_offset)
{
struct trace_file *tf;
int i;
close_plot(plot);
}
-static void plot_tput(struct plot *plot, int min_seconds, int max_seconds,
- int with_legend)
+static void plot_tput(struct plot *plot, unsigned int min_seconds,
+ unsigned int max_seconds, int with_legend)
{
struct trace_file *tf;
char *units;
total_graphs_written++;
}
-static void plot_fio_tput(struct plot *plot, int min_seconds, int max_seconds)
+static void plot_fio_tput(struct plot *plot,
+ unsigned int min_seconds, unsigned int max_seconds)
{
struct trace_file *tf;
char *units;
total_graphs_written++;
}
-static void plot_cpu(struct plot *plot, int max_seconds, char *label,
+static void plot_cpu(struct plot *plot, unsigned int max_seconds, char *label,
int active_index, int gld_index)
{
struct trace_file *tf;
int max = 0;
int i;
- int gld_i;
+ unsigned int gld_i;
char *color;
double avg = 0;
int ymax;
list_for_each_entry(tf, &all_traces, list) {
if (tf->mpstat_gld == 0)
break;
- for (i = tf->mpstat_gld[0]->min_seconds;
- i < tf->mpstat_gld[0]->stop_seconds; i++) {
- if (tf->mpstat_gld[gld_index]->data[i].count) {
- avg += (tf->mpstat_gld[gld_index]->data[i].sum /
- tf->mpstat_gld[gld_index]->data[i].count);
+ for (gld_i = tf->mpstat_gld[0]->min_seconds;
+ gld_i < tf->mpstat_gld[0]->stop_seconds; gld_i++) {
+ if (tf->mpstat_gld[gld_index]->data[gld_i].count) {
+ avg += (tf->mpstat_gld[gld_index]->data[gld_i].sum /
+ tf->mpstat_gld[gld_index]->data[gld_i].count);
}
}
avg /= tf->mpstat_gld[gld_index]->stop_seconds -
total_graphs_written++;
}
-static void plot_queue_depth(struct plot *plot, int min_seconds, int max_seconds)
+static void plot_queue_depth(struct plot *plot, unsigned int min_seconds,
+ unsigned int max_seconds)
{
struct trace_file *tf;
free(movie_dir);
}
-static void plot_latency(struct plot *plot, int min_seconds, int max_seconds)
+static void plot_latency(struct plot *plot, unsigned int min_seconds,
+ unsigned int max_seconds)
{
struct trace_file *tf;
char *units;
total_graphs_written++;
}
-static void plot_iops(struct plot *plot, int min_seconds, int max_seconds)
+static void plot_iops(struct plot *plot, unsigned int min_seconds,
+ unsigned int max_seconds)
{
struct trace_file *tf;
char *units;
int main(int ac, char **av)
{
struct plot *plot;
- int min_seconds = 0;
- int max_seconds = 0;
+ unsigned int min_seconds = 0;
+ unsigned int max_seconds = 0;
u64 max_offset = 0;
u64 min_offset = ~(u64)0;
struct trace_file *tf;
cpu_color_index = 0;
}
-struct graph_line_data *alloc_line_data(int min_seconds, int max_seconds, int stop_seconds)
+struct graph_line_data *alloc_line_data(unsigned int min_seconds,
+ unsigned int max_seconds,
+ unsigned int stop_seconds)
{
int size = sizeof(struct graph_line_data) + (stop_seconds + 1) * sizeof(struct graph_line_pair);
struct graph_line_data *gld;
free(gld);
}
-struct graph_dot_data *alloc_dot_data(int min_seconds, int max_seconds, u64 min_offset, u64 max_offset, int stop_seconds, char *color, char *label)
+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)
{
int size;
int arr_size;
int svg_line_graph(struct plot *plot, struct graph_line_data *gld, char *color, int thresh1, int thresh2)
{
- int i;
+ unsigned int i;
double val;
double avg;
int rolling;
struct graph_line_data {
/* beginning of an interval displayed by this graph */
- int min_seconds;
+ unsigned int min_seconds;
/* end of an interval displayed by this graph */
- int max_seconds;
+ unsigned int max_seconds;
- int stop_seconds;
+ unsigned int stop_seconds;
/* Y max */
u64 max;
int min_seconds;
/* end of an interval displayed by this graph */
- int max_seconds;
- int stop_seconds;
+ unsigned int max_seconds;
+ unsigned int stop_seconds;
/* label for the legend */
char *label;
void reset_cpu_color(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(int min_seconds, int max_seconds, int stop_seconds);
+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(int min_seconds, int max_seconds, u64 min_offset, u64 max_offset, int stop_seconds, char *color, char *label);
+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);