summaryrefslogtreecommitdiff
path: root/testsuite/tests/rts/all.T
diff options
context:
space:
mode:
authorSven Tennie <sven.tennie@gmail.com>2021-05-13 15:26:32 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-08-11 18:14:30 -0400
commitf5fdace5613914724eb00bcf7547c82f3ad12686 (patch)
treeeeaeb36a5b79192c19eed847a2663e13fbf8b1f8 /testsuite/tests/rts/all.T
parentc65a7ffa7d8962f769bfe1dfbad20e32e1709c20 (diff)
downloadhaskell-f5fdace5613914724eb00bcf7547c82f3ad12686.tar.gz
Optimize Info Table Provenance Entries (IPEs) Map creation and lookup
Using a hash map reduces the complexity of lookupIPE(), making it non linear. On registration each IPE list is added to a temporary IPE lists buffer, reducing registration time. The hash map is built lazily on first lookup. IPE event output to stderr is added with tests. For details, please see Note [The Info Table Provenance Entry (IPE) Map]. A performance test for IPE registration and lookup can be found here: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/5724#note_370806
Diffstat (limited to 'testsuite/tests/rts/all.T')
-rw-r--r--testsuite/tests/rts/all.T46
1 files changed, 46 insertions, 0 deletions
diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T
index aeab6b4b2e..d2146a3f48 100644
--- a/testsuite/tests/rts/all.T
+++ b/testsuite/tests/rts/all.T
@@ -171,6 +171,50 @@ test('EventlogOutput2',
omit_ways(['dyn', 'ghci'] + prof_ways) ],
makefile_test, ['EventlogOutput2'])
+# Test that Info Table Provenance (IPE) events are emitted.
+test('EventlogOutput_IPE',
+ [ extra_files(["EventlogOutput.hs"]),
+ only_ways(debug_ways),
+ ignore_stdout,
+ ignore_stderr
+ ],
+ makefile_test, ['EventlogOutput_IPE'])
+
+# Remove the capability prefix from IPE event log lines.
+def noCapabilityOutputFilter(s):
+ return re.sub(r'[a-f0-9]+: IPE:', 'IPE:', s)
+
+# Manually create IPE entries and dump them to event log (stderr).
+test('ipeEventLog',
+ [ c_src,
+ extra_files(['ipeEventLog_lib.c']),
+ extra_run_opts('+RTS -va -RTS'),
+ grep_errmsg('IPE:'),
+ only_ways(debug_ways),
+ normalise_errmsg_fun(noCapabilityOutputFilter),
+ ignore_stdout,
+ # Due to issues on Darwin CI runners that couldn't be tracked down.
+ # In general this test should work on Darwin - Just not on our CI.
+ when(opsys('darwin'), fragile(0))
+ ],
+ compile_and_run, ['ipeEventLog_lib.c -eventlog'])
+
+# Manually create IPE entries, force the initialization of the underlying hash map
+# and dump them to event log (stderr).
+test('ipeEventLog_fromMap',
+ [ c_src,
+ extra_files(['ipeEventLog_lib.c']),
+ extra_run_opts('+RTS -va -RTS'),
+ grep_errmsg('IPE:'),
+ only_ways(debug_ways),
+ normalise_errmsg_fun(noCapabilityOutputFilter),
+ ignore_stdout,
+ # Due to issues on Darwin CI runners that couldn't be tracked down.
+ # In general this test should work on Darwin - Just not on our CI.
+ when(opsys('darwin'), fragile(0))
+ ],
+ compile_and_run, ['ipeEventLog_lib.c -eventlog'])
+
test('T4059', [], makefile_test, ['T4059'])
# Test for #4274
@@ -440,3 +484,5 @@ test('T15427', normal, compile_and_run, [''])
test('T19481', extra_run_opts('+RTS -T -RTS'), compile_and_run, [''])
test('T19381', extra_run_opts('+RTS -T -RTS'), compile_and_run, [''])
test('T20199', normal, makefile_test, [])
+
+test('ipeMap', [c_src], compile_and_run, [''])