mirror of
https://github.com/imjasonh/snoop
synced 2026-07-20 04:48:18 +00:00
commit
358cc7d795
6 changed files with 153414 additions and 88 deletions
41
.github/workflows/codegen.yaml
vendored
Normal file
41
.github/workflows/codegen.yaml
vendored
Normal 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
|
||||
|
|
@ -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.
153454
pkg/ebpf/bpf/vmlinux.h
153454
pkg/ebpf/bpf/vmlinux.h
File diff suppressed because it is too large
Load diff
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue