summaryrefslogtreecommitdiff
path: root/rts/ProfHeap.c
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2020-11-18 11:23:00 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2021-03-03 19:09:34 +0000
commit8402ea951b31e01a925ca691747d1757eaf31fcc (patch)
tree674d19535ff5bbd3c31ae723e62b148f240f4bb1 /rts/ProfHeap.c
parent2f7e879bd993b61d26db999246b34c1096d0f70e (diff)
downloadhaskell-8402ea951b31e01a925ca691747d1757eaf31fcc.tar.gz
Profiling by info table mode (-hi)
This profiling mode creates bands by the address of the info table for each closure. This provides a much more fine-grained profiling output than any of the other profiling modes. The `-hi` profiling mode does not require a profiling build.
Diffstat (limited to 'rts/ProfHeap.c')
-rw-r--r--rts/ProfHeap.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c
index f880f5f406..b05c34d80f 100644
--- a/rts/ProfHeap.c
+++ b/rts/ProfHeap.c
@@ -197,6 +197,9 @@ closureIdentity( const StgClosure *p )
return closure_type_names[info->type];
}
}
+ case HEAP_BY_INFO_TABLE: {
+ return get_itbl(p);
+ }
default:
barf("closureIdentity");
@@ -905,6 +908,12 @@ dumpCensus( Census *census )
traceHeapProfSampleString(0, (char *)ctr->identity,
count * sizeof(W_));
break;
+ case HEAP_BY_INFO_TABLE:
+ fprintf(hp_file, "%p", ctr->identity);
+ char str[100];
+ sprintf(str, "%p", ctr->identity);
+ traceHeapProfSampleString(0, str, count * sizeof(W_));
+ break;
#if defined(PROFILING)
case HEAP_BY_CCS:
fprint_ccs(hp_file, (CostCentreStack *)ctr->identity,