Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1719556rdb; Tue, 20 Feb 2024 05:14:24 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXQpsoRVjCQa5sAif8KsY7ZACDYVGUiwLwa33903I1lL6tG+mhxawuxf0cvsolO0kQAZzJU3mj9Pt/dhz9XjxJgnJ/cYw6xEgozJCJymA== X-Google-Smtp-Source: AGHT+IGOGlPFsC8zPL9EXj4yzXgznu2E7k6f8kDyCNQjYn8gP8G/g1/i0ra1W/7AyE3B9S27updD X-Received: by 2002:a05:6359:4105:b0:179:fcb5:6ab3 with SMTP id kh5-20020a056359410500b00179fcb56ab3mr14470982rwc.19.1708434864527; Tue, 20 Feb 2024 05:14:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708434864; cv=pass; d=google.com; s=arc-20160816; b=eDxLwO0LFSKK0L7DJsZk80qSxwHeNgQbSjbLFU6jpXzgpVMA1NVWxYqn2NOAOMjLPx FahQlo2fdPQCiwktC4ZIdTPwgvGPn22MERCEFCyFEXKXOyyXoS3WQbnHjmvNVpVnb4xW MmyDeg4jUpD7fErgnj7PWP2sGQ50QoMPzSZov+so0HmgTHwK0GOZf/k2NpNenXpnxvix gwH/gUgPv1DDBson+EOBimyIs4SeYE/4b/tGFf9Vgf8RNrp4mw0ryF34rFcjgFUKukmX M5C6+/6PbPPVRGmM473CdAyiz1xpNK9EpQFwsAx043dsBIxy0yb7xkUYKVZqsdrw8WQE xbyQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=SH5AzHDvXWFjVjl9Fs+A/k9wR0Afc6/Q0p5ehogDoeI=; fh=zLusIiRnKIkHxYyyWBf7lTxuzV5DSc+pJ/IFR4bAOiw=; b=avk+42TH8ZURRSfvnz4EOE/UlTkH4o+51w/JXMsJxpCvgZBcvKcqlqgQ/AvEOVgpvR BF3U36FsK6Aw+NIDViyNQfJpXyhVk76O0b+jXX+mIioWLZrZYgrZOe+gId4u9csJXmyh 7X1fvMQ7Cp/W1juFrbl1/zqIIvng0rQqJ2yZWY1FbQNRkOcwkYGykRiNYbtvbguW9gw7 xQwHnzc0qdiYtoPtYbJpcJ8rh3zavNBVwIEE2Low4mDRjLU+NRZvndhn1RLNJREvCv3a dZD4+BV9MAOQ0ARTTS7ssNZ1ENzz7VHGPLUXsiX/BYpod7M22SHFd7DtaBeOqHhIViBV vZaA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="HxC/GN9G"; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-73057-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73057-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a26-20020a637f1a000000b005ceca1094c3si6087595pgd.853.2024.02.20.05.14.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 05:14:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73057-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="HxC/GN9G"; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-73057-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73057-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3245C283911 for ; Tue, 20 Feb 2024 13:14:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9B92A6A01A; Tue, 20 Feb 2024 13:14:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="HxC/GN9G" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E889C6A323; Tue, 20 Feb 2024 13:14:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708434860; cv=none; b=Vusyggcgyge1fQB0WSjoZjE43ZnfYIBnY3hFjryisc0pMJ+XEOAAd4PL9C3Hml32P0M4m00PdFRUGGlAfK9VjikbsHo0kcKsIpgp4hEXQ071KejDuNFJ2R0mY2ixYJXpb3s84Bo45KPQxeR/ORw/k1AcjD0j87GzytYlk7yWQi0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708434860; c=relaxed/simple; bh=KD8hrMdNCTWfLGe97FVEEX2aWGI4paDsXVz9quv/wPk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Bhc7JWsIPcpsQ9fd39Mpp1W8k2Lt7k4/94WAL33VJXG0exTFqpCMqFm6fIRGJiatjhGvIHj/tA9vbFxKiirEx3r4UGX1ri2PjQXtKkyEtMiB/HcMrCcMRn1oRZXad9kLqD97sL5L9IjTW6r23+r6gyhXojFCq+6ulnkBAlWNaj8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=HxC/GN9G; arc=none smtp.client-ip=192.198.163.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708434859; x=1739970859; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=KD8hrMdNCTWfLGe97FVEEX2aWGI4paDsXVz9quv/wPk=; b=HxC/GN9G1b4P31bcLT0O/nS7OqrRHJII0vZ00FLi7UsFB649TfCqRX3u dw5AfZMYNp3yGRBh+qcNvpI07ayGD4GkawlRV9XxUXczH4wA1hQAJMEs3 8+k85NMWRCwgsliSrRnVPlIoEH2OhSPGSZlWfvNcgdVs8lHl+o5pe5BKr /h7+DY9zHJPvxDSfM1BYs9iln9GND5cbbM1PyxbDNzJwRDmPsuCnsyltj qTZr1ZpAEQKm0wWFxKZ0teoeQhECMYq841vlyzEELsb7VI/xa2R0OViiC yI61H5uXAmDNlqtqOCzS/d0sv8X/TGsMgFhxum76g0kT8J3Acpit5eM0e g==; X-IronPort-AV: E=McAfee;i="6600,9927,10989"; a="6308538" X-IronPort-AV: E=Sophos;i="6.06,172,1705392000"; d="scan'208";a="6308538" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2024 05:14:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,172,1705392000"; d="scan'208";a="9415353" Received: from jmuniak-mobl.ger.corp.intel.com (HELO wieczorr-mobl1.intel.com) ([10.213.4.63]) by ORVIESA003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2024 05:14:15 -0800 From: Maciej Wieczor-Retman To: shuah@kernel.org, reinette.chatre@intel.com, fenghua.yu@intel.com Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, ilpo.jarvinen@linux.intel.com Subject: [PATCH 0/3] selftests/resctrl: Simplify test cleanup functions Date: Tue, 20 Feb 2024 14:14:05 +0100 Message-ID: X-Mailer: git-send-email 2.43.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cleaning up after tests is implemented separately for individual tests and called at the end of each test execution. Since these functions are very similar and a more generalized test framework was introduced a function pointer in the resctrl_test struct can be used to reduce the amount of function calls. These functions are also all called in the ctrl-c handler because the handler isn't aware which test is currently running. Since the handler is implemented with a sigaction no function parameters can be passed there but information about what test is currently running can be passed with a global variable. Maciej Wieczor-Retman (3): selftests/resctrl: Add cleanup function to test framework selftests/resctrl: Simplify cleanup in ctrl-c handler selftests/resctrl: Move cleanups out of individual tests tools/testing/selftests/resctrl/cat_test.c | 5 ++--- tools/testing/selftests/resctrl/cmt_test.c | 4 ++-- tools/testing/selftests/resctrl/mba_test.c | 5 ++--- tools/testing/selftests/resctrl/mbm_test.c | 5 ++--- tools/testing/selftests/resctrl/resctrl.h | 8 +++---- .../testing/selftests/resctrl/resctrl_tests.c | 22 ++++++++++--------- tools/testing/selftests/resctrl/resctrl_val.c | 2 +- 7 files changed, 25 insertions(+), 26 deletions(-) -- 2.43.2