1
0
Fork 0
mirror of https://github.com/imjasonh/snoop synced 2026-07-20 12:59:37 +00:00

Merge pull request #1 from imjasonh/codegen

WIP: update codegen in CI
This commit is contained in:
Jason Hall 2026-01-14 16:08:53 -05:00 committed by GitHub
commit 358cc7d795
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 153414 additions and 88 deletions

41
.github/workflows/codegen.yaml vendored Normal file
View file

@ -0,0 +1,41 @@
name: Update codegen
on:
pull_request:
branches: [main]
permissions: {}
jobs:
codegen:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-go@v5
- run: |
sudo apt-get update
sudo apt-get install -y clang llvm libbpf-dev linux-headers-generic
- run: |
sudo bpftool btf dump file /sys/kernel/btf/vmlinux format c > pkg/ebpf/bpf/vmlinux.h
go generate ./pkg/ebpf/bpf
# Check for changes. Commit and push them.
- run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "Update generated code"
git push
exit 1 # Workflow should fail, so the PR author reviews the changes
else
echo "No changes to commit"
fi

View file

@ -73,7 +73,7 @@ func (c *Config) Validate() error {
// Validate report path is writable (check directory exists and is writable)
if c.ReportPath != "" {
dir := c.ReportPath
var dir string
// Get directory path
if lastSlash := strings.LastIndex(c.ReportPath, "/"); lastSlash >= 0 {
dir = c.ReportPath[:lastSlash]

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -5,6 +5,7 @@ import (
"net/http"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
@ -82,8 +83,8 @@ func New() *Metrics {
)
// Register default process metrics (CPU, memory, etc.)
registry.MustRegister(prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}))
registry.MustRegister(prometheus.NewGoCollector())
registry.MustRegister(collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}))
registry.MustRegister(collectors.NewGoCollector())
return m
}