How to use ghc-heap-view of ghc-8.6

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use ghc-heap-view of ghc-8.6

Takenobu Tani
Dear devs,

I'm interested in ghc-heap-view of ghc-8.6. [1]
Is there a document on how to use the ghc-heap-view of ghc-8.6?

[1]: https://ghc.haskell.org/trac/ghc/wiki/Status/GHC-8.6.1#Landedinmasterbranch

Regards,
Takenobu



_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: How to use ghc-heap-view of ghc-8.6

Patrick Dougherty
Hello,

This effort mostly just brought the core of this [1] library into GHC. The main function you will want to try is `getClosureData`,
which takes any value and returns the heap representation. There are some tricky aspects about evaluation, but I will refer you to the comments about `Box`s in [1].

As a shameless self-plug, I also wrote a bit about it. The first page is a brief intro to the heap, and the second is an example demonstrating how to track down a leaky accumulator. I also link to a few posts that sent me down this path.

This doesn't implement all of the functionality of [1], but it pulls in enough that hopefully it should be a little more stable between GHC versions. Also, you should be able to recreate many of the functions by looking at the source of [1] on hackage.


Best,
Patrick

P.S. Sorry about using [1] so many times. Both libraries are called heap-view which makes it a little difficult to distinguish.

On Friday, July 6, 2018 10:10 PM, Takenobu Tani <[hidden email]> wrote:


Dear devs,

I'm interested in ghc-heap-view of ghc-8.6. [1]
Is there a document on how to use the ghc-heap-view of ghc-8.6?

[1]: https://ghc.haskell.org/trac/ghc/wiki/Status/GHC-8.6.1#Landedinmasterbranch

Regards,
Takenobu


_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs



_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: How to use ghc-heap-view of ghc-8.6

Takenobu Tani
Hi Patrick, thanks.
I'll start digging from your great resource.

I'll try using ghc-heap-view on GHCi.
Interactive usage is also useful.

Thank you for your kind explanation,
Takenobu





2018-07-07 13:05 GMT+09:00 Patrick Dougherty <[hidden email]>:
Hello,

This effort mostly just brought the core of this [1] library into GHC. The main function you will want to try is `getClosureData`,
which takes any value and returns the heap representation. There are some tricky aspects about evaluation, but I will refer you to the comments about `Box`s in [1].

As a shameless self-plug, I also wrote a bit about it. The first page is a brief intro to the heap, and the second is an example demonstrating how to track down a leaky accumulator. I also link to a few posts that sent me down this path.

This doesn't implement all of the functionality of [1], but it pulls in enough that hopefully it should be a little more stable between GHC versions. Also, you should be able to recreate many of the functions by looking at the source of [1] on hackage.


Best,
Patrick

P.S. Sorry about using [1] so many times. Both libraries are called heap-view which makes it a little difficult to distinguish.

On Friday, July 6, 2018 10:10 PM, Takenobu Tani <[hidden email]> wrote:


Dear devs,

I'm interested in ghc-heap-view of ghc-8.6. [1]
Is there a document on how to use the ghc-heap-view of ghc-8.6?

[1]: https://ghc.haskell.org/trac/ghc/wiki/Status/GHC-8.6.1#Landedinmasterbranch

Regards,
Takenobu


_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs




_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: How to use ghc-heap-view of ghc-8.6

Joachim Breitner-2
In reply to this post by Patrick Dougherty
Hi,

Am Samstag, den 07.07.2018, 04:05 +0000 schrieb Patrick Dougherty:
> P.S. Sorry about using [1] so many times. Both libraries are called
> heap-view which makes it a little difficult to distinguish.

it seems that my hack on hackage is called ghc-heap-view, and the thing
landed in GHC just ghc-heap :-)

Cheers,
Joachim

--
Joachim Breitner
  [hidden email]
  http://www.joachim-breitner.de/

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to use ghc-heap-view of ghc-8.6

Takenobu Tani
Hi,

Oh, it's clear to me, ghc-heap and ghc-heap-view.
I've misunderstood.

Thank you very much,
Takenobu



2018-07-07 22:35 GMT+09:00 Joachim Breitner <[hidden email]>:
Hi,

Am Samstag, den 07.07.2018, 04:05 +0000 schrieb Patrick Dougherty:
> P.S. Sorry about using [1] so many times. Both libraries are called
> heap-view which makes it a little difficult to distinguish.

it seems that my hack on hackage is called ghc-heap-view, and the thing
landed in GHC just ghc-heap :-)

Cheers,
Joachim

--
Joachim Breitner
  [hidden email]
  http://www.joachim-breitner.de/

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs



_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs