diff options
| author | Colin Cross <ccross@android.com> | 2024-01-05 14:03:27 -0800 |
|---|---|---|
| committer | Colin Cross <ccross@android.com> | 2024-01-10 14:43:30 -0800 |
| commit | a9aa35c252a3659ce860cde8e060561c853aa198 (patch) | |
| tree | 230f45d6d86b7dfbcb2f6498d984e2d506dd90d0 /ui | |
| parent | 3cc3154d33265d956bb1036d1e9a569cf3eb8d4a (diff) | |
Improve soong stuck ninja detection output
Add -T to the pstree command so that it doesn't print the threads of
the running processes, the thread information hasn't been useful for
debugging any previous instances of stuck processes.
Log that there are stuck processes to stdout with a pointer to look
in soong.log.
Test: manual
Change-Id: I6459f2887a7e79591e8c451d06969f8709db3393
Diffstat (limited to 'ui')
| -rw-r--r-- | ui/build/ninja.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/build/ninja.go b/ui/build/ninja.go index b69e938f8..551b8ab41 100644 --- a/ui/build/ninja.go +++ b/ui/build/ninja.go @@ -271,11 +271,13 @@ func (c *ninjaStucknessChecker) check(ctx Context, config Config) { // The Ninja file hasn't been modified since the last time it was // checked, so Ninja could be stuck. Output some diagnostics. ctx.Verbosef("ninja may be stuck; last update to %v was %v. dumping process tree...", c.logPath, newModTime) + ctx.Printf("ninja may be stuck, check %v for list of running processes.", + filepath.Join(config.LogsDir(), config.logsPrefix+"soong.log")) // The "pstree" command doesn't exist on Mac, but "pstree" on Linux // gives more convenient output than "ps" So, we try pstree first, and // ps second - commandText := fmt.Sprintf("pstree -pal %v || ps -ef", os.Getpid()) + commandText := fmt.Sprintf("pstree -palT %v || ps -ef", os.Getpid()) cmd := Command(ctx, config, "dump process tree", "bash", "-c", commandText) output := cmd.CombinedOutputOrFatal() |
