Skip to content
This repository has been archived by the owner on Nov 11, 2022. It is now read-only.
/ go-heapdump.pk Public archive

Pickle for GNU Poke to read heap-dumps for Go programs.

Notifications You must be signed in to change notification settings

ayosec/go-heapdump.pk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

⚠ This repository is archived. The implementation is now hosted in the pickles repository.


go-heapdump for GNU Poke

Pickle for GNU poke 2.0 or later to read heap-dumps for Go programs.

Installation

Copy the go-heapdump.pk file to ~/.local/share/poke.

$ mkdir -p ~/.local/share/poke

$ wget -O ~/.local/share/poke/go-heapdump.pk https://github.com/ayosec/go-heapdump.pk/raw/main/go-heapdump.pk

Usage

To load this pickle use load "go-heapdump.pk" expression:

$ poke

(poke) load "go-heapdump.pk"

If the module can't be loaded, ensure that ~/.local/share/poke is in the value of load_path.

All types and variables have the GHD_ prefix. To see available types you can use the .info command:

(poke) .info types GHD

Example

First, you need to create a heap-dump in the Go program:

package main

import (
	"os"
	"runtime/debug"
)

func main() {
	if f, err := os.Create("heap-dump"); err == nil {
		debug.WriteHeapDump(f.Fd())
		f.Close()
	}
}

Then, the file heap-dump can be parsed with the pickle in this repository:

$ poke ./heap-dump

(poke) load "go-heapdump.pk"

(poke) GHD_File @ 0#B

About

Pickle for GNU Poke to read heap-dumps for Go programs.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published