[Git][ghc/ghc][wip/marge_bot_batch_merge_job] rts/printClosure: Print IPE information for thunks and functions
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Thu Jan 9 17:19:25 UTC 2025
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
85b6d82c by Ben Gamari at 2025-01-09T12:19:18-05:00
rts/printClosure: Print IPE information for thunks and functions
This makes it considerably easier to grok the structure of the heap
when IPE information is available.
- - - - -
1 changed file:
- rts/Printer.c
Changes:
=====================================
rts/Printer.c
=====================================
@@ -151,13 +151,20 @@ printClosure( const StgClosure *obj )
case FUN_1_0: case FUN_0_1:
case FUN_1_1: case FUN_0_2: case FUN_2_0:
case FUN_STATIC:
- debugBelch("FUN/%d(",(int)itbl_to_fun_itbl(info)->f.arity);
- printPtr((StgPtr)obj->header.info);
+ {
+ debugBelch("FUN/%d(",(int)itbl_to_fun_itbl(info)->f.arity);
+ printPtr((StgPtr)obj->header.info);
+
+ InfoProvEnt ipe;
+ if (lookupIPE(obj->header.info, &ipe)) {
+ debugBelch(", %s", ipe.prov.table_name);
+ }
#if defined(PROFILING)
- debugBelch(", %s", obj->header.prof.ccs->cc->label);
+ debugBelch(", %s", obj->header.prof.ccs->cc->label);
#endif
- printStdObjPayload(obj);
- break;
+ printStdObjPayload(obj);
+ break;
+ }
case PRIM:
debugBelch("PRIM(");
@@ -175,13 +182,19 @@ printClosure( const StgClosure *obj )
case THUNK_1_0: case THUNK_0_1:
case THUNK_1_1: case THUNK_0_2: case THUNK_2_0:
case THUNK_STATIC:
+ {
/* ToDo: will this work for THUNK_STATIC too? */
#if defined(PROFILING)
printThunkObject((StgThunk *)obj,GET_PROF_DESC(info));
#else
printThunkObject((StgThunk *)obj,"THUNK");
+ InfoProvEnt ipe;
+ if (lookupIPE(obj->header.info, &ipe)) {
+ debugBelch(", %s", ipe.prov.table_name);
+ }
#endif
break;
+ }
case THUNK_SELECTOR:
printStdObjHdr(obj, "THUNK_SELECTOR");
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/85b6d82ccba34621feeaa6dd7565c9f0729222ba
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/85b6d82ccba34621feeaa6dd7565c9f0729222ba
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20250109/ae9ae4b7/attachment-0001.html>
More information about the ghc-commits
mailing list