diff --git a/cunumeric/coverage.py b/cunumeric/coverage.py index 48831e3504..8f4fac7ce1 100644 --- a/cunumeric/coverage.py +++ b/cunumeric/coverage.py @@ -21,6 +21,7 @@ from typing import Any, Container, Mapping, Optional, cast import numpy as np +from legate.core import track_provenance from typing_extensions import Protocol from .runtime import runtime @@ -92,6 +93,7 @@ def implemented( if reporting: @wraps(func) + @track_provenance(runtime.legate_context, nested=True) def wrapper(*args: Any, **kwargs: Any) -> Any: location = find_last_user_frames( not runtime.args.report_dump_callstack @@ -106,6 +108,7 @@ def wrapper(*args: Any, **kwargs: Any) -> Any: else: @wraps(func) + @track_provenance(runtime.legate_context, nested=True) def wrapper(*args: Any, **kwargs: Any) -> Any: return func(*args, **kwargs) diff --git a/cunumeric/utils.py b/cunumeric/utils.py index 743065fc68..5bfd0b54ee 100644 --- a/cunumeric/utils.py +++ b/cunumeric/utils.py @@ -71,7 +71,8 @@ def find_last_user_frames(top_only: bool = True) -> str: for (last, _) in traceback.walk_stack(None): if "__name__" not in last.f_globals: continue - if not last.f_globals["__name__"].startswith("cunumeric"): + name = last.f_globals["__name__"] + if not any(name.startswith(pkg) for pkg in ("cunumeric", "legate")): break if top_only: