summaryrefslogtreecommitdiff
path: root/testsuite/tests/profiling
diff options
context:
space:
mode:
authorSven Tennie <sven.tennie@gmail.com>2021-04-03 19:35:34 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-09-23 15:59:38 -0400
commit29717ecb0711cd03796510fbe9b4bff58c7da870 (patch)
tree850a449ef01caeedf8fd8e9156e7eedcd5a028ce /testsuite/tests/profiling
parent6f7f59901c047882ba8c9ae8812264f86b12483a (diff)
downloadhaskell-29717ecb0711cd03796510fbe9b4bff58c7da870.tar.gz
Use Info Table Provenances to decode cloned stack (#18163)
Emit an Info Table Provenance Entry (IPE) for every stack represeted info table if -finfo-table-map is turned on. To decode a cloned stack, lookupIPE() is used. It provides a mapping between info tables and their source location. Please see these notes for details: - [Stacktraces from Info Table Provenance Entries (IPE based stack unwinding)] - [Mapping Info Tables to Source Positions] Metric Increase: T12545
Diffstat (limited to 'testsuite/tests/profiling')
-rw-r--r--testsuite/tests/profiling/should_run/T7275.stdout32
-rw-r--r--testsuite/tests/profiling/should_run/all.T6
-rw-r--r--testsuite/tests/profiling/should_run/staticcallstack001.hs7
-rw-r--r--testsuite/tests/profiling/should_run/staticcallstack001.stdout6
-rw-r--r--testsuite/tests/profiling/should_run/staticcallstack002.hs9
-rw-r--r--testsuite/tests/profiling/should_run/staticcallstack002.stdout8
6 files changed, 36 insertions, 32 deletions
diff --git a/testsuite/tests/profiling/should_run/T7275.stdout b/testsuite/tests/profiling/should_run/T7275.stdout
index d0146366a7..4dbeabc5c6 100644
--- a/testsuite/tests/profiling/should_run/T7275.stdout
+++ b/testsuite/tests/profiling/should_run/T7275.stdout
@@ -3,19 +3,19 @@
2
3
4
-(284)suzanne/robert
-(284)suzanne/robert
-(284)suzanne/robert
-(284)suzanne/robert
-(284)suzanne/robert
-(284)suzanne/robert
-(284)suzanne/robert
-(284)suzanne/robert
-(284)suzanne/robert
-(284)suzanne/robert
-(284)suzanne/robert
-(284)suzanne/robert
-(284)suzanne/robert
-(284)suzanne/robert
-(284)suzanne/robert
-(284)suzanne/robert
+(286)suzanne/robert
+(286)suzanne/robert
+(286)suzanne/robert
+(286)suzanne/robert
+(286)suzanne/robert
+(286)suzanne/robert
+(286)suzanne/robert
+(286)suzanne/robert
+(286)suzanne/robert
+(286)suzanne/robert
+(286)suzanne/robert
+(286)suzanne/robert
+(286)suzanne/robert
+(286)suzanne/robert
+(286)suzanne/robert
+(286)suzanne/robert
diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T
index b793bce24f..399ec3da71 100644
--- a/testsuite/tests/profiling/should_run/all.T
+++ b/testsuite/tests/profiling/should_run/all.T
@@ -14,13 +14,19 @@ test('dynamic-prof2', [only_ways(['normal']), extra_run_opts('+RTS -hT --no-auto
test('dynamic-prof3', [only_ways(['normal']), extra_run_opts('+RTS -hT --no-automatic-heap-samples')], compile_and_run, [''])
+# Remove the ipName field as it's volatile (depends on e.g. architecture and may change with every new GHC version)
+def normalise_InfoProv_ipName(str):
+ return re.sub('ipName = "\\w*"', '', str)
+
test('staticcallstack001',
[ omit_ways(['ghci-ext-prof']), # produces a different stack
+ normalise_fun(normalise_InfoProv_ipName)
], compile_and_run,
['-O0 -g3 -fdistinct-constructor-tables -finfo-table-map'])
test('staticcallstack002',
[ omit_ways(['ghci-ext-prof']), # produces a different stack
+ normalise_fun(normalise_InfoProv_ipName)
], compile_and_run,
['-O0 -g3 -fdistinct-constructor-tables -finfo-table-map'])
diff --git a/testsuite/tests/profiling/should_run/staticcallstack001.hs b/testsuite/tests/profiling/should_run/staticcallstack001.hs
index 78849d0ef1..e3e1407492 100644
--- a/testsuite/tests/profiling/should_run/staticcallstack001.hs
+++ b/testsuite/tests/profiling/should_run/staticcallstack001.hs
@@ -13,7 +13,6 @@ qq x = D x
caf = D 5
main = do
- print . tail =<< whereFrom (D 5)
- print . tail =<< whereFrom caf
- print . tail =<< whereFrom (id (D 5))
-
+ print =<< whereFrom (D 5)
+ print =<< whereFrom caf
+ print =<< whereFrom (id (D 5))
diff --git a/testsuite/tests/profiling/should_run/staticcallstack001.stdout b/testsuite/tests/profiling/should_run/staticcallstack001.stdout
index 7da74c81d9..6a701358e3 100644
--- a/testsuite/tests/profiling/should_run/staticcallstack001.stdout
+++ b/testsuite/tests/profiling/should_run/staticcallstack001.stdout
@@ -1,3 +1,3 @@
-["2","D","main","Main","staticcallstack001.hs:16:20-34"]
-["2","D","caf","Main","staticcallstack001.hs:13:1-9"]
-["15","D","main","Main","staticcallstack001.hs:18:30-39"]
+Just (InfoProv {ipName = "D_Main_4_con_info", ipDesc = "2", ipTyDesc = "D", ipLabel = "main", ipMod = "Main", ipLoc = "staticcallstack001.hs:16:13-27"})
+Just (InfoProv {ipName = "D_Main_2_con_info", ipDesc = "2", ipTyDesc = "D", ipLabel = "caf", ipMod = "Main", ipLoc = "staticcallstack001.hs:13:1-9"})
+Just (InfoProv {ipName = "sat_s11g_info", ipDesc = "15", ipTyDesc = "D", ipLabel = "main", ipMod = "Main", ipLoc = "staticcallstack001.hs:18:23-32"})
diff --git a/testsuite/tests/profiling/should_run/staticcallstack002.hs b/testsuite/tests/profiling/should_run/staticcallstack002.hs
index 87df13bee0..da3d66efb2 100644
--- a/testsuite/tests/profiling/should_run/staticcallstack002.hs
+++ b/testsuite/tests/profiling/should_run/staticcallstack002.hs
@@ -7,8 +7,7 @@ import GHC.Stack.CCS
-- a special case to not generate distinct info tables for unboxed
-- constructors.
main = do
- print . tail =<< whereFrom (undefined (# #))
- print . tail =<< whereFrom (undefined (# () #))
- print . tail =<< whereFrom (undefined (# (), () #))
- print . tail =<< whereFrom (undefined (# | () #))
-
+ print =<< whereFrom (undefined (# #))
+ print =<< whereFrom (undefined (# () #))
+ print =<< whereFrom (undefined (# (), () #))
+ print =<< whereFrom (undefined (# | () #))
diff --git a/testsuite/tests/profiling/should_run/staticcallstack002.stdout b/testsuite/tests/profiling/should_run/staticcallstack002.stdout
index c96b6fa7f3..d3b62d47d2 100644
--- a/testsuite/tests/profiling/should_run/staticcallstack002.stdout
+++ b/testsuite/tests/profiling/should_run/staticcallstack002.stdout
@@ -1,4 +1,4 @@
-["15","Any","main","Main","staticcallstack002.hs:10:30-46"]
-["15","Any","main","Main","staticcallstack002.hs:11:30-49"]
-["15","Any","main","Main","staticcallstack002.hs:12:30-53"]
-["15","Any","main","Main","staticcallstack002.hs:13:30-51"]
+Just (InfoProv {ipName = "sat_s10U_info", ipDesc = "15", ipTyDesc = "Any", ipLabel = "main", ipMod = "Main", ipLoc = "staticcallstack002.hs:10:23-39"})
+Just (InfoProv {ipName = "sat_s11a_info", ipDesc = "15", ipTyDesc = "Any", ipLabel = "main", ipMod = "Main", ipLoc = "staticcallstack002.hs:11:23-42"})
+Just (InfoProv {ipName = "sat_s11q_info", ipDesc = "15", ipTyDesc = "Any", ipLabel = "main", ipMod = "Main", ipLoc = "staticcallstack002.hs:12:23-46"})
+Just (InfoProv {ipName = "sat_s11G_info", ipDesc = "15", ipTyDesc = "Any", ipLabel = "main", ipMod = "Main", ipLoc = "staticcallstack002.hs:13:23-44"})