TypeError caused by PeriodicWload.unscaled_duty_cycle_pct
Created by: chrisswinchatt-arm
Apologies for deviating from the standard bug report format, but I don't think it's necessary as the bug is straightforward. This bug is present at HEAD (at time of writing).
PeriodicWload.unscaled_duty_cycle_pct
passes a list to MultiSrcConf.get_key
which tries to use the list as a key and triggers the TypeError
.
The stack trace is pretty illustrative of what the problem is:
File ~/Work/experiments/lisa/lisa/wlgen/rta.py:2994, in PeriodicWload.unscaled_duty_cycle_pct(self, plat_info)
2991 capa = plat_info.get_nested_key(['cpu-capacities', 'rtapp'], quiet=True)[cpu]
2993 if freq is not None:
-> 2994 freqs = plat_info.get_key(['freqs'], quiet=True)[cpu]
2995 capa *= freq / max(freqs)
2997 capa /= PELT_SCALE
File ~/Work/experiments/lisa/lisa/conf.py:1769, in MultiSrcConf.get_key(self, key, src, eval_deferred, quiet)
1766 if key == '..':
1767 return self._parent
-> 1769 key_desc = self._structure[key]
1771 if isinstance(key_desc, LevelKeyDesc):
1772 return self._sublevel_map[key]
File ~/Work/experiments/lisa/lisa/conf.py:632, in LevelKeyDesc.__getitem__(self, key)
631 def __getitem__(self, key):
--> 632 self.check_allowed_key(key)
633 return self._key_map[key]
File ~/Work/experiments/lisa/lisa/conf.py:640, in LevelKeyDesc.check_allowed_key(self, key)
636 """
637 Checks that a given key is allowed under that levels
638 """
639 try:
--> 640 self._key_map[key]
641 except KeyError:
642 # pylint: disable=raise-missing-from
643 try:
TypeError: unhashable type: 'list'
As you can see, PeriodicWload.unscaled_duty_cycle_pct
passes a list of key names to MultiSrcConf.get_key
which then calls LevelKeyDesc.__getitem__
which calls LevelKeyDesc.check_allowed_key
which tries to use the list as a key into self._key_map
, thus triggering the TypeError
. The fix is presumably to change the list containing one string to just a string.