Opened 7 years ago

Last modified 3 years ago

#3024 new task

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):

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 (11)

comment:1 Changed 7 years ago by SamB

  • Cc naesten@… added

This would also help with #3021.

comment:2 Changed 7 years ago by SamB

  • Cc SamB added; naesten@… removed

comment:3 Changed 7 years ago by simonmar

  • Description modified (diff)
  • difficulty set to Unknown

comment:4 Changed 7 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 6 years ago by igloo

  • Milestone set to 6.12 branch

comment:6 Changed 6 years ago by igloo

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

comment:7 Changed 5 years ago by lelf

  • Cc anton.nik@… added

comment:8 Changed 5 years ago by ClaudiusMaximus

  • Cc claudiusmaximus@… added

comment:9 Changed 3 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 3 years ago by igloo

  • Blocking 5641, 7291 added

comment:11 Changed 3 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.

Note: See TracTickets for help on using tickets.