diff options
Diffstat (limited to 'trace-plot.c')
| -rw-r--r-- | trace-plot.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/trace-plot.c b/trace-plot.c index 8376814..f8e23c0 100644 --- a/trace-plot.c +++ b/trace-plot.c | |||
| @@ -75,13 +75,14 @@ allocate_plot(struct graph_info *ginfo, | |||
| 75 | 75 | ||
| 76 | struct graph_plot * | 76 | struct graph_plot * |
| 77 | trace_graph_plot_append(struct graph_info *ginfo, | 77 | trace_graph_plot_append(struct graph_info *ginfo, |
| 78 | const char *label, const struct plot_callbacks *cb, | 78 | const char *label, enum graph_plot_type type, |
| 79 | void *data) | 79 | const struct plot_callbacks *cb, void *data) |
| 80 | { | 80 | { |
| 81 | struct graph_plot *plot; | 81 | struct graph_plot *plot; |
| 82 | 82 | ||
| 83 | plot = allocate_plot(ginfo, label, cb, data); | 83 | plot = allocate_plot(ginfo, label, cb, data); |
| 84 | 84 | ||
| 85 | plot->type = type; | ||
| 85 | plot->pos = ginfo->plots; | 86 | plot->pos = ginfo->plots; |
| 86 | 87 | ||
| 87 | if (!ginfo->plots) { | 88 | if (!ginfo->plots) { |
| @@ -105,21 +106,21 @@ trace_graph_plot_append(struct graph_info *ginfo, | |||
| 105 | 106 | ||
| 106 | struct graph_plot * | 107 | struct graph_plot * |
| 107 | trace_graph_plot_insert(struct graph_info *ginfo, | 108 | trace_graph_plot_insert(struct graph_info *ginfo, |
| 108 | int pos, | 109 | int pos, const char *label, enum graph_plot_type type, |
| 109 | const char *label, const struct plot_callbacks *cb, | 110 | const struct plot_callbacks *cb, void *data) |
| 110 | void *data) | ||
| 111 | { | 111 | { |
| 112 | struct graph_plot *plot; | 112 | struct graph_plot *plot; |
| 113 | int i; | 113 | int i; |
| 114 | 114 | ||
| 115 | if (pos >= ginfo->plots) | 115 | if (pos >= ginfo->plots) |
| 116 | return trace_graph_plot_append(ginfo, label, cb, data); | 116 | return trace_graph_plot_append(ginfo, label, type, cb, data); |
| 117 | 117 | ||
| 118 | if (pos < 0) | 118 | if (pos < 0) |
| 119 | pos = 0; | 119 | pos = 0; |
| 120 | 120 | ||
| 121 | plot = allocate_plot(ginfo, label, cb, data); | 121 | plot = allocate_plot(ginfo, label, cb, data); |
| 122 | plot->pos = pos; | 122 | plot->pos = pos; |
| 123 | plot->type = type; | ||
| 123 | ginfo->plot_array = realloc(ginfo->plot_array, | 124 | ginfo->plot_array = realloc(ginfo->plot_array, |
| 124 | sizeof(ginfo->plot_array[0]) * | 125 | sizeof(ginfo->plot_array[0]) * |
| 125 | (ginfo->plots + 1)); | 126 | (ginfo->plots + 1)); |
