From 1623ac4a85c8c436d1fb403a30b1799fc15a3dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Thu, 30 Mar 2017 16:08:45 +0200 Subject: [PATCH] assertion_non_equal: improved logging for better readability MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jaroslav Škarvada --- profiles/realtime/tuned.conf | 6 +++++- tuned/profiles/functions/function_assertion_non_equal.py | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/profiles/realtime/tuned.conf b/profiles/realtime/tuned.conf index e1b6bcd..2592681 100644 --- a/profiles/realtime/tuned.conf +++ b/profiles/realtime/tuned.conf @@ -10,13 +10,17 @@ include = network-latency [variables] # User is responsible for updating variables.conf with variable content such as isolated_cores=X-Y include = /etc/tuned/realtime-variables.conf + +# Fail if isolated_cores are not set +assert1=${f:assertion_non_equal:isolated_cores unset:${isolated_cores}:\${isolated_cores}} + # Non-isolated cores cpumask including offline cores not_isolated_cpumask = ${f:cpulist2hex_invert:${isolated_cores}} isolated_cores_expanded=${f:cpulist_unpack:${isolated_cores}} isolated_cores_present_expanded=${f:cpulist_present:${isolated_cores}} # Fail if isolated_cores contains CPUs which are not present -assert=${f:assertion:isolated_cores contains present CPU(s):${isolated_cores_expanded}:${isolated_cores_present_expanded}} +assert2=${f:assertion:isolated_cores contains present CPU(s):${isolated_cores_expanded}:${isolated_cores_present_expanded}} [sysctl] kernel.hung_task_timeout_secs = 600 diff --git a/tuned/profiles/functions/function_assertion_non_equal.py b/tuned/profiles/functions/function_assertion_non_equal.py index f247163..a678bf2 100644 --- a/tuned/profiles/functions/function_assertion_non_equal.py +++ b/tuned/profiles/functions/function_assertion_non_equal.py @@ -20,6 +20,6 @@ class assertion_non_equal(base.Function): if not super(self.__class__, self).execute(args): return None if args[1] != args[2]: - log.error("assertion non equal '%s' failed: '%s' == '%s'" % (args[0], args[1], args[2])) - raise InvalidProfileException("Assertion non equal '%s' failed." % args[0]) + log.error("assertion '%s' failed: '%s' == '%s'" % (args[0], args[1], args[2])) + raise InvalidProfileException("Assertion '%s' failed." % args[0]) return None