From patchwork Mon Sep 24 14:23:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Monakhov X-Patchwork-Id: 186417 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id E63662C0086 for ; Tue, 25 Sep 2012 00:23:37 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755805Ab2IXOX3 (ORCPT ); Mon, 24 Sep 2012 10:23:29 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]:44315 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755795Ab2IXOX1 (ORCPT ); Mon, 24 Sep 2012 10:23:27 -0400 Received: by lbbgj3 with SMTP id gj3so6790206lbb.19 for ; Mon, 24 Sep 2012 07:23:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer; bh=Wnlc3BooUf8QxzyWuxHcA+IPsgJscqVM2B38aADzvRk=; b=dL7tK9JUZVLbsjM2+XJJUCplODZTrfeThmyLe+yA1s84rllZHD+J1LzHAIq9xrDMmJ 2AX/v3LxHmUsX/ZlBQANO47ax4lBUHd+DFnYcm8m5Jh/wNi7w2XFqvK0zF8/BTE1AkQP idCs0XpaTSokEJrpGNXLz8oXpEz4DchgIx+zstY9/EdULMlTNHzTMookn9CVHYCwx4QH Pr1i6VaLhvEoHJpP0VmJJzUF7W+CjQcVeOuoE7SOWAx4eae4NB3xyLCcuGbh9WJiwCbv jGAYaWQo3NekHH23ZHpKTQJKzGn+8vsvpzmoPtGDftNrADmdtncahhMZlO1I3BJZ7MLe JnHA== Received: by 10.112.103.68 with SMTP id fu4mr4455632lbb.56.1348496605203; Mon, 24 Sep 2012 07:23:25 -0700 (PDT) Received: from smtp.gmail.com (swsoft-msk-nat.sw.ru. [195.214.232.10]) by mx.google.com with ESMTPS id u5sm4338609lbg.8.2012.09.24.07.23.24 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 24 Sep 2012 07:23:24 -0700 (PDT) From: Dmitry Monakhov To: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: xfs@oss.sgi.com, hch@lst.de, Dmitry Monakhov Subject: [PATCH 1/6] xfstests: add fio requirement V2 Date: Mon, 24 Sep 2012 18:23:16 +0400 Message-Id: <1348496601-32637-1-git-send-email-dmonakhov@openvz.org> X-Mailer: git-send-email 1.7.7.6 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org FIO is very flexible io generator, i would call it IO swiss knife. Currently we have tonns of hardcoded application which reproduces some predefined scenario. This approach has obvious dissadvantages 1) Lack of flexability: one written it is hard to modify it in future 2) Code base is large, many routines written again and again At the same time add new fio based tast is just add simle INI file. This greatly simplify code review. I do beleve that some day we will replace most of hardcoded io binaries with fio. One who is planning to run $FIO_PROG should first check that system contains appropriate version which is able to handle jobfile for example: _require_fio 286-job.fio Signed-off-by: Dmitry Monakhov Reviewed-by: Dave Chinner --- common.config | 1 + common.rc | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 0 deletions(-) diff --git a/common.config b/common.config index 7bed1c5..d5c8956 100644 --- a/common.config +++ b/common.config @@ -158,6 +158,7 @@ export XFS_QUOTA_PROG="`set_prog_path xfs_quota`" export KILLALL_PROG="`set_prog_path killall`" export INDENT_PROG="`set_prog_path indent`" export XFS_COPY_PROG="`set_prog_path xfs_copy`" +export FIO_PROG="`set_prog_path fio`" # Generate a comparable xfsprogs version number in the form of # major * 10000 + minor * 100 + release diff --git a/common.rc b/common.rc index 602513a..f5027e7 100644 --- a/common.rc +++ b/common.rc @@ -1758,6 +1758,21 @@ _require_btrfs() [ $? -eq 0 ] || _notrun "$BTRFS_UTIL_PROG too old (must support $cmd)" } +# Check that fio is present, and it is able to execute given jobfile +_require_fio() +{ + job=$1 + + _require_command $FIO_PROG + if [ -z "$1" ]; then + return 1; + fi + + $FIO_PROG --warnings-fatal --showcmd $job >/dev/null 2>&1 + [ $? -eq 0 ] || _notrun "$FIO_PROG too old" +} + + # arg 1 is dev to remove and is output of the below eg. # ls -l /sys/class/block/sdd | rev | cut -d "/" -f 3 | rev _devmgt_remove()