Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4593e41b authored by Colin Cross's avatar Colin Cross Committed by Gerrit Code Review
Browse files

Merge "Improve soong stuck ninja detection output" into main

parents e92e5614 a9aa35c2
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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()