Skip to content

Commit

Permalink
Add support for Booster option --log-context (#4314)
Browse files Browse the repository at this point in the history
  • Loading branch information
tothtamas28 authored May 10, 2024
1 parent f206050 commit 5ecc626
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pyk/src/pyk/kore/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1293,6 +1293,8 @@ class BoosterServerArgs(KoreServerArgs, total=False):
fallback_on: Iterable[str | FallbackReason] | None
interim_simplification: int | None
no_post_exec_simplify: bool | None
log_context: Iterable[str] | None
not_log_context: Iterable[str] | None


class BoosterServer(KoreServer):
Expand All @@ -1304,6 +1306,8 @@ class BoosterServer(KoreServer):
_fallback_on: list[FallbackReason] | None
_interim_simplification: int | None
_no_post_exec_simplify: bool
_log_context: list[str]
_not_log_context: list[str]

def __init__(self, args: BoosterServerArgs):
self._llvm_kompiled_dir = Path(args['llvm_kompiled_dir'])
Expand All @@ -1328,6 +1332,8 @@ def __init__(self, args: BoosterServerArgs):

self._interim_simplification = args.get('interim_simplification')
self._no_post_exec_simplify = bool(args.get('no_post_exec_simplify'))
self._log_context = list(args.get('log_context') or [])
self._not_log_context = list(args.get('not_log_context') or [])

if not args.get('command'):
args['command'] = 'kore-rpc-booster'
Expand Down Expand Up @@ -1355,6 +1361,8 @@ def _extra_args(self) -> list[str]:
res += ['--interim-simplification', str(self._interim_simplification)]
if self._no_post_exec_simplify:
res += ['--no-post-exec-simplify']
res += [arg for glob in self._log_context for arg in ['--log-context', glob]]
res += [arg for glob in self._not_log_context for arg in ['--not-log-context', glob]]
return res

def _populate_bug_report(self, bug_report: BugReport) -> None:
Expand Down
3 changes: 3 additions & 0 deletions pyk/src/tests/integration/kore/test_kore_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,9 @@ def test_add_module_with_hash_name_as_id_second_fails(self, kore_client: KoreCli
{'fallback_on': ['Aborted', 'Stuck']},
{'interim_simplification': 3},
{'no_post_exec_simpify': True},
{'log_context': ['booster*']},
{'not_log_context': ['*detail']},
{'log_context': ['kore*', '*success*'], 'not_log_context': ['*constraint*', '*simplify*']},
)


Expand Down

0 comments on commit 5ecc626

Please sign in to comment.