iowatcher: Add possibility to limit seconds from below
[blktrace.git] / iowatcher / plot.h
index 1d534dd6cf70ad5f6bd779bbc14ef535a4fc983b..fb9c63b5fba14790e41214563505e176a58bd173 100644 (file)
@@ -26,6 +26,10 @@ typedef __u32 u32;
 typedef __u16 u16;
 
 
+/* values for the plot direction field */
+#define PLOT_DOWN 0
+#define PLOT_ACROSS 1
+
 struct plot {
        int fd;
 
@@ -36,6 +40,7 @@ struct plot {
        int start_x_offset;
 
        int add_xlabel;
+       int no_legend;
 
        /*
         * these two are for anyone that wants
@@ -47,6 +52,14 @@ struct plot {
        char **legend_lines;
        int legend_index;
        int num_legend_lines;
+       int direction;
+
+       /*
+        * timeline is a vertical line through line graphs that
+        * is used by the movie mode to show where in the graph
+        * our current frame lives
+        */
+       int timeline;
 };
 
 struct graph_line_pair {
@@ -55,8 +68,11 @@ struct graph_line_pair {
 };
 
 struct graph_line_data {
-       /* total number of seconds in this graph */
-       int seconds;
+       /* beginning of an interval displayed by this graph */
+       int min_seconds;
+
+       /* end of an interval displayed by this graph */
+       int max_seconds;
 
        int stop_seconds;
 
@@ -69,16 +85,25 @@ struct graph_line_data {
 };
 
 struct graph_dot_data {
+       u64 min_offset;
        u64 max_offset;
+       u64 max_bank;
+       u64 max_bank_offset;
        u64 total_ios;
+       u64 total_bank_ios;
+
+       int add_bank_ios;
 
        /* in pixels, number of rows in our bitmap */
        int rows;
        /* in pixels, number of cols in our bitmap */
        int cols;
 
-       /* total number of seconds in this graph */
-       int seconds;
+       /* beginning of an interval displayed by this graph */
+       int min_seconds;
+
+       /* end of an interval displayed by this graph */
+       int max_seconds;
        int stop_seconds;
 
        /* label for the legend */
@@ -99,16 +124,17 @@ struct plot_history {
 };
 
 int svg_io_graph(struct plot *plot, struct graph_dot_data *gdd, char *color);
-int svg_line_graph(struct plot *plot, struct graph_line_data *gld, char *color);
-struct graph_line_data *alloc_line_data(int seconds, int stop_seconds);
+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);
 void free_line_data(struct graph_line_data *gld);
-struct graph_dot_data *alloc_dot_data(int seconds, u64 max_offset, int stop_seconds);
+struct graph_dot_data *alloc_dot_data(int min_seconds, int max_seconds, u64 min_offset, u64 max_offset, int stop_seconds);
 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);
+int close_plot_no_height(struct plot *plot);
 void setup_axis(struct plot *plot);
 void set_xticks(struct plot *plot, int num_ticks, int first, int last);
 void set_yticks(struct plot *plot, int num_ticks, int first, int last, char *units);
@@ -139,4 +165,5 @@ int close_plot_file(struct plot *plot);
 int svg_io_graph_movie_array_spindle(struct plot *plot, struct plot_history *ph);
 void rewind_spindle_steps(int num);
 void setup_axis_spindle(struct plot *plot);
+int close_plot_col(struct plot *plot);
 #endif