Skip to content

[Based on #103] debug: add LLDB goroutine backtraces - #106

Open
cpunion wants to merge 1 commit into
codex/lldb-goroutines-20260801from
codex/lldb-goroutine-stacks-20260801
Open

[Based on #103] debug: add LLDB goroutine backtraces#106
cpunion wants to merge 1 commit into
codex/lldb-goroutines-20260801from
codex/lldb-goroutine-stacks-20260801

Conversation

@cpunion

@cpunion cpunion commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Based on #103.

Adds goroutine-aware native backtraces to the LLGo LLDB adapter:

  • records each LLGo M OS thread ID using Darwin pthread_threadid_np or Linux SYS_GETTID, matching Go runtime m.procid semantics
  • maps live G/M/P records to LLDB threads without changing the selected thread
  • adds llgo goroutine <id> bt / backtrace, bounded to 256 frames
  • reports unavailable mappings cleanly for unsupported runtime layouts and targets

Validation:

  • macOS arm64, Apple LLDB 1703: 276/276 integration assertions
  • Linux arm64, LLDB 19.1.7: 276/276 integration assertions
  • runtime G isolation, G/M/P links, allg lifecycle, and OS thread-ID execution tests on both platforms
  • standard DWARF checks at O0, O1, O2, O3, Os, and Oz
  • cmd/internal/lldb statement coverage: 87.5%

Part of xgo-dev#2164 (native debugger Task 3).

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

LLGo baseline benchmarks

df1a0185c53b | workflow run | long-term charts

Program measurements

Platform Workload File size vs main Build vs main Run vs main
Linux cprintf 19344 B +4.3% (worse) 362.373 ms -12.1% (better) 1.298 ms -16.3% (better)
Linux fmtprintf 2218824 B +0.2% (worse) 3.379 s -12.4% (better) 2.451 ms -25.4% (better)
Linux println 73832 B +1.6% (worse) 376.435 ms -5.9% (better) 1.583 ms -5.4% (better)
macOS cprintf 84672 B +0.0% 488.231 ms +17.8% (worse) 4.049 ms +12.8% (worse)
macOS fmtprintf 2361696 B +0.7% (worse) 4.017 s +2.0% (worse) 25.844 ms +10.6% (worse)
macOS println 125888 B -0.9% (better) 478.700 ms +15.5% (worse) 5.250 ms -27.7% (better)
Core language and compiler benchmarks
Platform Benchmark ns/op vs main
Linux BenchmarkLookupPCRandom 13.250 ns/op -1.7% (better)
Linux BenchmarkMergeCompilerFlags 151.200 ns/op -2.1% (better)
Linux BenchmarkMergeLinkerFlags 95.220 ns/op -6.0% (better)
Linux BenchmarkChannelBuffered 34.910 ns/op +0.4% (worse)
Linux BenchmarkChannelHandoff 28252 ns/op -11.8% (better)
Linux BenchmarkDefer 44.210 ns/op -21.5% (better)
Linux BenchmarkDirectCall 1.564 ns/op +0.1% (worse)
Linux BenchmarkGlobalRead 1.557 ns/op -0.2% (better)
Linux BenchmarkGlobalWrite 2.480 ns/op -0.6% (better)
Linux BenchmarkGoroutine 43372 ns/op -42.6% (better)
Linux BenchmarkInterfaceCall 8.102 ns/op +4.0% (worse)
Linux BenchmarkRuntimeGetG 2.182 ns/op -58.9% (better)
macOS BenchmarkLookupPCRandom 14.370 ns/op +15.5% (worse)
macOS BenchmarkMergeCompilerFlags 157.500 ns/op +26.5% (worse)
macOS BenchmarkMergeLinkerFlags 119.500 ns/op +72.3% (worse)
macOS BenchmarkChannelBuffered 29.240 ns/op +5.4% (worse)
macOS BenchmarkChannelHandoff 13108 ns/op +87.0% (worse)
macOS BenchmarkDefer 46.220 ns/op +23.5% (worse)
macOS BenchmarkDirectCall 1.255 ns/op -13.6% (better)
macOS BenchmarkGlobalRead 1.317 ns/op +8.8% (worse)
macOS BenchmarkGlobalWrite 1.461 ns/op -1.7% (better)
macOS BenchmarkGoroutine 49602 ns/op +56.7% (worse)
macOS BenchmarkInterfaceCall 6.570 ns/op +21.7% (worse)
macOS BenchmarkRuntimeGetG 2.783 ns/op +8.0% (worse)

Compared only with the latest matching platform in the main series.

Warning

  • Persistent publishing is unavailable because no data token is configured.

@cpunion
cpunion force-pushed the codex/lldb-goroutines-20260801 branch from a556c58 to 619bdd3 Compare August 1, 2026 23:34
@cpunion
cpunion force-pushed the codex/lldb-goroutine-stacks-20260801 branch from e48deaa to df1a018 Compare August 2, 2026 01:32
@cpunion
cpunion force-pushed the codex/lldb-goroutines-20260801 branch from 53b1e7c to 843ea17 Compare August 2, 2026 07:05
@cpunion
cpunion force-pushed the codex/lldb-goroutine-stacks-20260801 branch from df1a018 to a9092db Compare August 2, 2026 07:05
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.

1 participant