Skip to content

Commit 697382c

Browse files
committed
feat: Add "Hide Python Internals" preset filter
Added a new preset filter to hide Python interpreter internal functions from profiles. This preset filters out: - Frames from binaries containing "python3" - Function names equal to "<interpreter trampoline>" - Function names equal to "<module>" This helps users focus on their application code rather than Python interpreter internals.
1 parent 5867f78 commit 697382c

File tree

1 file changed

+25
-0
lines changed
  • ui/packages/shared/profile/src/ProfileView/components/ProfileFilters

1 file changed

+25
-0
lines changed

ui/packages/shared/profile/src/ProfileView/components/ProfileFilters/filterPresets.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,31 @@ export const filterPresets: FilterPreset[] = [
124124
},
125125
],
126126
},
127+
{
128+
key: 'hide_python_internals',
129+
name: 'Hide Python Internals',
130+
description: 'Excludes Python interpreter internal functions from the profile',
131+
filters: [
132+
{
133+
type: 'frame',
134+
field: 'binary',
135+
matchType: 'not_contains',
136+
value: 'python3',
137+
},
138+
{
139+
type: 'frame',
140+
field: 'function_name',
141+
matchType: 'not_equal',
142+
value: '<interpreter trampoline>',
143+
},
144+
{
145+
type: 'frame',
146+
field: 'function_name',
147+
matchType: 'not_equal',
148+
value: '<module>',
149+
},
150+
],
151+
},
127152
];
128153

129154
const presetKeys = new Set(filterPresets.map(preset => preset.key));

0 commit comments

Comments
 (0)