Skip to content

Commit

Permalink
ci: change from alpine to debian bookworm the golang image for unit-t…
Browse files Browse the repository at this point in the history
…ests (#6)

* ci: change from alpine to debian bookworm the golang image for unit-tests

* fix: specify "arm64" arch for unit-tests

* ci: add build badge in README.md
  • Loading branch information
pkoutsovasilis authored Jan 12, 2024
1 parent 54d97a8 commit f57f307
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ steps:
key: "test"
command: ".buildkite/test.sh"
agents:
image: "golang:1.21.6-alpine3.19"
image: "golang:1.21.6-bookworm"
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Tracing KProbes from BTF (tk-btf)
[![Build status](https://badge.buildkite.com/127fe118a0ca01517075701041070b66e1a6c27322132658db.svg)](https://buildkite.com/elastic/tk-btf)

`tk-btf` is a Go package to fabricate the string representation of [Linux tracing kprobes](https://docs.kernel.org/trace/kprobetrace.html#usage-examples) based on [BTF](https://docs.kernel.org/bpf/btf.html) files.

## Quick Start
Expand Down
11 changes: 7 additions & 4 deletions spec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ package tkbtf
import (
"os"
"path/filepath"
"runtime"
"testing"

"github.com/cilium/ebpf/btf"
Expand All @@ -35,7 +34,7 @@ func TestSpec(t *testing.T) {
}()

spec := generateBTFSpec()
spec.regs, err = getRegistersResolver(runtime.GOARCH)
spec.regs, err = getRegistersResolver("arm64")
require.NoError(t, err)

c := struct {
Expand Down Expand Up @@ -79,7 +78,9 @@ func TestSpec(t *testing.T) {
require.NoError(t, err)

// load stripped spec from path; NOTE this an actual implementation of *btf.Spec
pathSpec, err := NewSpecFromPath(fileName, nil)
pathSpec, err := NewSpecFromPath(fileName, &SpecOptions{
arch: "arm64",
})
require.NoError(t, err)
// check that qstr is actually stripped
_, err = pathSpec.spec.AnyTypesByName("qstr")
Expand Down Expand Up @@ -109,7 +110,9 @@ func TestSpec(t *testing.T) {
_ = file.Close()
}()

readerSpec, err := NewSpecFromReader(file, nil)
readerSpec, err := NewSpecFromReader(file, &SpecOptions{
arch: "arm64",
})
require.NoError(t, err)
// check that qstr is actually stripped
_, err = readerSpec.spec.AnyTypesByName("qstr")
Expand Down

0 comments on commit f57f307

Please sign in to comment.