1
0
mirror of https://github.com/DataDog/go-profiler-notes.git synced 2025-07-12 23:50:13 +02:00

update links and stuff

This commit is contained in:
Felix Geisendörfer
2021-01-17 19:23:23 +01:00
parent 6fde1a9f35
commit 7ed351f591
5 changed files with 15 additions and 14 deletions

View File

@ -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. 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. - [pprof tool & format](./pprof.md): Describes the pprof tool and it's binary data format.
- [Goroutine Profiling](./goroutine.md)
## Todo ## Todo
- CPU Profiler - CPU Profiling
- Heap Profiler - Heap Profiling
- Mutex Profiler - Mutex Profiling
- Goroutine Profiler - Block Profiling
- Block Profiler - Wallclock Profiling (fgprof)
- Wallclock Profiler (fgprof)
## External Links ## 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. - [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. - [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 : ). Got great links to recommend? Open an issue or PR, I'd happy to add your suggestions : ).

6
cpu.md
View File

@ -1,8 +1,6 @@
🚧 This note is still work in progress, please come back later! 🚧 🚧 This note is still work in progress, please come back later! 🚧
# Go's CPU profiler # CPU Profiling in Go
[TOC]
## How it works ## How it works
@ -76,4 +74,4 @@ The various ways one can record CPU profiles in Go are listed below.
- Profiler labels - Profiler labels
- bias - bias
- performance overhead - 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) - Discuss [Proposal: hardware performance counters for CPU profiling.](https://go.googlesource.com/proposal/+/refs/changes/08/219508/2/design/36821-perf-counter-pprof.md)

View File

@ -12,6 +12,8 @@ A `batch` has a `start` and an `end` time as well as a slice of `profiles`. Each
## Payload Format ## 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. The payload uses `multipart/form-data` encoding and includes the following form fields for every `batch` that is being uploaded.
- `format`: Always `pprof` - `format`: Always `pprof`

View File

@ -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. 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. 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/) ### [`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. This package exposes the [`pprof.Lookup("goroutine")`](https://golang.org/pkg/runtime/pprof/#Lookup) profiles described above via HTTP endpoints. The output is identical.

View File

@ -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. - Write more about using `go tool pprof` itself.
- Explain why pprof can be given a path to the binary the profile belongs to. - Explain why pprof can be given a path to the binary the profile belongs to.
- Get into more details about line numbers / addresses. - Get into more details about line numbers / addresses.
- Talk about mappings and when a Go binary might have more than one