From patchwork Thu May 5 15:17:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 9025231 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 43887BF29F for ; Thu, 5 May 2016 15:17:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6635520384 for ; Thu, 5 May 2016 15:17:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7510C2038D for ; Thu, 5 May 2016 15:17:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756605AbcEEPRU (ORCPT ); Thu, 5 May 2016 11:17:20 -0400 Received: from mx2.suse.de ([195.135.220.15]:33827 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756808AbcEEPRT (ORCPT ); Thu, 5 May 2016 11:17:19 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CD070AD89; Thu, 5 May 2016 15:17:17 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 7B9F21E09E7; 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 4/9] iowatcher: Use queue events if issue not available Date: Thu, 5 May 2016 17:17:07 +0200 Message-Id: <1462461432-1900-5-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 Currently queue depth and latency graphs are generated from ISSUE and COMPLETE events. For traces which miss the ISSUE events (e.g. from device mapper) use QUEUE events instead. The result won't be as great but it still conveys some useful information. Signed-off-by: Jan Kara --- iowatcher/blkparse.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/iowatcher/blkparse.c b/iowatcher/blkparse.c index ef33d5be79a1..78a16e5944c3 100644 --- a/iowatcher/blkparse.c +++ b/iowatcher/blkparse.c @@ -1097,8 +1097,17 @@ void add_pending_io(struct trace *trace, struct graph_line_data *gld) return; if (action == __BLK_TA_QUEUE) { - if (trace->found_issue || trace->found_completion) - hash_queued_io(trace->io); + if (trace->found_issue || trace->found_completion) { + pio = hash_queued_io(trace->io); + /* + * When there are no ISSUE events count depth and + * latency at least from queue events + */ + if (pio && !trace->found_issue) { + pio->dispatch_time = io->time; + goto account_io; + } + } return; } if (action == __BLK_TA_REQUEUE) { @@ -1118,6 +1127,7 @@ void add_pending_io(struct trace *trace, struct graph_line_data *gld) free(pio); } +account_io: ios_in_flight++; seconds = SECONDS(io->time);