Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelroquetto committed Feb 26, 2025
1 parent fed58e5 commit 1c384d0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions bpf/build_ebpf.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"unicode"
)

const DEBUG = false
const OCI_BIN = "docker"
const GEN_IMG = "ghcr.io/grafana/beyla-ebpf-generator:main"

Expand Down Expand Up @@ -449,11 +450,22 @@ func main() {
bail(err)
}

if (DEBUG) {
fmt.Println("wd:", wd)
fmt.Println("adjusted wd:", adjustedWD)
fmt.Println("tmpFile:", tmpFile)
fmt.Println("relTmpFile:", relTmpFile)
}

cmd := exec.Command(OCI_BIN, "run", "--rm",
"-v", adjustedWD+":/src",
GEN_IMG,
filepath.Join("/src", relTmpFile))

if (DEBUG) {
fmt.Println("cmd:", cmd.String())
}

stdoutPipe, stderrPipe, err := getPipes(cmd)

if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion generator.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if [ -z "\$GENFILES" ]; then
echo No genfiles specified - regenerating everything
grep -rlI "BPF2GO" pkg/internal/ | xargs -P 0 -n 1 go generate
else
cat \$GENFILES | xargs -P 0 -n 1 go generate || grep -rlI "BPF2GO" pkg/internal/ | xargs -P 0 -n 1 go generate
cat \$GENFILES | xargs -P 0 -n 1 go generate
fi
EOF

Expand Down

0 comments on commit 1c384d0

Please sign in to comment.