Opened 10 years ago

Closed 17 months ago

#3024 closed task (wontfix)

Rewrite hp2ps in Haskell

Reported by: SamB Owned by:
Priority: normal Milestone:
Component: Profiling Version: 6.10.1
Keywords: Cc: SamB, anton.nik@…, claudiusmaximus@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking: #5641, #7291
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by simonmar)

Right now, hp2ps is written in rather difficult to modify C, and is quite inflexible. We should rewrite it in Haskell and make it, among other things, more tolerant to incomplete records.

Change History (12)

comment:1 Changed 10 years ago by SamB

Cc: naesten@… added

This would also help with #3021.

comment:2 Changed 10 years ago by SamB

Cc: SamB added; naesten@… removed

comment:3 Changed 10 years ago by simonmar

Description: modified (diff)
difficulty: Unknown

comment:4 Changed 10 years ago by igloo

It would also be useful to be able to print some of the results as text, e.g. for a biographical profile it might print:

VOID: 23%
DRAG: 16%

where the percentages are the area of the graph.

This would allow us to write better tests for heap profiling.

comment:5 Changed 9 years ago by igloo

Milestone: 6.12 branch

comment:6 Changed 9 years ago by igloo

Milestone: 6.12 branch_|_
Type of failure: None/Unknown

comment:7 Changed 8 years ago by lelf

Cc: anton.nik@… added

comment:8 Changed 8 years ago by ClaudiusMaximus

Cc: claudiusmaximus@… added

comment:9 Changed 6 years ago by nomeata

I opened a separate ticket for the incomplete profile issue; if you fix the bug here you have probabaly fixed #7291 along with it.

comment:10 Changed 6 years ago by igloo

Blocking: 5641, 7291 added

comment:11 Changed 6 years ago by igloo

In #5641, simonmar says

hp2ps needs to be thrown away and rewritten in Haskell. Last I heard hp2pretty
wasn't quite there yet.

In #7291, diatchki says

An alternative to hpt2ps is hp2html (
I wrote it when I had to do a bunch of profiling at work. It is written in Haskell,
and it supports partial data, so you can refresh your profile while it is being
generated. Perhaps we should distribute that instead of hp2ps?

The .hp format has been stable for a long time, so I'm not sure we need to ship a .hp tool with GHC at all: If one is put into the Haskell Platform then (after a year or two) we can just stop shipping hp2ps, as everyone will have the Haskell Platform tool anyway.

That way, the tool can freely use e.g. an SVG library, without adding another dependency to the GHC build.

comment:12 Changed 17 months ago by bgamari

Resolution: wontfix
Status: newclosed

For what it is worth there are now numerous alternatives to hp2ps on Hackage (e.g. hp2pretty). Moreover, we are now able to emit profiler records to the event log, making parsing much simpler. Closing.

Note: See TracTickets for help on using tickets.