Skip to content

Commit 860c4f0

Browse files
authored
Merge pull request #105 from parca-dev/update3
More in order cherry-picks from upstream
2 parents 95cb5c9 + 9244c71 commit 860c4f0

86 files changed

Lines changed: 496 additions & 621 deletions

File tree

Some content is hidden

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

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
.cache
2+
.git
23
go
4+
tools/coredump/gdb-sysroot
5+
tools/coredump/modulecache

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
uses: ./.github/workflows/env
2929

3030
- name: Initialize CodeQL
31-
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
31+
uses: github/codeql-action/init@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
3232
with:
3333
languages: go
3434

@@ -37,7 +37,7 @@ jobs:
3737
make TARGET_ARCH=${{ matrix.target_arch }}
3838
3939
- name: Perform CodeQL Analysis
40-
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
40+
uses: github/codeql-action/analyze@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
4141
with:
4242
category: "/language:Go"
4343
timeout-minutes: 10
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Collector Tests
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
# Run every day at 3:15 AM.
6+
- cron: '15 3 * * *'
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref_name }}
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: read
14+
issues: write
15+
16+
jobs:
17+
test:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout Repo
21+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22+
- name: Set up environment
23+
uses: ./.github/workflows/env
24+
with:
25+
skip_rust: true
26+
- name: Cache coredump modules
27+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
28+
with:
29+
path: tools/coredump/modulecache
30+
key: coredumps-collector-${{ hashFiles('tools/coredump/testdata/*/*.json') }}
31+
restore-keys: |
32+
coredumps-collector
33+
coredumps-
34+
- name: Clone Collector
35+
run: |
36+
collector_path=/tmp/opentelemetry-collector
37+
git clone --depth=1 https://github.com/open-telemetry/opentelemetry-collector.git $collector_path
38+
- name: Setup replace statement
39+
run: |
40+
COLLECTOR_PATH=/tmp/opentelemetry-collector ./scripts/local-collector.sh
41+
go mod tidy
42+
- name: Tests
43+
run: make test-junit
44+
- name: Generate Issue
45+
if: failure()
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
run: |
49+
go install go.opentelemetry.io/build-tools/issuegenerator@latest
50+
issuegenerator -path /tmp/testresults

.github/workflows/ossf-scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ jobs:
4242
# Upload the results to GitHub's code scanning dashboard (optional).
4343
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
4444
- name: "Upload to code-scanning"
45-
uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
45+
uses: github/codeql-action/upload-sarif@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
4646
with:
4747
sarif_file: results.sarif

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
check-binary-blobs:
9191
name: Check for differences in the eBPF binary blobs
9292
runs-on: ubuntu-24.04
93-
container: otel/opentelemetry-ebpf-profiler-dev:latest@sha256:acce547f366150eb25392e1aff270df430ef6b759baeb4292999116018e70e6e
93+
container: otel/opentelemetry-ebpf-profiler-dev:latest@sha256:db6081344e85ef95317b19dbf667d56df35812353b23d0fd54e1db0f55436b80
9494
defaults:
9595
run:
9696
shell: bash --login {0}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*.o
2+
*.d
23
*.pb.go
34
.cache
45
/.idea

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:testing-20241223-slim@sha256:2ed89b1e8012d945cfcc111fa1dc11a628edaa24b9af5d63d6935b5ee35d3377
1+
FROM debian:testing-20250721-slim@sha256:aaa28744f5b892a7ccc3e97c0e9b9cdd0fcc447227efaf9e54080801b990f973
22

33
WORKDIR /agent
44

@@ -12,7 +12,7 @@ RUN cross_debian_arch=$(uname -m | sed -e 's/aarch64/amd64/' -e 's/x86_64/arm64
1212
apt-get dist-upgrade -y && \
1313
apt-get install -y --no-install-recommends --no-install-suggests \
1414
curl wget make git cmake unzip libc6-dev g++ gcc pkgconf \
15-
clang-17 clang-format-17 \
15+
llvm-17 clang-17 clang-format-17 ca-certificates \
1616
gcc-${cross_pkg_arch}-linux-gnu libc6-${cross_debian_arch}-cross \
1717
musl-dev:amd64 musl-dev:arm64 && \
1818
apt-get clean autoclean && \
@@ -47,6 +47,7 @@ RUN
4747

4848
# Append to /etc/profile for login shells
4949
RUN echo 'export PATH="/usr/local/go/bin:$PATH"' >> /etc/profile
50+
RUN echo 'export PATH="/agent/go/bin:$PATH"' >> /etc/profile
5051

5152
# Create rust related directories in /usr/local
5253
RUN mkdir -p /usr/local/cargo /usr/local/rustup

Makefile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
.PHONY: all all-common clean ebpf generate test test-deps protobuf docker-image agent legal \
2-
integration-test-binaries codespell lint linter-version debug debug-agent ebpf-profiler \
3-
format-ebpf rust-components rust-targets rust-tests vanity-import-check vanity-import-fix
1+
.PHONY: all all-common clean ebpf generate test test-deps \
2+
test-junit protobuf docker-image agent legal integration-test-binaries \
3+
codespell lint linter-version debug debug-agent ebpf-profiler format-ebpf \
4+
rust-components rust-targets rust-tests vanity-import-check vanity-import-fix
45

56
SHELL := /usr/bin/env bash
67

@@ -49,6 +50,8 @@ GO_FLAGS := -buildvcs=false -ldflags="$(LDFLAGS)"
4950

5051
MAKEFLAGS += -j$(shell nproc)
5152

53+
JUNIT_OUT_DIR ?= /tmp/testresults
54+
5255
all: ebpf-profiler
5356

5457
debug: GO_TAGS := $(GO_TAGS),debugtracer
@@ -106,6 +109,11 @@ test: generate ebpf test-deps
106109
# tools/coredump tests build ebpf C-code using CGO to test it against coredumps
107110
CGO_ENABLED=1 go test $(GO_FLAGS) -tags $(GO_TAGS) ./...
108111

112+
test-junit: generate ebpf test-deps
113+
mkdir -p $(JUNIT_OUT_DIR)
114+
go install gotest.tools/gotestsum@latest
115+
CGO_ENABLED=1 gotestsum --junitfile $(JUNIT_OUT_DIR)/junit.xml -- $(GO_FLAGS) -tags $(GO_TAGS) ./...
116+
109117
# This target isn't called from CI, it doesn't work for cross compile (ie TARGET_ARCH=arm64 on
110118
# amd64) and the CI kernel tests run them already. Useful for local testing.
111119
sudo-golabels-test: integration-test-binaries

armhelpers/arm_helpers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515

1616
// Xreg2num converts arm64asm Reg or RegSP X0...X30 and W0...W30 register enum into a register
1717
// number. X0/W0 return 0, X1/W1 return 1, etc.
18-
func Xreg2num(arg interface{}) (int, bool) {
18+
func Xreg2num(arg any) (int, bool) {
1919
var ndx aa.Reg
2020
switch reg := arg.(type) {
2121
case aa.Reg:

0 commit comments

Comments
 (0)