From a4c3f5f46e850c977cda81c251036475aab8313c Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Thu, 23 Nov 2023 14:29:14 -0300 Subject: elf: Add a way to check if tunable is set (BZ 27069) The patch adds two new macros, TUNABLE_GET_DEFAULT and TUNABLE_IS_INITIALIZED, here the former get the default value with a signature similar to TUNABLE_GET, while the later returns whether the tunable was set by the environment variable. Checked on x86_64-linux-gnu. Reviewed-by: DJ Delorie Tested-by: Zhangfei Gao --- scripts/gen-tunables.awk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/gen-tunables.awk b/scripts/gen-tunables.awk index 1e9d6b534e..9f5336381e 100644 --- a/scripts/gen-tunables.awk +++ b/scripts/gen-tunables.awk @@ -163,8 +163,8 @@ END { n = indices[2]; m = indices[3]; printf (" {TUNABLE_NAME_S(%s, %s, %s)", t, n, m) - printf (", {TUNABLE_TYPE_%s, %s, %s}, {%s}, false, %s},\n", - types[t,n,m], minvals[t,n,m], maxvals[t,n,m], + printf (", {TUNABLE_TYPE_%s, %s, %s}, {%s}, {%s}, false, %s},\n", + types[t,n,m], minvals[t,n,m], maxvals[t,n,m], default_val[t,n,m], default_val[t,n,m], env_alias[t,n,m]); } print "};" -- cgit 1.4.1