All Projects → DataDog → gostackparse

DataDog / gostackparse

Licence: Unknown and 2 other licenses found Licenses found Unknown LICENSE Apache-2.0 LICENSE-APACHE BSD-3-Clause LICENSE-BSD3
Package gostackparse parses goroutines stack traces as produced by panic() or debug.Stack() at ~300 MiB/s.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to gostackparse

stacktrace
Atom package to navigate stacktraces.
Stars: ✭ 35 (-60.23%)
Mutual labels:  stacktrace, debugging
tracehash
Compress long exception traces down to short signatures
Stars: ✭ 20 (-77.27%)
Mutual labels:  stacktrace, debugging
py better exchook
nice Python exception hook replacement
Stars: ✭ 35 (-60.23%)
Mutual labels:  stacktrace, debugging
Traceback with variables
Adds variables to python traceback. Simple, lightweight, controllable. Debug reasons of exceptions by logging or pretty printing colorful variable contexts for each frame in a stacktrace, showing every value. Dump locals environments after errors to console, files, and loggers. Works in Jupyter and IPython. Install with pip or conda.
Stars: ✭ 509 (+478.41%)
Mutual labels:  stacktrace, debugging
madbomber
Backtrace-on-throw C++ exception logger
Stars: ✭ 17 (-80.68%)
Mutual labels:  stacktrace, debugging
Clarify
Remove nodecore related stack trace noise
Stars: ✭ 140 (+59.09%)
Mutual labels:  stacktrace, debugging
vue-ray
Debug your Vue 2 & 3 code with Ray to fix problems faster
Stars: ✭ 48 (-45.45%)
Mutual labels:  debugging
stack-inspector
A gdb command to inspect the size of objects on the stack
Stars: ✭ 57 (-35.23%)
Mutual labels:  debugging
krumo
Krumo: Structured information display solution for PHP
Stars: ✭ 74 (-15.91%)
Mutual labels:  debugging
hs-probe-firmware
A CMSIS-DAP implementation in pure Rust.
Stars: ✭ 68 (-22.73%)
Mutual labels:  debugging
heaptrace
helps visualize heap operations for pwn and debugging
Stars: ✭ 252 (+186.36%)
Mutual labels:  debugging
ducky
Chrome extension to overlay a (super adorable) rubber duck, as a virtual companion during rubber duck debugging.
Stars: ✭ 80 (-9.09%)
Mutual labels:  debugging
emacs-inspector
Inspection tool for Emacs Lisp objects.
Stars: ✭ 71 (-19.32%)
Mutual labels:  debugging
expo-community-flipper
Flipper Support for Expo Apps in React Native
Stars: ✭ 82 (-6.82%)
Mutual labels:  debugging
dwarf import
This loads DWARF info from an open binary and propagates function names, arguments, and type info
Stars: ✭ 18 (-79.55%)
Mutual labels:  debugging
debug-plotter
Rust crate that provides a convenient macro to quickly plot variables.
Stars: ✭ 82 (-6.82%)
Mutual labels:  debugging
EVM-Simulator
EVM-Simulator bachelor's thesis.
Stars: ✭ 36 (-59.09%)
Mutual labels:  debugging
bugsnag-vue
[DEPRECATED] This package now lives within the monorepo for our Universal JS notifier "@bugsnag/js" • https://github.com/bugsnag/bugsnag-js
Stars: ✭ 26 (-70.45%)
Mutual labels:  debugging
TweakIt-Desktop
An Android Debugging Application
Stars: ✭ 33 (-62.5%)
Mutual labels:  debugging
bugsnag-java
Bugsnag error reporting for Java.
Stars: ✭ 51 (-42.05%)
Mutual labels:  debugging

ci test status documentation

gostackparse

Package gostackparse parses goroutines stack traces as produced by panic() or debug.Stack() at ~300 MiB/s.

Parsing this data can be useful for Goroutine Profiling or analyzing crashes from log files.

Usage

The package provides a simple Parse() API. You can use it like this:

import "github.com/DataDog/gostackparse"

func main() {
	// Get a text-based stack trace
	stack := debug.Stack()
	// Parse it
	goroutines, _ := gostackparse.Parse(bytes.NewReader(stack))
	// Ouptut the results
	json.NewEncoder(os.Stdout).Encode(goroutines)
}

The result is a simple list of Goroutine structs:

[
  {
    "ID": 1,
    "State": "running",
    "Wait": 0,
    "LockedToThread": false,
    "Stack": [
      {
        "Func": "runtime/debug.Stack",
        "File": "/usr/local/Cellar/go/1.16/libexec/src/runtime/debug/stack.go",
        "Line": 24
      },
      {
        "Func": "main.main",
        "File": "/home/go/src/github.com/DataDog/gostackparse/example/main.go",
        "Line": 18
      }
    ],
    "FramesElided": false,
    "CreatedBy": null
  }
]

Design Goals

  1. Safe: No panics should be thrown.
  2. Simple: Keep this pkg small and easy to modify.
  3. Forgiving: Favor producing partial results over no results, even if the input data is different than expected.
  4. Efficient: Parse several hundred MiB/s.

Testing

gostackparse has been tested using a combination of hand picked test-fixtures, property based testing, and fuzzing.

Comparsion to panicparse

panicparse is a popular library implementing similar functionality.

gostackparse was created to provide a subset of the functionality (only the parsing) using ~10x less code while achieving > 100x faster performance. If you like fast minimalistic code, you might prefer it. If you're looking for more features and a larger community, use panicparse.

Benchmarks

gostackparse includes a small benchmark that shows that it can parse test-fixtures/waitsince.txt at ~300 MiB/s and how that compares to panicparse.

$ cp panicparse_test.go.disabled panicparse_test.go
$ go get -t .
$ go test -bench .
goos: darwin
goarch: amd64
pkg: github.com/DataDog/gostackparse
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
BenchmarkGostackparse-12   45456    26275 ns/op 302.34 MiB/s   17243 B/op    306 allocs/op
BenchmarkPanicparse-12     76    15943320 ns/op   0.50 MiB/s 5274247 B/op 116049 allocs/op
PASS
ok  	github.com/DataDog/gostackparse	3.634s

License

This work is dual-licensed under Apache 2.0 or BSD3. See LICENSE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].