Skip to content

Commit 43f1ff6

Browse files
committed
Merge with upstream
2 parents 8188571 + 76d5c10 commit 43f1ff6

File tree

190 files changed

+26747
-3781
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+26747
-3781
lines changed

.github/workflows/env/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ runs:
2727
sudo dpkg --add-architecture arm64
2828
sudo apt-get update -y
2929
30-
sudo apt-get install -y llvm clang dwz curl unzip gcc-aarch64-linux-gnu \
30+
sudo apt-get install -y curl unzip gcc-aarch64-linux-gnu \
3131
libc6-arm64-cross qemu-user-binfmt libc6:arm64

.github/workflows/fossa.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: FOSSA scanning
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
fossa:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
17+
- uses: fossas/fossa-action@93a52ecf7c3ac7eb40f5de77fd69b1a19524de94 # v1.5.0
18+
with:
19+
api-key: ${{secrets.FOSSA_API_KEY}}
20+
team: OpenTelemetry
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "Update builder docker image"
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
paths:
7+
- "Dockerfile"
8+
9+
jobs:
10+
build-and-push:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
- name: Set up environment
16+
uses: ./.github/workflows/env
17+
- name: Login to Docker Hub
18+
uses: docker/login-action@v3
19+
with:
20+
username: ${{ secrets.DOCKER_USERNAME }}
21+
password: ${{ secrets.DOCKER_PASSWORD }}
22+
- name: Set up QEMU
23+
uses: docker/setup-qemu-action@v3
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v3
26+
- name: Set current timestamp tag
27+
id: tag
28+
run: |
29+
echo "tag=$(date +%Y%m%d%H%M)" >> $GITHUB_OUTPUT
30+
- name: Build and push
31+
uses: docker/build-push-action@v6
32+
with:
33+
push: true
34+
file: Dockerfile
35+
platforms: linux/amd64,linux/arm64
36+
tags: otel/opentelemetry-ebpf-profiler-dev:latest,otel/opentelemetry-ebpf-profiler-dev:${{ steps.tag.outputs.tag }}

.github/workflows/unit-test-on-pull-request.yml

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Go
1919
uses: actions/setup-go@v5
2020
with:
21-
go-version: "1.23"
21+
go-version-file: go.mod
2222
check-latest: true
2323
cache-dependency-path: go.sum
2424
id: go
@@ -65,7 +65,7 @@ jobs:
6565
- name: Set up Go
6666
uses: actions/setup-go@v5
6767
with:
68-
go-version: "1.23"
68+
go-version-file: go.mod
6969
check-latest: true
7070
cache-dependency-path: go.sum
7171
id: go
@@ -79,6 +79,11 @@ jobs:
7979
CGO_ENABLED: 1
8080
with:
8181
version: ${{ steps.linter-version.outputs.version }}
82+
- name: Lint eBPF code
83+
run: |
84+
sudo apt update
85+
sudo apt install -y clang-format-17
86+
make lint -C support/ebpf
8287
8388
test:
8489
name: Test (${{ matrix.target_arch }})
@@ -102,6 +107,53 @@ jobs:
102107
- name: Tests
103108
run: make test TARGET_ARCH=${{ matrix.target_arch }}
104109

110+
test-rust:
111+
name: Test rust components
112+
runs-on: ubuntu-24.04
113+
steps:
114+
- name: Clone code
115+
uses: actions/checkout@v4
116+
- name: Install Rust
117+
uses: dtolnay/rust-toolchain@stable
118+
- name: Install protoc
119+
env:
120+
PB_URL: "https://github.com/protocolbuffers/protobuf/releases/download/v24.4/"
121+
PB_FILE: "protoc-24.4-linux-x86_64.zip"
122+
INSTALL_DIR: "/usr/local"
123+
run: |
124+
wget -q "$PB_URL/$PB_FILE"
125+
sudo unzip "$PB_FILE" -d "$INSTALL_DIR" 'bin/*' 'include/*'
126+
sudo chmod +xr "$INSTALL_DIR/bin/protoc"
127+
sudo find "$INSTALL_DIR/include" -type d -exec chmod +x {} \;
128+
sudo find "$INSTALL_DIR/include" -type f -exec chmod +r {} \;
129+
rm "$PB_FILE"
130+
- name: Tests
131+
run: |
132+
cargo test
133+
134+
check-ebpf-blobs:
135+
name: Check for differences in the eBPF binary blobs
136+
runs-on: ubuntu-24.04
137+
container: otel/opentelemetry-ebpf-profiler-dev:latest
138+
steps:
139+
- name: Clone code
140+
uses: actions/checkout@v4
141+
- name: Hash eBPF blobs
142+
run: |
143+
sha256sum support/ebpf/tracer.ebpf.release.* > ebpf-blobs.hash
144+
- name: Rebuild eBPF blobs
145+
run: |
146+
rm support/ebpf/tracer.ebpf.release.*
147+
make amd64 -C support/ebpf
148+
make arm64 -C support/ebpf
149+
- name: Check for differences
150+
run: |
151+
if ! sha256sum --check ebpf-blobs.hash; then
152+
echo "Please rebuild and commit the updated eBPF binary blobs."
153+
exit 1
154+
fi
155+
156+
105157
build-integration-test-binaries:
106158
name: Build integration test binaries (${{ matrix.target_arch }})
107159
runs-on: ubuntu-24.04
@@ -159,8 +211,6 @@ jobs:
159211
steps:
160212
- name: Clone code
161213
uses: actions/checkout@v4
162-
- name: Set up environment
163-
uses: ./.github/workflows/env
164214
- name: Install dependencies
165215
run: |
166216
case "${{ matrix.target_arch }}" in

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
/go
66
ebpf-profiler
77
ci-kernels
8+
/target

.golangci.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ issues:
2727
- virt-tests
2828
- vm-images
2929

30+
# Excluding configuration per-path, per-linter, per-text and per-source
31+
exclude-rules:
32+
# Don't complain about integer overflows
33+
- text: "G115:"
34+
linters:
35+
- gosec
36+
3037
linters:
3138
enable-all: true
3239
disable:
@@ -58,7 +65,6 @@ linters:
5865
- godot
5966
- godox # complains about TODO etc
6067
- gofumpt
61-
- gomnd
6268
- gomoddirectives
6369
- inamedparam
6470
- interfacebloat
@@ -86,7 +92,7 @@ linters:
8692
- wsl
8793
- wrapcheck
8894
# the following linters are deprecated
89-
- execinquery
95+
- exportloopref
9096
# we don't want to change code to Go 1.22+ yet
9197
- intrange
9298
- copyloopvar

CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ get invited to meetings.
1818
See the [#otel-profiles](https://cloud-native.slack.com/archives/C03J794L0BV)
1919
slack channel for discussions and questions.
2020

21+
## Pre-requisites
22+
23+
- Linux (4.19+ for x86-64, 5.5+ for ARM64) with eBPF enabled (the profiler currently only runs on Linux)
24+
- Go as specified in [go.mod](https://github.com/open-telemetry/opentelemetry-ebpf-profiler/blob/main/go.mod)
25+
- docker
26+
- Rust as specified in [Cargo.toml](https://github.com/open-telemetry/opentelemetry-ebpf-profiler/blob/main/Cargo.toml)
27+
2128
## Development
2229

2330
You can view and edit the source code by cloning this repository:

0 commit comments

Comments
 (0)