[PATCH 2/9] Use maximum over all traces for queue depth

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jan Kara <jack@xxxxxxxx>

So far we used maximum of the first trace for the maximum range of the
queue depth graph. Use maximum over all traces similarly as for other
line graphs.

Signed-off-by: Jan Kara <jack@xxxxxxxx>
---
 iowatcher/main.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/iowatcher/main.c b/iowatcher/main.c
index cbe915571c0e..b13f509ac943 100644
--- a/iowatcher/main.c
+++ b/iowatcher/main.c
@@ -991,6 +991,7 @@ static void plot_queue_depth(struct plot *plot, unsigned int min_seconds,
 			     unsigned int max_seconds)
 {
 	struct trace_file *tf;
+	u64 max = 0, val;
 
 	if (active_graphs[QUEUE_DEPTH_GRAPH_INDEX] == 0)
 		return;
@@ -1000,9 +1001,17 @@ static void plot_queue_depth(struct plot *plot, unsigned int min_seconds,
 	if (num_traces > 1)
 		svg_alloc_legend(plot, num_traces);
 
-	tf = list_entry(all_traces.next, struct trace_file, list);
+	list_for_each_entry(tf, &all_traces, list) {
+		val = line_graph_roll_avg_max(tf->queue_depth_gld);
+		if (val > max)
+			max = val;
+	}
+
+	list_for_each_entry(tf, &all_traces, list)
+		tf->queue_depth_gld->max = max;
+
 	set_ylabel(plot, "Pending IO");
-	set_yticks(plot, num_yticks, 0, tf->queue_depth_gld->max, "");
+	set_yticks(plot, num_yticks, 0, max, "");
 	set_xticks(plot, num_xticks, min_seconds, max_seconds);
 
 	list_for_each_entry(tf, &all_traces, list) {
-- 
2.6.6

--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux