[GHC] #13529: eventlog to report more information about stopping threads because of FFI calls

#13529: eventlog to report more information about stopping threads because of FFI calls -------------------------------------+------------------------------------- Reporter: varosi | Owner: (none) Type: feature | Status: new request | Priority: normal | Milestone: Component: Profiling | Version: 8.0.2 Keywords: | Operating System: Unknown/Multiple Architecture: x86_64 | Type of failure: None/Unknown (amd64) | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Currently eventlog file doesn't contain more information about FFI than: "stopping thread ### (making a foreign call)" It would be very-very useful if we know what actual foreign calls are made. For example: "stopping thread ### (making a foreign call to function YYYY) So we could see which function and how much time is spent on that call. If creation of threads because of in-bound foreign calls (callbacks) have which callbacks are created for it will be very useful, too. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13529 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13529: eventlog to report more information about stopping threads because of FFI calls -------------------------------------+------------------------------------- Reporter: varosi | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Profiling | Version: 8.0.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 | (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by varosi): * Attachment "Core88_threadprofile.png" added. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13529 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13529: eventlog to report more information about stopping threads because of FFI calls -------------------------------------+------------------------------------- Reporter: varosi | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Profiling | Version: 8.0.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 | (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): How do you propose we would identify which foreign function is being called? I can think of a few ways, * Have the compiler produce a string which is passed to the RTS when generating code for safe foreign calls * Use the symbol table lookup of the callee's address * Use DWARF information of the callee's address All of these have their costs and I do wonder whether this sort of instrumentation might not be better left to the user to implement themselves with, e.g. `traceEvent`, if they need it. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13529#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13529: eventlog to report more information about stopping threads because of FFI calls -------------------------------------+------------------------------------- Reporter: varosi | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Profiling | Version: 8.0.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 | (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by varosi): I'm not aware of GHC architecture and cannot help with actual implementation much. If there are many foreign calls or we're using third-party libraries, like wxHaskell - it will be hard to place traceEvent everywhere. Automated adding of such traceEvent could be very helpful, i.e. automated instrumentation. About DWARF - there is no DWARF support under Windows, so this limit debugging capabilities. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13529#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13529: eventlog to report more information about stopping threads because of FFI calls ------------------------------------+-------------------------------------- Reporter: varosi | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Profiling | Version: 8.0.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ------------------------------------+-------------------------------------- Changes (by varosi): * os: Unknown/Multiple => Windows -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13529#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13529: eventlog to report more information about stopping threads because of FFI calls ------------------------------------+-------------------------------------- Reporter: varosi | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Profiling | Version: 8.0.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ------------------------------------+-------------------------------------- Comment (by varosi): Possible implementation for 8.4 via LLVM? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13529#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13529: eventlog to report more information about stopping threads because of FFI calls ------------------------------------+-------------------------------------- Reporter: varosi | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Profiling | Version: 8.0.2 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ------------------------------------+-------------------------------------- Comment (by bgamari): I don't think we need to bring LLVM into this. It's just a question of how we want to insert tracing output. Doing this in STG to Cmm would be one option. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13529#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC