Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC

Commits:

12 changed files:

Changes:

  • docs/users_guide/runtime_control.rst
    ... ... @@ -1588,6 +1588,7 @@ recommended for everyday use!
    1588 1588
     
    
    1589 1589
     .. rts-flag::  -Ds  DEBUG: scheduler
    
    1590 1590
     .. rts-flag::  -Di  DEBUG: interpreter
    
    1591
    +.. rts-flag::  -DI  DEBUG: IPE
    
    1591 1592
     .. rts-flag::  -Dw  DEBUG: weak
    
    1592 1593
     .. rts-flag::  -DG  DEBUG: gccafs
    
    1593 1594
     .. rts-flag::  -Dg  DEBUG: gc
    

  • hadrian/src/Flavour.hs
    ... ... @@ -384,9 +384,15 @@ omitPragmas = addArgs
    384 384
     -- | Build stage2 dependencies with options to enable IPE debugging
    
    385 385
     -- information.
    
    386 386
     enableIPE :: Flavour -> Flavour
    
    387
    -enableIPE = addArgs
    
    388
    -    $ notStage0 ? builder (Ghc CompileHs)
    
    389
    -    ? pure ["-finfo-table-map", "-fdistinct-constructor-tables"]
    
    387
    +enableIPE =
    
    388
    +  addArgs $
    
    389
    +    mconcat
    
    390
    +      [ notStage0
    
    391
    +          ? builder (Ghc CompileHs)
    
    392
    +          ? pure
    
    393
    +            ["-finfo-table-map", "-fdistinct-constructor-tables"],
    
    394
    +        builder Testsuite ? arg "--config=ghc_with_ipe=True"
    
    395
    +      ]
    
    390 396
     
    
    391 397
     enableLateCCS :: Flavour -> Flavour
    
    392 398
     enableLateCCS = addArgs
    

  • libraries/ghc-compact/tests/all.T
    ... ... @@ -20,7 +20,8 @@ test('compact_gc', [fragile_for(17253, ['ghci']), ignore_stdout], compile_and_ru
    20 20
     # this test computes closure sizes and those are affected
    
    21 21
     # by the ghci and prof ways, because of BCOs and profiling headers.
    
    22 22
     # Optimization levels slightly change what is/isn't shared so only run in normal mode
    
    23
    -test('compact_share', only_ways(['normal']), compile_and_run, [''])
    
    23
    +test('compact_share', [only_ways(['normal']), when(ghc_with_ipe(), skip)], # IPE changes allocation/layout affecting compactSize output.
    
    24
    +     compile_and_run, [''])
    
    24 25
     test('compact_bench', [ ignore_stdout, extra_run_opts('100') ],
    
    25 26
                            compile_and_run, [''])
    
    26 27
     test('T17044', normal, compile_and_run, [''])
    

  • libraries/ghc-internal/tests/backtraces/all.T
    ... ... @@ -2,5 +2,5 @@ test('T14532a', [], compile_and_run, [''])
    2 2
     test('T14532b', [], compile_and_run, [''])
    
    3 3
     test('T26507', [ when(have_profiling(), extra_ways(['prof']))
    
    4 4
                    , when(js_arch(), skip)
    
    5
    -	       , exit_code(1)], compile_and_run, [''])
    
    6
    -
    5
    +               , when(ghc_with_ipe(), skip) # IPE builds include an IPE backtrace section on stderr.
    
    6
    +               , exit_code(1)], compile_and_run, [''])

  • rts/RtsFlags.c
    ... ... @@ -209,6 +209,8 @@ void initRtsFlagsDefaults(void)
    209 209
         RtsFlags.DebugFlags.numa            = false;
    
    210 210
         RtsFlags.DebugFlags.compact         = false;
    
    211 211
         RtsFlags.DebugFlags.continuation    = false;
    
    212
    +    RtsFlags.DebugFlags.iomanager       = false;
    
    213
    +    RtsFlags.DebugFlags.ipe             = false;
    
    212 214
     
    
    213 215
     #if defined(PROFILING)
    
    214 216
         RtsFlags.CcFlags.doCostCentres      = COST_CENTRES_NONE;
    
    ... ... @@ -482,6 +484,7 @@ usage_text[] = {
    482 484
     #if defined(DEBUG)
    
    483 485
     "  -Ds  DEBUG: scheduler",
    
    484 486
     "  -Di  DEBUG: interpreter",
    
    487
    +"  -DI  DEBUG: IPE",
    
    485 488
     "  -Dw  DEBUG: weak",
    
    486 489
     "  -DG  DEBUG: gccafs",
    
    487 490
     "  -Dg  DEBUG: gc",
    
    ... ... @@ -2311,6 +2314,9 @@ static void read_debug_flags(const char* arg)
    2311 2314
             case 'o':
    
    2312 2315
                 RtsFlags.DebugFlags.iomanager = true;
    
    2313 2316
                 break;
    
    2317
    +        case 'I':
    
    2318
    +            RtsFlags.DebugFlags.ipe = true;
    
    2319
    +            break;
    
    2314 2320
             default:
    
    2315 2321
                 bad_option( arg );
    
    2316 2322
             }
    

  • rts/Trace.c
    ... ... @@ -685,7 +685,8 @@ void traceHeapProfSampleString(const char *label, StgWord residency)
    685 685
     void traceIPE(const InfoProvEnt *ipe)
    
    686 686
     {
    
    687 687
     #if defined(DEBUG)
    
    688
    -    if (RtsFlags.TraceFlags.tracing == TRACE_STDERR) {
    
    688
    +    if (RtsFlags.TraceFlags.tracing == TRACE_STDERR
    
    689
    +        && RtsFlags.DebugFlags.ipe) {
    
    689 690
             ACQUIRE_LOCK(&trace_utx);
    
    690 691
     
    
    691 692
             char closure_desc_buf[CLOSURE_DESC_BUFFER_SIZE] = {};
    

  • rts/include/rts/Flags.h
    ... ... @@ -118,6 +118,7 @@ typedef struct _DEBUG_FLAGS {
    118 118
         bool compact;        /* 'C' */
    
    119 119
         bool continuation;   /* 'k' */
    
    120 120
         bool iomanager;      /* 'o' */
    
    121
    +    bool ipe;            /* 'I' */
    
    121 122
     } DEBUG_FLAGS;
    
    122 123
     
    
    123 124
     /* See Note [Synchronization of flags and base APIs] */
    

  • testsuite/driver/testglobals.py
    ... ... @@ -72,6 +72,10 @@ class TestConfig:
    72 72
             # Was the compiler compiled with -debug?
    
    73 73
             self.debug_rts = False
    
    74 74
     
    
    75
    +        # Were the compiler + libraries built with IPE-related options
    
    76
    +        # (e.g. -finfo-table-map, -fdistinct-constructor-tables)?
    
    77
    +        self.ghc_with_ipe = False
    
    78
    +
    
    75 79
             # Was the compiler compiled with LLVM?
    
    76 80
             self.ghc_built_by_llvm = False
    
    77 81
     
    

  • testsuite/driver/testlib.py
    ... ... @@ -1074,6 +1074,9 @@ def have_profiling( ) -> bool:
    1074 1074
     def have_threaded( ) -> bool:
    
    1075 1075
         return config.ghc_with_threaded_rts
    
    1076 1076
     
    
    1077
    +def ghc_with_ipe( ) -> bool:
    
    1078
    +    return config.ghc_with_ipe
    
    1079
    +
    
    1077 1080
     def in_tree_compiler( ) -> bool:
    
    1078 1081
         return config.in_tree_compiler
    
    1079 1082
     
    

  • testsuite/tests/rts/Makefile
    ... ... @@ -140,7 +140,7 @@ T20199:
    140 140
     .PHONY: EventlogOutput_IPE
    
    141 141
     EventlogOutput_IPE:
    
    142 142
     	"$(TEST_HC)" $(TEST_HC_OPTS) -debug -finfo-table-map -v0 EventlogOutput.hs
    
    143
    -	./EventlogOutput +RTS -va 2> EventlogOutput_IPE.stderr.log
    
    143
    +	./EventlogOutput +RTS -va -DI 2> EventlogOutput_IPE.stderr.log
    
    144 144
     	grep "IPE:" EventlogOutput_IPE.stderr.log
    
    145 145
     
    
    146 146
     .PHONY: T23142
    

  • testsuite/tests/rts/all.T
    ... ... @@ -535,6 +535,7 @@ test('T13676',
    535 535
     test('InitEventLogging',
    
    536 536
          [ only_ways(['normal'])
    
    537 537
          , extra_run_opts('+RTS -RTS')
    
    538
    +     , when(ghc_with_ipe(), skip) # IPE builds can change eventlog writer call counts.
    
    538 539
          , req_c
    
    539 540
          ],
    
    540 541
          compile_and_run, ['InitEventLogging_c.c'])
    
    ... ... @@ -588,6 +589,7 @@ test('cloneThreadStack', [req_c, only_ways(['threaded1']), extra_ways(['threaded
    588 589
     
    
    589 590
     test('decodeMyStack',
    
    590 591
       [ omit_ghci, js_broken(22261) # cloneMyStack# not yet implemented
    
    592
    +  , when(ghc_with_ipe(), skip) # IPE builds can change decoded stack output.
    
    591 593
       ], compile_and_run, ['-finfo-table-map'])
    
    592 594
     
    
    593 595
     # Options:
    
    ... ... @@ -595,6 +597,7 @@ test('decodeMyStack',
    595 597
     test('decodeMyStack_underflowFrames',
    
    596 598
       [ extra_run_opts('+RTS -kc8K -RTS')
    
    597 599
       , omit_ghci, js_broken(22261) # cloneMyStack# not yet implemented
    
    600
    +  , when(ghc_with_ipe(), skip) # IPE builds can change decoded stack layout/length.
    
    598 601
       ], compile_and_run, ['-finfo-table-map -rtsopts'])
    
    599 602
     
    
    600 603
     # -finfo-table-map intentionally missing
    
    ... ... @@ -602,6 +605,7 @@ test('decodeMyStack_emptyListForMissingFlag',
    602 605
       [ ignore_stdout
    
    603 606
       , ignore_stderr
    
    604 607
       , js_broken(22261) # cloneMyStack# not yet implemented
    
    608
    +  , when(ghc_with_ipe(), skip) # IPE builds can populate IPE info even without -finfo-table-map on this module.
    
    605 609
       ], compile_and_run, [''])
    
    606 610
     
    
    607 611
     # Tests RTS flag parsing. Skipped on JS as it uses a distinct RTS.
    
    ... ... @@ -646,7 +650,7 @@ test('T25280', [unless(opsys('linux'),skip),req_process,js_skip], compile_and_ru
    646 650
     test('T25560', [req_c_rts, ignore_stderr], compile_and_run, [''])
    
    647 651
     
    
    648 652
     test('TestProddableBlockSet', [req_c_rts], multimod_compile_and_run, ['TestProddableBlockSet.c', '-no-hs-main'])
    
    649
    -test('T22859', 
    
    653
    +test('T22859',
    
    650 654
          [js_skip,
    
    651 655
           # This test is vulnerable to changes in allocation behaviour, so we disable it in some ways
    
    652 656
           when(arch('wasm32'), skip),
    

  • testsuite/tests/rts/ipe/all.T
    ... ... @@ -8,7 +8,7 @@ test('ipeMap', [extra_files(['ipe_lib.c', 'ipe_lib.h']), c_src, omit_ghci], comp
    8 8
     test('ipeEventLog',
    
    9 9
          [ c_src,
    
    10 10
            extra_files(['ipe_lib.c', 'ipe_lib.h']),
    
    11
    -       extra_run_opts('+RTS -va -RTS'),
    
    11
    +       extra_run_opts('+RTS -va -DI -RTS'),
    
    12 12
            grep_errmsg('table_name_'),
    
    13 13
            only_ways(debug_ways),
    
    14 14
            normalise_errmsg_fun(noCapabilityOutputFilter),
    
    ... ... @@ -24,7 +24,7 @@ test('ipeEventLog',
    24 24
     test('ipeEventLog_fromMap',
    
    25 25
          [ c_src,
    
    26 26
            extra_files(['ipe_lib.c', 'ipe_lib.h']),
    
    27
    -       extra_run_opts('+RTS -va -RTS'),
    
    27
    +       extra_run_opts('+RTS -va -DI -RTS'),
    
    28 28
            grep_errmsg('table_name_'),
    
    29 29
            only_ways(debug_ways),
    
    30 30
            normalise_errmsg_fun(noCapabilityOutputFilter),
    
    ... ... @@ -34,4 +34,3 @@ test('ipeEventLog_fromMap',
    34 34
            when(opsys('darwin'), fragile(0))
    
    35 35
          ],
    
    36 36
          compile_and_run, ['ipe_lib.c'])
    37
    -