Skip to content

runtime: report BDWGC cycles in MemStats#1891

Draft
cpunion wants to merge 1 commit into
xgo-dev:mainfrom
cpunion:codex/goroot-init-coverage
Draft

runtime: report BDWGC cycles in MemStats#1891
cpunion wants to merge 1 commit into
xgo-dev:mainfrom
cpunion:codex/goroot-init-coverage

Conversation

@cpunion
Copy link
Copy Markdown
Collaborator

@cpunion cpunion commented May 22, 2026

Summary

  • Initialize BDWGC for the runtime package and populate runtime.MemStats from BDWGC heap/cycle counters.
  • Add test/go coverage for a goroutine plus runtime.GC during init.
  • Remove only the locally verified darwin/arm64 xfail for GOROOT/test/init1.go.

Tests

  • go test ./test/go -count=1 -run TestRuntimeGCStatsDuringInit
  • go test ./test/goroot -count=1 -run TestGoRoot -args -goroot "/opt/homebrew/Cellar/go@1.24/1.24.11/libexec" -dirs . -case '^init1.go$' -xfail /tmp/llgo-empty-xfail.yaml
  • (cd runtime && go test ./internal/clite/bdwgc -count=1)
  • (cd runtime && go test ./internal/lib/runtime -count=1)
  • go test ./test/go -count=1
  • go test ./test/goroot -count=1 -run TestGoRoot -args -goroot "/opt/homebrew/Cellar/go@1.24/1.24.11/libexec" -dirs . -case '^init1.go$'

Local GOROOT: /opt/homebrew/Cellar/go@1.24/1.24.11/libexec, go1.24.11 darwin/arm64.

CI note

GOROOT CI is slow/disabled, so this PR relies on normal PR CI from the cpunion fork branch. I did not push to xgo-dev/llgo. If manual GOROOT workflow_dispatch cannot resolve fork refs, that remains a workflow blocker to document rather than a reason to push directly to xgo-dev.

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants