From patchwork Thu May 5 15:17:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 9025211 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5B4F1BF29F for ; Thu, 5 May 2016 15:17:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8CC062038D for ; Thu, 5 May 2016 15:17:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9021A20384 for ; Thu, 5 May 2016 15:17:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757173AbcEEPRT (ORCPT ); Thu, 5 May 2016 11:17:19 -0400 Received: from mx2.suse.de ([195.135.220.15]:33826 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756718AbcEEPRT (ORCPT ); Thu, 5 May 2016 11:17:19 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CAF7DABEB; Thu, 5 May 2016 15:17:17 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 78E281E09E5; Thu, 5 May 2016 17:17:16 +0200 (CEST) From: Jan Kara To: Jens Axboe Cc: linux-block@vger.kernel.org, Jan Kara Subject: [PATCH 2/9] Use maximum over all traces for queue depth Date: Thu, 5 May 2016 17:17:05 +0200 Message-Id: <1462461432-1900-3-git-send-email-jack@suse.cz> X-Mailer: git-send-email 2.6.6 In-Reply-To: <1462461432-1900-1-git-send-email-jack@suse.cz> References: <1462461432-1900-1-git-send-email-jack@suse.cz> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jan Kara 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 --- 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) {