From patchwork Thu May 5 15:17:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 9025291 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 89E39BF440 for ; Thu, 5 May 2016 15:17:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CF2B920390 for ; Thu, 5 May 2016 15:17:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 046942038D for ; Thu, 5 May 2016 15:17:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757429AbcEEPRW (ORCPT ); Thu, 5 May 2016 11:17:22 -0400 Received: from mx2.suse.de ([195.135.220.15]:33850 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757431AbcEEPRV (ORCPT ); Thu, 5 May 2016 11:17:21 -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 EF438ADC3; Thu, 5 May 2016 15:17:18 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 839571E09EB; 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 7/9] Don't prepend blktrace destination dir if we didn't run blktrace Date: Thu, 5 May 2016 17:17:10 +0200 Message-Id: <1462461432-1900-8-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 When user specifies trace files directly via -t option, it doesn't make sense to prepend blktrace destination directory to them (it is especially confusing if you specify absolute path names with -t option and this logic breaks the path names). So avoid that. Signed-off-by: Jan Kara --- iowatcher/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iowatcher/main.c b/iowatcher/main.c index 28ff4cbbb153..2d0349c083b7 100644 --- a/iowatcher/main.c +++ b/iowatcher/main.c @@ -328,7 +328,10 @@ static void read_traces(void) char *path = NULL; list_for_each_entry(tf, &all_traces, list) { - path = join_path(blktrace_dest_dir, tf->filename); + if (num_blktrace_devices) + path = join_path(blktrace_dest_dir, tf->filename); + else + path = strdup(tf->filename); trace = open_trace(path); if (!trace)