From a754178d4f1db1a6896fd27af141a25f538168c5 Mon Sep 17 00:00:00 2001 From: Liz Kammer Date: Mon, 7 Feb 2022 13:38:52 -0500 Subject: [PATCH] Add logging of file resource limits in Soong Test: m nothing and verify in logs Change-Id: I4b51089ce1d222927a180b260fb9bc0e3b77c468 --- cmd/soong_ui/main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmd/soong_ui/main.go b/cmd/soong_ui/main.go index 13b20f42f..d80051c77 100644 --- a/cmd/soong_ui/main.go +++ b/cmd/soong_ui/main.go @@ -23,6 +23,7 @@ import ( "path/filepath" "strconv" "strings" + "syscall" "time" "android/soong/shared" @@ -204,6 +205,15 @@ func main() { buildCtx.Verbosef("Parallelism (local/remote/highmem): %v/%v/%v", config.Parallel(), config.RemoteParallel(), config.HighmemParallel()) + { + var limits syscall.Rlimit + err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &limits) + if err != nil { + buildCtx.Verbosef("Failed to get file limit:", err) + } + buildCtx.Verbosef("Current file limits: %d soft, %d hard", limits.Cur, limits.Max) + } + { // The order of the function calls is important. The last defer function call // is the first one that is executed to save the rbe metrics to a protobuf