New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/514366607/stack_dump

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/514366607/stack_dump

  • v0.0.1
  • Source
  • Go
  • Socket score

Version published
Created
Source

stack_dump

import stack_dump module, receive signal USR1, dump golang all goroutine stack content to file.

how to use?

use stack_dump module

package main

import (
	"time"

	"github.com/rfyiamcool/dump_stack"
)

func main() {
	dumpStack.SetupStackTrap()
	// dumpStack.SetupStackTrap("stack.log")
	time.Sleep(100 * time.Second)
}

dump golang goroutine stack

kill -USR1 pid
tail stack.log

analyse top func

awk -F '[' '/goroutine \d*/{print "[" $2}' stack.log | sort | uniq -c | sort -k1nr | head -20

5030 [select]:
1910 [semacquire]:
 952 [IO wait]:
 198 [chan send]:
 11  [sleep]:
  3  [runnable]:
  2  [chan receive, 6 minutes]:
  2  [select, 6 minutes]:
  1  [chan receive]:
  1  [IO wait, 1 minutes]:
  1  [running]:
  1  [select, 6 minutes, locked to thread]:
  1  [syscall]:

FAQs

Package last updated on 29 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc