Skip to content

Commit 6fbd12b

Browse files
committed
Revert "fix(callgrind): aggregate (cxt==0) and underflow leaks under a sentinel cxt"
This reverts commit 4a7c1d5.
1 parent 4a7c1d5 commit 6fbd12b

3 files changed

Lines changed: 0 additions & 32 deletions

File tree

callgrind/bbcc.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -518,13 +518,6 @@ static void handleUnderflow(BB* bb)
518518
"obj='%s' skip=%d\n",
519519
bb_addr(bb), caller->name,
520520
caller->file->obj->name, caller->skip);
521-
522-
/* A (sentinel): if the fn we'd return into is itself skipped, push
523-
* the (skipped) sentinel instead so the skipped fn doesn't surface
524-
* as its own fn= block in the dump. */
525-
if (caller->skip)
526-
caller = CLG_(get_skipped_sentinel)();
527-
528521
CLG_(push_cxt)( caller );
529522

530523
if (!seen_before) {
@@ -844,9 +837,6 @@ void CLG_(setup_bbcc)(BB* bb)
844837
push_fn->name,
845838
push_fn->file->obj->name,
846839
(int)jmpkind, (int)delayed_push);
847-
/* A (sentinel): substitute the (skipped) sentinel so the
848-
* skipped fn doesn't appear as its own fn= block in the dump. */
849-
push_fn = CLG_(get_skipped_sentinel)();
850840
}
851841
CLG_(push_cxt)(push_fn);
852842
}

callgrind/fn.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -336,27 +336,6 @@ static Bool name_contains(const HChar* hay, const HChar* needle)
336336
return False;
337337
}
338338

339-
static fn_node* new_fn_node(const HChar *fnname,
340-
file_node* file, fn_node* next);
341-
342-
/* Singleton sentinel fn_node used as a placeholder cxt when we'd
343-
* otherwise be forced to push a skipped fn into an empty (cxt == 0)
344-
* context. Keeping skip == False on the sentinel itself is crucial:
345-
* the (cxt == 0 && skip) check that would push it must NOT recurse
346-
* on the sentinel. */
347-
static fn_node* skipped_sentinel = NULL;
348-
349-
fn_node* CLG_(get_skipped_sentinel)(void)
350-
{
351-
if (skipped_sentinel) return skipped_sentinel;
352-
353-
obj_node* obj = CLG_(get_obj_node)(NULL); /* anonymous "???" obj */
354-
file_node* file = CLG_(get_file_node)(obj, "", "(callgrind-internal)");
355-
skipped_sentinel = new_fn_node("(skipped)", file, NULL);
356-
skipped_sentinel->skip = False;
357-
return skipped_sentinel;
358-
}
359-
360339
void CLG_(dump_python_fn_summary)(void)
361340
{
362341
Int total = 0, checked = 0, skipped = 0;

callgrind/global.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,6 @@ UInt* CLG_(get_fn_entry)(Int n);
725725
void CLG_(init_obj_table)(void);
726726
void CLG_(count_obj_skip_checked_fns)(Int* checked, Int* skipped);
727727
void CLG_(dump_python_fn_summary)(void);
728-
fn_node* CLG_(get_skipped_sentinel)(void);
729728
obj_node* CLG_(get_obj_node)(DebugInfo* si);
730729
file_node* CLG_(get_file_node)(obj_node*, const HChar *dirname,
731730
const HChar* filename);

0 commit comments

Comments
 (0)