Opened 6 years ago

Last modified 3 years ago

#3021 new feature request

A way to programmatically insert marks into heap profiling output

Reported by: SamB Owned by:
Priority: normal Milestone:
Component: Profiling Version: 6.10.1
Keywords: profiling Cc: SamB, hvr@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

This would be useful for e.g. marking compiler phases.

Hmm, this would be more useful if the "MARK" record type had a string field...

Change History (14)

comment:1 Changed 6 years ago by malcolm.wallace@…

This is a feature that has been part of heap profiling for a long time. See for instance the graphs on p.42 of Röjemo's thesis chapter about space-efficiency in nhc98: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.56.710 There are marks for the start of the renaming, type-checking, and export phases.

comment:2 follow-up: Changed 6 years ago by simonmar

  • difficulty set to Unknown

I did once try to add this once by merging our hp2ps with the one that comes with nhc98, and I gave up - the nhc98 one has diverged a long way.

Actually I'd rather see hp2ps rewritten in Haskell using one of the new visualisation libraries.

comment:3 in reply to: ↑ 2 Changed 6 years ago by SamB

Replying to simonmar:

Actually I'd rather see hp2ps rewritten in Haskell using one of the new visualisation libraries.

Yeah. I was thinking about making a ticket about that too. I was pretty disgusted when I saw that it was written in C, and none-too-clean C at that. (I was thinking of adding support for rendering in-progress profiles without munging them in shell a few weeks ago.)

comment:4 Changed 6 years ago by SamB

Oh, well, anyway, what I had in mind here was a call of type String -> IO () to place a labeled mark in the profile, basically as shown in that paper.

comment:5 Changed 6 years ago by SamB

Okay, I made the ticket for rewriting hp2ps in Haskell: #3024.

comment:6 follow-up: Changed 6 years ago by malcolm.wallace@…

For reference, if you do decide to add this feature, it would be good to use the same interface as nhc98 already has:

profile :: String -> a -> a

which is similar to the common side-effecting "trace" function in semantics.

comment:8 Changed 6 years ago by malcolm.wallace@…

Ah, we have it in module NonStdProfile (non-hierarchical, since it predates that extension). But if you have a better idea of where it should live, I'll happily change nhc98 to match. Where does "trace" live? Would System.IO.Unsafe be a good place?

comment:9 Changed 6 years ago by simonmar

trace is in Debug.Trace. I don't think System.IO.Unsafe is right (it's not unsafe or IO-ish). Profiling.Heap.mark?

comment:10 Changed 6 years ago by igloo

  • Milestone set to 6.12.1

comment:11 Changed 6 years ago by igloo

  • Milestone changed from 6.12.1 to _|_
  • Type of failure set to None/Unknown

comment:12 Changed 4 years ago by simonmar

See also #5475

comment:13 Changed 4 years ago by hvr

  • Cc hvr@… added

comment:14 Changed 3 years ago by nomeata

JFTR: At this years HIW someone mentioned that you can insert marks into the eventlog, and that in the long run profiling data should also go to the eventlog.

Note: See TracTickets for help on using tickets.