summaryrefslogtreecommitdiff
path: root/bin/analyze-kconfig.py
diff options
context:
space:
mode:
authorBirte Kristina Friesel <birte.friesel@uos.de>2023-11-13 10:02:13 +0100
committerBirte Kristina Friesel <birte.friesel@uos.de>2023-11-13 10:02:13 +0100
commit442f3aab75c742d4177912e9f0bcdac8a6ca1e9f (patch)
treea2773ded8386cce3987c7dce193e00e6a44642a2 /bin/analyze-kconfig.py
parent04bf8770614a738736e1e64795cf88f0f763d33c (diff)
analyze-kconfig: support --function-override
Diffstat (limited to 'bin/analyze-kconfig.py')
-rwxr-xr-xbin/analyze-kconfig.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/bin/analyze-kconfig.py b/bin/analyze-kconfig.py
index 8b11084..51bee11 100755
--- a/bin/analyze-kconfig.py
+++ b/bin/analyze-kconfig.py
@@ -173,6 +173,14 @@ def main():
"Also plots the corresponding measurements. "
"If gplearn function is set, it is plotted using dashed lines.",
)
+ parser.add_argument(
+ "--function-override",
+ metavar="<name> <attribute> <function>[;<name> <attribute> <function>;...]",
+ type=str,
+ help="Manually specify the function to fit for <name> <attribute>. "
+ "A function specified this way bypasses parameter detection: "
+ "It is always assigned, even if the model seems to be independent of the parameters it references.",
+ )
parser.add_argument("kconfig_path", type=str, help="Path to Kconfig file")
parser.add_argument(
"model",
@@ -295,6 +303,12 @@ def main():
)
sys.exit(1)
+ function_override = dict()
+ if args.function_override:
+ for function_desc in args.function_override.split(";"):
+ state_or_tran, attribute, *function_str = function_desc.split(" ")
+ function_override[(state_or_tran, attribute)] = " ".join(function_str)
+
by_name, parameter_names = dfatool.utils.observations_to_by_name(observations)
if args.ignore_param:
@@ -353,6 +367,7 @@ def main():
force_tree=args.force_tree,
max_std=max_std,
compute_stats=not args.skip_param_stats,
+ function_override=function_override,
)
constructor_duration = time.time() - constructor_start
logging.debug(f"AnalyticModel(...) took {constructor_duration : 7.1f} seconds")