Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Add stack dump. #366

Merged
merged 1 commit into from
Oct 28, 2017
Merged

Add stack dump. #366

merged 1 commit into from
Oct 28, 2017

Conversation

Random-Liu
Copy link
Member

Using the same code with containerd/containerd#292.

Signed-off-by: Lantao Liu lantaol@google.com

}()
}

func dumpStacks() {
Copy link
Member

@mikebrow mikebrow Oct 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from: https://golang.org/src/runtime/debug/stack.go, just a little cleaner with a modification to dump all (true)

func stack() []byte {
	buf := make([]byte, 1024)
  	for {
  		n := runtime.Stack(buf, true)
  		if n < len(buf) {
  			return buf[:n]
  		}
  		buf = make([]byte, 2*len(buf))
  	}
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/LGTM either way with or without the stack() api..

Copy link
Member

@abhi abhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Lantao Liu <lantaol@google.com>
Copy link
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/LGTM

@Random-Liu Random-Liu merged commit c3b03f8 into containerd:master Oct 28, 2017
@Random-Liu Random-Liu deleted the add-dump-stack branch October 28, 2017 00:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants