#2859·xgo

xgo run -prof panics because profiling is not implemented

Author: znnnnnnn-wilCreated Sep 21, 2026Updated Sep 21, 2026
Labelsenhancement

Environment

  • XGo: current main (ad73bea11e630f64972b2d822486e66739fc51b4)
  • Go: go1.26.5 windows/amd64

Description

The xgo run command advertises a -prof option, but using it always causes an intentional panic instead of producing a profiling report.

The option is included in the usage line and registered with the description do profile and generate profile report:

However, the implementation currently contains:

go
if *flagProf {
    panic("TODO: profile not impl")
}

https://github.com/goplus/xgo/blob/ad73bea11e630f64972b2d822486e66739fc51b4/cmd/internal/run/run.go#L78-L80

Steps to reproduce

From a checkout of the repository:

bash
go run ./cmd/xgo run -prof ./demo/sliceliteral

Actual behavior

The command exits with a panic and stack trace beginning with:

panic: TODO: profile not impl

Expected behavior

A documented command-line option should either work as described or not be exposed as a supported option. In either case, invoking xgo run should not hit an intentional TODO panic.

Suggested direction

Could the maintainers confirm the preferred direction?

  1. Remove the unsupported -prof option from the usage text and flag definitions; or
  2. Implement profiling for the current Go-backed execution path.

I can submit a PR after the intended compatibility behavior is confirmed.