Add -finfo-table-map which maps info tables to source positions
This new flag embeds a lookup table from the address of an info table to information about that info table. The main interface for consulting the map is the `lookupIPE` C function > InfoProvEnt * lookupIPE(StgInfoTable *info) The `InfoProvEnt` has the following structure: > typedef struct InfoProv_{ > char * table_name; > char * closure_desc; > char * ty_desc; > char * label; > char * module; > char * srcloc; > } InfoProv; > > typedef struct InfoProvEnt_ { > StgInfoTable * info; > InfoProv prov; > struct InfoProvEnt_ *link; > } InfoProvEnt; The source positions are approximated in a similar way to the source positions for DWARF debugging information. They are only approximate but in our experience provide a good enough hint about where the problem might be. It is therefore recommended to use this flag in conjunction with `-g<n>` for more accurate locations. The lookup table is also emitted into the eventlog when it is available as it is intended to be used with the `-hi` profiling mode. Using this flag will significantly increase the size of the resulting object file but only by a factor of 2-3x in our experience.
Showing
- compiler/GHC/Cmm/CLabel.hs 53 additions, 3 deletionscompiler/GHC/Cmm/CLabel.hs
- compiler/GHC/Cmm/Parser.y 11 additions, 4 deletionscompiler/GHC/Cmm/Parser.y
- compiler/GHC/CoreToStg.hs 13 additions, 4 deletionscompiler/GHC/CoreToStg.hs
- compiler/GHC/Driver/CodeOutput.hs 119 additions, 6 deletionscompiler/GHC/Driver/CodeOutput.hs
- compiler/GHC/Driver/Flags.hs 2 additions, 0 deletionscompiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Hooks.hs 4 additions, 2 deletionscompiler/GHC/Driver/Hooks.hs
- compiler/GHC/Driver/Main.hs 38 additions, 28 deletionscompiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Pipeline.hs 3 additions, 1 deletioncompiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Session.hs 2 additions, 0 deletionscompiler/GHC/Driver/Session.hs
- compiler/GHC/HsToCore/Coverage.hs 5 additions, 1 deletioncompiler/GHC/HsToCore/Coverage.hs
- compiler/GHC/Stg/Debug.hs 140 additions, 0 deletionscompiler/GHC/Stg/Debug.hs
- compiler/GHC/StgToCmm.hs 34 additions, 15 deletionscompiler/GHC/StgToCmm.hs
- compiler/GHC/StgToCmm/Closure.hs 1 addition, 0 deletionscompiler/GHC/StgToCmm/Closure.hs
- compiler/GHC/StgToCmm/Monad.hs 7 additions, 6 deletionscompiler/GHC/StgToCmm/Monad.hs
- compiler/GHC/StgToCmm/Prof.hs 53 additions, 0 deletionscompiler/GHC/StgToCmm/Prof.hs
- compiler/GHC/StgToCmm/Types.hs 3 additions, 0 deletionscompiler/GHC/StgToCmm/Types.hs
- compiler/GHC/StgToCmm/Utils.hs 35 additions, 1 deletioncompiler/GHC/StgToCmm/Utils.hs
- compiler/GHC/Types/IPE.hs 24 additions, 0 deletionscompiler/GHC/Types/IPE.hs
- compiler/GHC/Types/SrcLoc.hs 5 additions, 0 deletionscompiler/GHC/Types/SrcLoc.hs
- compiler/GHC/Types/Unique/Map.hs 1 addition, 1 deletioncompiler/GHC/Types/Unique/Map.hs
Loading
Please register or sign in to comment