Skip to content

Add eBPF CPU profiling path from stack sampling to Pyroscope export.#660

Merged
J-lena merged 1 commit into
harmonycloud:mainfrom
polychrome56:main
Jul 18, 2026
Merged

Add eBPF CPU profiling path from stack sampling to Pyroscope export.#660
J-lena merged 1 commit into
harmonycloud:mainfrom
polychrome56:main

Conversation

@polychrome56

Copy link
Copy Markdown
Contributor

Description

Add continuous eBPF CPU stack sampling and Pyroscope export to Kindling.

  • Probe: CGO APIs to start/stop sampling (all processes or configured PIDs), read stack maps, and symbolize with a minimal BCC-based symbolizer
  • Collector: cgoreceiver periodically builds gzip pprof and pushes process_cpu profiles when receivers.cgoreceiver.ebpf_profiling.endpoint.url is set
  • Config: empty URL disables the feature; pids: [] samples all processes, non-empty pids enables a host-PID whitelist
  • Docs: docs/ebpf_cpu_profiling.md and deploy YAML examples

This path is independent of the existing Camera On/OffCPU flame graph.

Related Issue

N/A

Motivation and Context

Enable continuous CPU flame graphs in open-source Kindling via Grafana Pyroscope, without depending on the Camera UI pipeline or a dynamic PID control plane.

How Has This Been Tested?

  • Built probe (libkindling) with local agent-libs and BCC symbolizer wiring
  • Built collector packages used by the profiling path (pprof, pyroscopeexporter, cgoreceiver)
  • Verified default config keeps profiling disabled (endpoint.url empty) and pids empty means capture-all
  • Manual validation: set Pyroscope URL, confirm process_cpu profiles appear after ~15s (privileged agent required)

@polychrome56
polychrome56 force-pushed the main branch 2 times, most recently from afb22cc to 5f450dd Compare July 18, 2026 11:44
Wire probe CGO and a minimal BCC symbolizer, and extend cgoreceiver to
periodically encode pprof and push process_cpu profiles when
ebpf_profiling.endpoint.url is set.

Signed-off-by: 赵翔宇 <zhaoxiangyu@harmonycloud.cn>
@J-lena
J-lena merged commit ac57c5f into harmonycloud:main Jul 18, 2026
1 check passed
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.

3 participants