From 7ed351f5914050e5bb6a0573de18ee206c49c255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Geisend=C3=B6rfer?= Date: Sun, 17 Jan 2021 19:23:23 +0100 Subject: [PATCH] update links and stuff --- README.md | 14 +++++++------- cpu.md | 6 ++---- datadog.md | 2 ++ goroutine.md | 4 ++-- pprof.md | 3 ++- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 4365b73..22c8973 100644 --- a/README.md +++ b/README.md @@ -3,15 +3,15 @@ I've just started a new job at [Datadog](https://www.datadoghq.com/) to work on [Continuous Profiling](https://www.datadoghq.com/product/code-profiling/) for Go. To make sure that I know what I'm talking about, I'm planning to do an in-depth study of the existing profilers and how they work. I'll try to summarize what I learned in this repository as it might be useful to others. - [pprof tool & format](./pprof.md): Describes the pprof tool and it's binary data format. +- [Goroutine Profiling](./goroutine.md) ## Todo -- CPU Profiler -- Heap Profiler -- Mutex Profiler -- Goroutine Profiler -- Block Profiler -- Wallclock Profiler (fgprof) +- CPU Profiling +- Heap Profiling +- Mutex Profiling +- Block Profiling +- Wallclock Profiling (fgprof) ## External Links @@ -27,4 +27,4 @@ I've just started a new job at [Datadog](https://www.datadoghq.com/) to work on - [Using Instruments to profile Go programs](https://rakyll.org/instruments/): How to use the macOS Instruments app (I think it's built on dtrace) to profile Go programs. Not clear what the benfits are, if any. - [Profiling Go programs with pprof](https://jvns.ca/blog/2017/09/24/profiling-go-with-pprof/) by Julia Evans: A nice tour with a focus on heap profiling and the pprof output format. -Got great links to recommend? Open an issue or PR, I'd happy to add your suggestions : ). \ No newline at end of file +Got great links to recommend? Open an issue or PR, I'd happy to add your suggestions : ). diff --git a/cpu.md b/cpu.md index 4b0e51a..bd2bee5 100644 --- a/cpu.md +++ b/cpu.md @@ -1,8 +1,6 @@ 🚧 This note is still work in progress, please come back later! 🚧 -# Go's CPU profiler - -[TOC] +# CPU Profiling in Go ## How it works @@ -76,4 +74,4 @@ The various ways one can record CPU profiles in Go are listed below. - Profiler labels - bias - performance overhead -- Discuss [Proposal: hardware performance counters for CPU profiling.](https://go.googlesource.com/proposal/+/refs/changes/08/219508/2/design/36821-perf-counter-pprof.md) \ No newline at end of file +- Discuss [Proposal: hardware performance counters for CPU profiling.](https://go.googlesource.com/proposal/+/refs/changes/08/219508/2/design/36821-perf-counter-pprof.md) diff --git a/datadog.md b/datadog.md index c8b75e7..8e26bcf 100644 --- a/datadog.md +++ b/datadog.md @@ -12,6 +12,8 @@ A `batch` has a `start` and an `end` time as well as a slice of `profiles`. Each ## Payload Format +TODO: This is outdated, needs updating [based on this PR](https://github.com/DataDog/dd-trace-go/pull/781). + The payload uses `multipart/form-data` encoding and includes the following form fields for every `batch` that is being uploaded. - `format`: Always `pprof` diff --git a/goroutine.md b/goroutine.md index 528951b..675c78e 100644 --- a/goroutine.md +++ b/goroutine.md @@ -1,6 +1,6 @@ This document was last updated for `go1.15.6` but probably still applies to older/newer versions for the most parts. -# Go's Goroutine Profiler +# Goroutine Profiling in Go Go has various APIs to provide users with a list of **active** goroutines, their current stack trace, as well as various other properties. Some APIs expose this information as statistical summaries, while other APIs provide information for each individual goroutine. @@ -215,4 +215,4 @@ Below is a truncated example of the returned output, see [2.runtime.goroutinepro ### [`net/http/pprof`](https://golang.org/pkg/net/http/pprof/) -This package exposes the [`pprof.Lookup("goroutine")`](https://golang.org/pkg/runtime/pprof/#Lookup) profiles described above via HTTP endpoints. The output is identical. \ No newline at end of file +This package exposes the [`pprof.Lookup("goroutine")`](https://golang.org/pkg/runtime/pprof/#Lookup) profiles described above via HTTP endpoints. The output is identical. diff --git a/pprof.md b/pprof.md index e7a663d..3a23af2 100644 --- a/pprof.md +++ b/pprof.md @@ -149,4 +149,5 @@ The output above is truncated also, [pprof.samples.cpu.001.protoc.txt](./example - Write more about using `go tool pprof` itself. - Explain why pprof can be given a path to the binary the profile belongs to. -- Get into more details about line numbers / addresses. \ No newline at end of file +- Get into more details about line numbers / addresses. +- Talk about mappings and when a Go binary might have more than one