Skip to content

Commit

Permalink
Some linting
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippvK committed May 9, 2022
1 parent 62fde7c commit 382f811
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 4 additions & 6 deletions mlonmcu/feature/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -859,14 +859,12 @@ def cachesim_callback(stdout, metrics, artifacts):

return cachesim_callback


@register_feature("log_instrs")
class LogInstructions(TargetFeature):
"""Enable logging of the executed instructions of a simulator-based target."""

DEFAULTS = {
**FeatureBase.DEFAULTS,
"to_file": False
}
DEFAULTS = {**FeatureBase.DEFAULTS, "to_file": False}

def __init__(self, config=None):
super().__init__("log_instrs", config=config)
Expand Down Expand Up @@ -902,9 +900,9 @@ def log_instrs_callback(stdout, metrics, artifacts):
instrs = []
for line in stdout.split("\n"):
if target == "etiss_pulpino":
expr = re.compile(r'0x[a-fA-F0-9]+: .* \[.*\]')
expr = re.compile(r"0x[a-fA-F0-9]+: .* \[.*\]")
elif target == "spike":
expr = re.compile(r'core\s+\d+: 0x[a-fA-F0-9]+ \(0x[a-fA-F0-9]+\) .*')
expr = re.compile(r"core\s+\d+: 0x[a-fA-F0-9]+ \(0x[a-fA-F0-9]+\) .*")
match = expr.match(line)
if match is not None:
instrs.append(line)
Expand Down
4 changes: 3 additions & 1 deletion mlonmcu/session/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,9 @@ def get_report(self):
metrics = Metrics()
if RunStage.COMPILE in self.artifacts_per_stage:
if len(self.artifacts_per_stage[RunStage.COMPILE]) > 1: # TODO: look for artifact of type metrics instead
compile_metrics_artifact = lookup_artifacts(self.artifacts_per_stage[RunStage.COMPILE], name="metrics.csv")[0]
compile_metrics_artifact = lookup_artifacts(
self.artifacts_per_stage[RunStage.COMPILE], name="metrics.csv"
)[0]
compile_metrics = Metrics.from_csv(compile_metrics_artifact.content)
metrics = compile_metrics

Expand Down

0 comments on commit 382f811

Please sign in to comment.