Skip to content

Commit 478f39d

Browse files
Copilotemeryberger
andcommitted
Fix @Profile decorator functionality by restoring original should_trace and profile_this_code logic
Co-authored-by: emeryberger <1612723+emeryberger@users.noreply.github.com>
1 parent 936ce75 commit 478f39d

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

scalene/scalene_profiler.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,10 +1262,6 @@ def memcpy_sigqueue_processor(
12621262
@functools.lru_cache(None)
12631263
def should_trace(filename: Filename, func: str) -> bool:
12641264
"""Return true if we should trace this filename and function."""
1265-
if Scalene.__trace_manager:
1266-
return Scalene.__trace_manager.should_trace(filename, func)
1267-
1268-
# Fallback to original logic if trace manager not initialized
12691265
if not filename:
12701266
return False
12711267
if Scalene.__profiler_base in filename:
@@ -1327,10 +1323,7 @@ def _passes_exclusion_rules(filename: Filename) -> bool:
13271323

13281324
# Check explicit exclude patterns
13291325
profile_exclude_list = Scalene.__args.profile_exclude.split(",")
1330-
if any(prof in filename for prof in profile_exclude_list if prof != ""):
1331-
return False
1332-
1333-
return True
1326+
return not any(prof in filename for prof in profile_exclude_list if prof != "")
13341327

13351328
@staticmethod
13361329
def _handle_jupyter_cell(filename: Filename) -> bool:

0 commit comments

Comments
 (0)