From 5a159c2ef22084b291cb7f2cb270b8a529afb08a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20S=C3=A1ez?= Date: Tue, 25 Apr 2023 12:51:59 +0200 Subject: [PATCH] Add additional information to how to filter goroutines --- Documentation/cli/README.md | 16 +++++++++++++++- pkg/terminal/command.go | 16 +++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Documentation/cli/README.md b/Documentation/cli/README.md index 11b25c5c..257a0340 100644 --- a/Documentation/cli/README.md +++ b/Documentation/cli/README.md @@ -399,9 +399,14 @@ To only display goroutines where the specified location contains (or does not co goroutines -w (userloc|curloc|goloc|startloc) expr goroutines -without (userloc|curloc|goloc|startloc) expr goroutines -wo (userloc|curloc|goloc|startloc) expr + + Where: + userloc: filter by the location of the topmost stackframe in user code + curloc: filter by the location of the topmost stackframe (including frames inside private runtime functions) + goloc: filter by the location of the go instruction that created the goroutine + startloc: filter by the location of the start function To only display goroutines that have (or do not have) the specified label key and value, use: - goroutines -with label key=value goroutines -without label key=value @@ -426,6 +431,15 @@ GROUPING goroutines -group (userloc|curloc|goloc|startloc|running|user) + Where: + userloc: groups goroutines by the location of the topmost stackframe in user code + curloc: groups goroutines by the location of the topmost stackframe + goloc: groups goroutines by the location of the go instruction that created the goroutine + startloc: groups goroutines by the location of the start function + running: groups goroutines by weather they are running or not + user: groups goroutines by weather they are user or runtime goroutines + + Groups goroutines by the given location, running status or user classification, up to 5 goroutines per group will be displayed as well as the total number of goroutines in the group. goroutines -group label key diff --git a/pkg/terminal/command.go b/pkg/terminal/command.go index 68a6064e..91d9982a 100644 --- a/pkg/terminal/command.go +++ b/pkg/terminal/command.go @@ -249,9 +249,14 @@ To only display goroutines where the specified location contains (or does not co goroutines -w (userloc|curloc|goloc|startloc) expr goroutines -without (userloc|curloc|goloc|startloc) expr goroutines -wo (userloc|curloc|goloc|startloc) expr + + Where: + userloc: filter by the location of the topmost stackframe in user code + curloc: filter by the location of the topmost stackframe (including frames inside private runtime functions) + goloc: filter by the location of the go instruction that created the goroutine + startloc: filter by the location of the start function To only display goroutines that have (or do not have) the specified label key and value, use: - goroutines -with label key=value goroutines -without label key=value @@ -276,6 +281,15 @@ GROUPING goroutines -group (userloc|curloc|goloc|startloc|running|user) + Where: + userloc: groups goroutines by the location of the topmost stackframe in user code + curloc: groups goroutines by the location of the topmost stackframe + goloc: groups goroutines by the location of the go instruction that created the goroutine + startloc: groups goroutines by the location of the start function + running: groups goroutines by weather they are running or not + user: groups goroutines by weather they are user or runtime goroutines + + Groups goroutines by the given location, running status or user classification, up to 5 goroutines per group will be displayed as well as the total number of goroutines in the group. goroutines -group label key