def strip_malloc(frames): idx = prof.find_frame_index(frames, 'malloc') if idx: return frames[(idx + 1):] return frames