ThreadScope icon indicating copy to clipboard operation
ThreadScope copied to clipboard

Interpreting foreign functions call information as activity

Open varosi opened this issue 8 years ago • 4 comments
trafficstars

Feature request

It'll be great if time between: "HEC YY: stopping thread ZZZZZ (making a foreign call)" and "HEC YY: running thread ZZZZZ" where YY and ZZZZZ are same between events and intepret as a single foreign call.

Activity diagram to show it as this thread is doing something foreign and this could be shown as separate coloured activity inside HEC graphs for YY execution unit.

This is a time spent somewhere else, but affecting us as we have to wait for it at this thread, so it's kind of activity albeit it is outside Haskell. It's time spent in foreign call which will be useful to be represented and measured.

varosi avatar Apr 06 '17 19:04 varosi

The problem is that ThreadScope shows activity on each Haskell HEC, and while an FFI call is running the HEC might be doing something else, like running a different Haskell thread. So you would have potentially multiple FFI calls running at the same time as another Haskell thread (or the GC), it's not clear how to display this.

simonmar avatar Apr 07 '17 14:04 simonmar

hm, but which OS thread is running that FFI call? Isn't it the same OS thread which runs HEC (that calls foreign code) on.

Displaying of FFI activity could be similar to displaying GC trace - with separate band per HEC. Those bands could be shown or hidden with a check boxes that show/hide other traces.

varosi avatar Apr 08 '17 11:04 varosi

The OS thread that made the FFI call is running, and meanwhile a different OS thread is running the HEC.

So the problem is that ThreadScope shows a HEC-centric view of the execution, whereas you might prefer to see an OS-thread-centric view. That's entirely reasonable, and in that setting it would make sense to show FFI calls, but it's not implemented.

simonmar avatar Apr 10 '17 07:04 simonmar

Ahaa, so that will be useful for sure.

varosi avatar Apr 10 '17 11:04 varosi