From patchwork Mon Mar 4 21:16:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Crystal Wood X-Patchwork-Id: 777923 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 E07DD1C680 for ; Mon, 4 Mar 2024 21:16:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709587021; cv=none; b=iIQObSdmrkHT5LEytXgaAU79siSUCCBQasnumuTbeWoNsr9HIZ6a+dzzO3tG03YwlgMQU2g+ktrUgt8stDRHFGxEc2N/zY20eElImN1sCJrI+WbA6Cl0Xgp2Z2JkB+3AJWpmH1SkB5Bl3Q4RYkVF7vwRptVXawTsk/9konLnNQc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709587021; c=relaxed/simple; bh=jEuY/3ck8v+1Hm7T4GuvHEq2zZ8VKFpPPyUCO0Hm2jE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Br7LE3gMZKM93YcS+v7yp3ZMuC7l+chXZ31euVi0K7L95mxsMshPo945+S+csxuhvuVjABnBWxvV9UGfaUcugQTz2OFYz8NDUvibXq/qsxLp0zyfLxJAWWL4f7oHOOJOqAOXsrfzdzX6ptUfKGjFWGwy4RfoxXFFQgN7tL182ag= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=FAr+a8o8; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="FAr+a8o8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709587019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R/Nr4O9GMGjvDWMvuENkLm9jMH0tOPerFOKerhozOC8=; b=FAr+a8o8DGpfXkyXkuQkTleQSOMBkZg/8IrcJ1kUhFoNVLb7oE7aybhaI5AV4dLJ459PcG iYaZDpMOC42fZefMHDdJ0kXaJNDZ6/56zXxlPI/ccZRy2Fna8mbNg05AvtJVpVVG5G+N8B Unm9z6tPmUTi9W5ARoSslPe2v7MgHZE= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-625-saPJ16IDPpecR8iBYQqgUw-1; Mon, 04 Mar 2024 16:16:57 -0500 X-MC-Unique: saPJ16IDPpecR8iBYQqgUw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 02FA5386A0A3 for ; Mon, 4 Mar 2024 21:16:57 +0000 (UTC) Received: from p1g2.redhat.com (unknown [10.2.16.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9F419C185C4; Mon, 4 Mar 2024 21:16:56 +0000 (UTC) From: Crystal Wood To: John Kacur , Clark Williams Cc: linux-rt-users@vger.kernel.org, Crystal Wood Subject: [PATCH 1/5] rteval: default_config_search: Return None on failure Date: Mon, 4 Mar 2024 15:16:51 -0600 Message-ID: <20240304211655.20174-2-crwood@redhat.com> In-Reply-To: <20240304211655.20174-1-crwood@redhat.com> References: <20240304211655.20174-1-crwood@redhat.com> Precedence: bulk X-Mailing-List: linux-rt-users@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 If False is used without checking, it will be interpreted as stdin, hanging rteval waiting for input. OTOH, None will cause os.path.exists() to throw an exception, so we need to check both the name and the existence separately anyway. However, this is a better failure mode than hanging on stdin if the user of the filename fails to check both. Signed-off-by: Crystal Wood Signed-off-by: John Kacur --- I found this by trying to use "make install", which fails to install the XSL files... apparently data_files is deprecated. --- rteval/__init__.py | 2 +- rteval/rtevalConfig.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rteval/__init__.py b/rteval/__init__.py index ca018f6fd8b8..5d43615af5bb 100644 --- a/rteval/__init__.py +++ b/rteval/__init__.py @@ -76,7 +76,7 @@ class RtEval(rtevalReport): else: self.__mailer = None - if not os.path.exists(self.__rtevcfg.xslt_report): + if not self.__rtevcfg.xslt_report or not os.path.exists(self.__rtevcfg.xslt_report): raise RuntimeError(f"can't find XSL template ({self.__rtevcfg.xslt_report})!") # Add rteval directory into module search path diff --git a/rteval/rtevalConfig.py b/rteval/rtevalConfig.py index 030d4205efab..e62da25119a6 100644 --- a/rteval/rtevalConfig.py +++ b/rteval/rtevalConfig.py @@ -46,7 +46,7 @@ def default_config_search(relative_path, verifdef=os.path.isdir): if verifdef(os.path.join(path, *relative_path)): return os.path.join(path, *relative_path) - return False + return None # HACK: A temporary hack to try to figure out where the install dir is. From patchwork Mon Mar 4 21:16:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Crystal Wood X-Patchwork-Id: 779085 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 E2E801C68E for ; Mon, 4 Mar 2024 21:16:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709587021; cv=none; b=W2oa4XIwyPrbch6xP+n7t8miV/Hil52TIQpWFUc6IzSnpX3oeAXDJhMJhfdHVWVwVVrhRPFD+TOk8KBvWVnKvWoq3VX6rDOlH6OCDvQzcAg5aZ2dcBrJHx8PPpEkKiK0MYzEiLmKf55xdEcxq4mTHXMN5O348qiZrhQlYyNnlQY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709587021; c=relaxed/simple; bh=brDUcpkfbTIz8/yjNnFfpLhMcV+hclVQDZ0flZznQ/s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cX/3IMC05K3UTKEtFWw2GPnKavC4vrxp9nQDvqojtFOyE/rWZttLFRuYpfYBFyC0Drs1HdqmmVHySJ6WhJl8f1cUfADIXNMBiS4jUT3S/Bcj5Sw5wwDUcf8UmDLheJDJmGUOK5vpGcLFFo0a78waN0/D8U6her1B4Vyhr5012NQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=MyCY/sFI; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="MyCY/sFI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709587019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cJzsX4XksOd1oBfBKQEUMv6XEbObVLKNB7JG16pwJ88=; b=MyCY/sFI5tl/KTp/QEi+TWxRAMb2Z6O6k2aFuCq8+QMUgrE3ssSJH6FI8cTzMZQXXsObZj WGONYL8B6UPBP+eYOa5oBPGxyXGiYBxbaceoyYUXwXkvwOqaimnabGigvKM0xPrsZfozz1 xYeohx2qkxs5F4GbeM+qaR22dngxlZ4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-401-HEmg0kXyNiq-nyx-lmt98g-1; Mon, 04 Mar 2024 16:16:57 -0500 X-MC-Unique: HEmg0kXyNiq-nyx-lmt98g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7698B185A783 for ; Mon, 4 Mar 2024 21:16:57 +0000 (UTC) Received: from p1g2.redhat.com (unknown [10.2.16.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E8B1C0348A; Mon, 4 Mar 2024 21:16:57 +0000 (UTC) From: Crystal Wood To: John Kacur , Clark Williams Cc: linux-rt-users@vger.kernel.org, Crystal Wood Subject: [PATCH 2/5] rteval: kcompile: Fix path lookups in _remove_build_dirs Date: Mon, 4 Mar 2024 15:16:52 -0600 Message-ID: <20240304211655.20174-3-crwood@redhat.com> In-Reply-To: <20240304211655.20174-1-crwood@redhat.com> References: <20240304211655.20174-1-crwood@redhat.com> Precedence: bulk X-Mailing-List: linux-rt-users@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 - Use the actual source directory rather than the incorrect kernel* to match what the tarball generates - Use glob to expand the node* wildcard - Fix the incorrect variable name in the error message Signed-off-by: Crystal Wood Signed-off-by: John Kacur --- rteval/modules/loads/kcompile.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rteval/modules/loads/kcompile.py b/rteval/modules/loads/kcompile.py index b606f7aad202..de1539986723 100644 --- a/rteval/modules/loads/kcompile.py +++ b/rteval/modules/loads/kcompile.py @@ -145,12 +145,11 @@ class Kcompile(CommandLineLoad): return self._log(Log.DEBUG, f"removing kcompile directories in {self.builddir}") null = os.open("/dev/null", os.O_RDWR) - cmd = ["rm", "-rf", os.path.join(self.builddir, "kernel*"), - os.path.join(self.builddir, "node*")] + cmd = ["rm", "-rf", self.mydir, *glob.glob(os.path.join(self.builddir, 'node*'))] ret = subprocess.call(cmd, stdin=null, stdout=null, stderr=null) if ret: raise rtevalRuntimeError(self, \ - f"error removing builddir ({self.buildir}) (ret={ret})") + f"error removing builddir ({self.builddir}) (ret={ret})") def _find_tarball(self): # If the user specifies the full kernel name, check if available From patchwork Mon Mar 4 21:16:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Crystal Wood X-Patchwork-Id: 777921 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 7DF3E1C680 for ; Mon, 4 Mar 2024 21:17:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709587024; cv=none; b=e/Cdl7DPr8W3NXoqCr5oz0twEtFPYzc0iQAqdYt6S1DV6ZpAakQ2k68qjspv4oahu91m/97EPBOFWt9nQ2PzV/Mq8rE+hG6nFUZc+GWS1OKrs9rCA1jojm2c0jn1DZcIiUdeRUYb4de/rCTy4xwLPOnx52J6N81G5lDRpzmUmaQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709587024; c=relaxed/simple; bh=uX98SFFgziYiy4+wm1EWQTpJfyWR1kUpB6x2QIijUfE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LYuoz1gDvDTnGXDNjhE3KCo4s7qs3DJRzmEZhfciDy7qOgkAcI+7N9emUEgEO/TLrP3H99kxGveX4YDdpRdzR6h/EM3koSu4cfiZ28TOXUcKDA1bySHyttUcI04tgYHGNPCDZ/dSMwOqn+jQrfA4zQubmEffKrTTKEPlgaE/Nnw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=PJf62+Lk; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PJf62+Lk" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709587021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qkAyzFANXG9Dxa+xAqkZWrxeU8ste9r0xjWjvJxpuX4=; b=PJf62+LkgxGnCKFIN9mw5eROR5hhPvvRELnxNKVotqAaEVzAmBqbF2f4H9SQ1XY1X2GHid Cx03AesyTzhstetSio7Mv6FNfpGCur5jrdYM47QNS1opO/0BHd8XxzwfuCEob/b1ylKEEy ON1CvZMaQcY0Q2v6/IoFzX6f0tbDiBQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-487-LGnLh9XINjaE1GbpB6ovjw-1; Mon, 04 Mar 2024 16:16:58 -0500 X-MC-Unique: LGnLh9XINjaE1GbpB6ovjw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ED0AD185A789 for ; Mon, 4 Mar 2024 21:16:57 +0000 (UTC) Received: from p1g2.redhat.com (unknown [10.2.16.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 92FD4C0335E; Mon, 4 Mar 2024 21:16:57 +0000 (UTC) From: Crystal Wood To: John Kacur , Clark Williams Cc: linux-rt-users@vger.kernel.org, Crystal Wood Subject: [PATCH 3/5] rteval: kcompile: Skip mrproper, and re-extract if clean fails Date: Mon, 4 Mar 2024 15:16:53 -0600 Message-ID: <20240304211655.20174-4-crwood@redhat.com> In-Reply-To: <20240304211655.20174-1-crwood@redhat.com> References: <20240304211655.20174-1-crwood@redhat.com> Precedence: bulk X-Mailing-List: linux-rt-users@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 We only ever do out-of-tree builds, so the kernel directory should not be getting damaged except by incomplete extraction (which mrproper would probably not fix) or external meddling. So, skip the mrproper and instead re-extract if a "make clean" fails. Also, add -j to cleancmd to further speed things up. Startup speed may not seem all that important given how long rteval is typically run for, but this helps make quick tests (e.g. while debugging things, or when hunting a latency that shows up very quickly) less painful. On my 12-cpu laptop, this patch saves about 15 seconds of startup time. Signed-off-by: Crystal Wood --- rteval/modules/loads/kcompile.py | 40 ++++++++++++++------------------ 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/rteval/modules/loads/kcompile.py b/rteval/modules/loads/kcompile.py index de1539986723..db1941074157 100644 --- a/rteval/modules/loads/kcompile.py +++ b/rteval/modules/loads/kcompile.py @@ -54,7 +54,7 @@ class KBuildJob: self.jobs = self.calc_jobs_per_cpu() * cpus_available self.runcmd = f"make O={self.objdir} -C {self.kdir} -j{self.jobs}" - self.cleancmd = f"make O={self.objdir} -C {self.kdir} clean allmodconfig" + self.cleancmd = f"make O={self.objdir} -C {self.kdir} clean allmodconfig -j${self.jobs}" self.cleancmd += f"&& pushd {self.objdir} && {self.kdir}/scripts/config -d CONFIG_MODULE_SIG_SHA1 -e CONFIG_MODULE_SIG_SHA512 && popd && make O={self.objdir} -C {self.kdir} olddefconfig" if self.binder: self.runcmd = self.binder + " " + self.runcmd @@ -90,8 +90,8 @@ class KBuildJob: def clean(self, sin=None, sout=None, serr=None): """ Runs command to clean any previous builds and configure kernel """ self.log(Log.DEBUG, f"cleaning objdir {self.objdir}") - subprocess.call(self.cleancmd, shell=True, - stdin=sin, stdout=sout, stderr=serr) + return subprocess.call(self.cleancmd, shell=True, + stdin=sin, stdout=sout, stderr=serr) def run(self, sin=None, sout=None, serr=None): """ Use Popen to launch a kcompile job """ @@ -234,6 +234,10 @@ class Kcompile(CommandLineLoad): self.logger, self.cpus[n] if self.cpulist else None) self.args.append(str(self.buildjobs[n])+";") + def _repair_tarball(self): + self._log(Log.DEBUG, "Invalid state in kernel build tree, reloading") + self._remove_build_dirs() + self._extract_tarball() def _WorkloadBuild(self): if self._donotrun: @@ -246,30 +250,22 @@ class Kcompile(CommandLineLoad): else: out = err = null - # clean up any damage from previous runs - try: - cmd = ["make", "-C", self.mydir, "mrproper"] - ret = subprocess.call(cmd, stdin=null, stdout=out, stderr=err) + # clean up object dirs and make sure each has a config file + for n in self.nodes: + ret = self.buildjobs[n].clean(sin=null, sout=out, serr=err) if ret: - # if the above make failed, remove and reinstall the source tree - self._log(Log.DEBUG, "Invalid state in kernel build tree, reloading") - self._remove_build_dirs() - self._extract_tarball() - ret = subprocess.call(cmd, stdin=null, stdout=out, stderr=err) - if ret: - # give up - raise rtevalRuntimeError(self, f"kcompile setup failed: {ret}") - except KeyboardInterrupt as m: - self._log(Log.DEBUG, "keyboard interrupt, aborting") - return - self._log(Log.DEBUG, "ready to run") + self._repair_tarball() + ret = self.buildjobs[n].clean(sin=null, sout=out, serr=err) + if ret: + raise rtevalRuntimeError(self, f"kcompile setup failed: {ret}") + if self._logging: os.close(out) os.close(err) - # clean up object dirs and make sure each has a config file - for n in self.nodes: - self.buildjobs[n].clean(sin=null, sout=null, serr=null) + os.close(null) + + self._log(Log.DEBUG, "ready to run") self._setReady() def _WorkloadPrepare(self): From patchwork Mon Mar 4 21:16:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Crystal Wood X-Patchwork-Id: 777922 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 29D211C6AB for ; Mon, 4 Mar 2024 21:17:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709587022; cv=none; b=NVW6jHgCmDtZXIjvIR+TJVXbpZVlsJSl28/MEZvnk4xx7td0XntjI/XR5NpaW4uDmNKYnUqL1vtqDfSgem1pmJiVr075mqDRFqZtg0gnflBgpldrcFvKQWHgK9nLgG7WALNYLBXtVa2HvCISEsQGxjgSvM8cWY5ron9vKlO8GNk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709587022; c=relaxed/simple; bh=6u4bYi66EpqtJVfGAEsOtHbjFWhPEmsaPKO7W5NPq8Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ay1AWWENISSsnRBnoDRSuGKqNqXtdXpPiCwigIc92kGhI+6DoD4Jti2RBT3E5x/TGuL0ajcP0wS1eO/9WMtC4YOqgLYSHHrmWrfj/S8sRi4H1+QM5No0SXcwBgURwX8vyMUjxAV0YQSAtFnrC5UNp6rjzt6EozeoehD2jW6tWY0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=ddHrBeNs; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ddHrBeNs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709587020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FTyiSh6xED5lK0+1SnDSYcpOt7/tJzJITOQf8DXLxew=; b=ddHrBeNsFFICl4cJKSrCjWsQgG9DLF3CnGiHsyOFbOhc2QJs7YIdCB9cmdTjVxZpMZ/mbI PgYszINWw0sh3IiVOJtEkLgPth4pBda9w0gHVXO9X17MwyvpLpuXxYrZFROrGeIAhmz4J6 xvVDXw8BjnXYdommOozarJC6iXtbshA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-554-SNIlLbKHNFyypGBX-yn1Cw-1; Mon, 04 Mar 2024 16:16:58 -0500 X-MC-Unique: SNIlLbKHNFyypGBX-yn1Cw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6D81D83B82C for ; Mon, 4 Mar 2024 21:16:58 +0000 (UTC) Received: from p1g2.redhat.com (unknown [10.2.16.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 15877C185C4; Mon, 4 Mar 2024 21:16:58 +0000 (UTC) From: Crystal Wood To: John Kacur , Clark Williams Cc: linux-rt-users@vger.kernel.org, Crystal Wood Subject: [PATCH 4/5] rteval: Break out of main loop faster on interrupt/stoptime Date: Mon, 4 Mar 2024 15:16:54 -0600 Message-ID: <20240304211655.20174-5-crwood@redhat.com> In-Reply-To: <20240304211655.20174-1-crwood@redhat.com> References: <20240304211655.20174-1-crwood@redhat.com> Precedence: bulk X-Mailing-List: linux-rt-users@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 Waiting up to a full minute for rteval to stop on ctrl-c can be frustrating. Likewise, if a very short run is requested (e.g. for testing rteval itself) rounding it up to a minute is not polite. Signed-off-by: Crystal Wood Signed-off-by: John Kacur --- rteval/__init__.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/rteval/__init__.py b/rteval/__init__.py index 5d43615af5bb..72e3412a860e 100644 --- a/rteval/__init__.py +++ b/rteval/__init__.py @@ -32,12 +32,11 @@ RTEVAL_VERSION = version.RTEVAL_VERSION earlystop = False -stopsig_received = False +stopsig = threading.Event() def sig_handler(signum, frame): """ Handle SIGINT (CTRL + C) or SIGTERM (Termination signal) """ if signum in (signal.SIGINT, signal.SIGTERM): - global stopsig_received - stopsig_received = True + stopsig.set() print("*** stop signal received - stopping rteval run ***") else: raise RuntimeError(f"SIGNAL received! ({signum})") @@ -208,8 +207,8 @@ class RtEval(rtevalReport): currtime = time.time() rpttime = currtime + report_interval load_avg_checked = 5 - while (currtime <= stoptime) and not stopsig_received: - time.sleep(60.0) + while (currtime <= stoptime) and not stopsig.is_set(): + stopsig.wait(min(stoptime - currtime, 60.0)) if not measure_profile.isAlive(): stoptime = currtime earlystop = True @@ -238,7 +237,7 @@ class RtEval(rtevalReport): signal.signal(signal.SIGTERM, signal.SIG_DFL) except RuntimeError as err: - if not stopsig_received: + if not stopsig.is_set(): raise RuntimeError(f"appeared during measurement: {err}") finally: From patchwork Mon Mar 4 21:16:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Crystal Wood X-Patchwork-Id: 779084 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 A1BBC1EB3C for ; Mon, 4 Mar 2024 21:17:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709587023; cv=none; b=TM7NbbL0Ovf1+BqW6JGa2m21l/Copoq0986UuvV2VqdWISNoS/zcz4MFrX99vTIAt+HxIUSpjdugUs0S1TK3TOGu6EloW6ex+jjaRhg+3NAjVq4dISjn1F09J9JQMaKyWUaMRxu5QZbnDPD9/yX/pdRbJss7HYEo2vk2g3rTMS8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709587023; c=relaxed/simple; bh=BByDr97fyzS6ATSAcsqmR0lK4061B0mRb4GkgByzlvQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mW1UI7fG6/L0tPpN8hTlQ5EBiT56oICpYHqurdKRUAw/nExzo9KhGN8cYzC/5MIOxA78XIb3U8r11xU2cRzOaTlcmuVcRABMV//11xHpXqPZvlxkcJoVm2NC0IajqRP2qSDKefXxjgcROFw/CX7kEoIlQt6jPzgXMa19bMU/fm8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=YBROIf1I; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="YBROIf1I" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709587020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y5Wo0vp+4CitWwyz9OXjz3lSnHN+VdmA+STzQB+2+90=; b=YBROIf1IXfnarcMkPPHZulH1PK11gEPyIhNf9O91KxrtnuBqJMW3+anoBmnqUDJ7YBJdx/ 5Im102Qm2+UOV7/VismcPu2QzRRNci5s4gVTbW5PPXlUglH5PdA8aV0aMVoCE9xHKkI6Ja lUu9XCj5Thva+nDLYJxF0jC7A6dqkLs= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-138-60Ai9ItjNG6rIiHKngijXw-1; Mon, 04 Mar 2024 16:16:59 -0500 X-MC-Unique: 60Ai9ItjNG6rIiHKngijXw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E1D5F386A0A8 for ; Mon, 4 Mar 2024 21:16:58 +0000 (UTC) Received: from p1g2.redhat.com (unknown [10.2.16.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8A20FC03380; Mon, 4 Mar 2024 21:16:58 +0000 (UTC) From: Crystal Wood To: John Kacur , Clark Williams Cc: linux-rt-users@vger.kernel.org, Crystal Wood Subject: [PATCH 5/5] rteval: Remove 30 second "settling" period Date: Mon, 4 Mar 2024 15:16:55 -0600 Message-ID: <20240304211655.20174-6-crwood@redhat.com> In-Reply-To: <20240304211655.20174-1-crwood@redhat.com> References: <20240304211655.20174-1-crwood@redhat.com> Precedence: bulk X-Mailing-List: linux-rt-users@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 Waiting for 30 seconds for loads to "settle down" adds unneccesary delay to very short runs, besides being a giant hack. Load modules already have the opportunity to do setup beforehand. Even if there are a few seconds before the loads get to their expected "heaviness", that shouldn't meaningfully affect the output except for: - very short runs where you either - don't care about the latency because you're debugging rteval itself, or - are debugging a latency that reliably shows quickly, in which case consistent behavior is enough - latency spikes that only show up during load startup activity, in which case measuring it is a good thing - minimum latency values, which are not really the point of rteval. ...and the 30 second delay is *especially* useless if loads are disabled. Currently there's no official way to do that (as far as I can find), but it can be done by disabling all but stressng in the conf file, and not supplying stressng options on the command line. Signed-off-by: Crystal Wood Signed-off-by: John Kacur --- rteval/__init__.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/rteval/__init__.py b/rteval/__init__.py index 72e3412a860e..2c1dc1a7a22c 100644 --- a/rteval/__init__.py +++ b/rteval/__init__.py @@ -194,8 +194,6 @@ class RtEval(rtevalReport): nthreads = threading.active_count() else: nthreads = None - self.__logger.log(Log.INFO, "Waiting 30 seconds to let load modules settle down") - time.sleep(30) measure_profile.Unleash() measure_start = datetime.now()