Skip to content

Commit

Permalink
pyroscope.ebpf: update dependency (#5902)
Browse files Browse the repository at this point in the history
  • Loading branch information
korniltsev authored Dec 1, 2023
1 parent 0ecc190 commit 5c0fa9b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ Main (unreleased)

- `pyroscope.ebpf` support python on arm64 platforms. (@korniltsev)

### Bugfixes

- Update `pyroscope.ebpf` to fix a logical bug causing to profile to many kthreads instead of regular processes https://github.com/grafana/pyroscope/pull/2778 (@korniltsev)

- Update `pyroscope.ebpf` to produce more optimal pprof profiles for python processes https://github.com/grafana/pyroscope/pull/2788 (@korniltsev)

v0.38.1 (2023-11-30)
--------------------

Expand Down
8 changes: 6 additions & 2 deletions component/pyroscope/ebpf/ebpf_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,14 @@ func (c *Component) collectProfiles() error {
level.Debug(c.options.Logger).Log("msg", "ebpf collectProfiles")
args := c.args
builders := pprof.NewProfileBuilders(int64(args.SampleRate))
err := c.session.CollectProfiles(func(target *sd.Target, stack []string, value uint64, pid uint32) {
err := c.session.CollectProfiles(func(target *sd.Target, stack []string, value uint64, pid uint32, aggregation ebpfspy.SampleAggregation) {
labelsHash, labels := target.Labels()
builder := builders.BuilderForTarget(labelsHash, labels)
builder.AddSample(stack, value)
if aggregation == ebpfspy.SampleAggregated {
builder.CreateSample(stack, value)
} else {
builder.CreateSampleOrAddValue(stack, value)
}
})

if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions component/pyroscope/ebpf/ebpf_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ func (m *mockSession) UpdateTargets(_ sd.TargetsOptions) {

}

func (m *mockSession) CollectProfiles(f func(target *sd.Target, stack []string, value uint64, pid uint32)) error {
func (m *mockSession) CollectProfiles(f ebpfspy.CollectProfilesCallback) error {
m.collected++
if m.collectError != nil {
return m.collectError
}
for _, stack := range m.data {
f(m.dataTarget, stack, 1, 1)
f(m.dataTarget, stack, 1, 1, ebpfspy.SampleNotAggregated)
}
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ require (
github.com/grafana/loki v1.6.2-0.20231004111112-07cbef92268a
github.com/grafana/pyroscope-go/godeltaprof v0.1.3
github.com/grafana/pyroscope/api v0.2.0
github.com/grafana/pyroscope/ebpf v0.3.3
github.com/grafana/pyroscope/ebpf v0.4.0
github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db
github.com/grafana/river v0.3.0
github.com/grafana/snowflake-prometheus-exporter v0.0.0-20221213150626-862cad8e9538
Expand All @@ -86,7 +86,7 @@ require (
github.com/jaegertracing/jaeger v1.50.0
github.com/jmespath/go-jmespath v0.4.0
github.com/json-iterator/go v1.1.12
github.com/klauspost/compress v1.17.1
github.com/klauspost/compress v1.17.3
github.com/lib/pq v1.10.7
github.com/mackerelio/go-osstat v0.2.3
github.com/miekg/dns v1.1.55
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1072,8 +1072,8 @@ github.com/grafana/pyroscope-go/godeltaprof v0.1.3 h1:eunWpv1B3Z7ZK9o4499EmQGlY+
github.com/grafana/pyroscope-go/godeltaprof v0.1.3/go.mod h1:1HSPtjU8vLG0jE9JrTdzjgFqdJ/VgN7fvxBNq3luJko=
github.com/grafana/pyroscope/api v0.2.0 h1:TzOxL0s6SiaLEy944ZAKgHcx/JDRJXu4O8ObwkqR6p4=
github.com/grafana/pyroscope/api v0.2.0/go.mod h1:nhH+xai9cYFgs6lMy/+L0pKj0d5yCMwji/QAiQFCP+U=
github.com/grafana/pyroscope/ebpf v0.3.3 h1:BAdrZfxGn5QuGrVOTK6oIsjRGHoIguBlWehAWaCAshM=
github.com/grafana/pyroscope/ebpf v0.3.3/go.mod h1:WK4a+9QTRDOh6imvPgglbwblfxkvyS2cYGWF9jlKTI0=
github.com/grafana/pyroscope/ebpf v0.4.0 h1:7fz+5S6MLSc+5cJfmIe7OCvBdooxEm8xy5OAV0s7GA0=
github.com/grafana/pyroscope/ebpf v0.4.0/go.mod h1:eF5+k9lAUBYILVzGccr3hrrvuLy5ZvbDRWGQHDe021w=
github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db h1:7aN5cccjIqCLTzedH7MZzRZt5/lsAHch6Z3L2ZGn5FA=
github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db/go.mod h1:M5qHK+eWfAv8VR/265dIuEpL3fNfeC21tXXp9itM24A=
github.com/grafana/river v0.3.0 h1:6TsaR/vkkcppUM9I0muGbPIUedCtpPu6OWreE5+CE6g=
Expand Down Expand Up @@ -1442,8 +1442,8 @@ github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j
github.com/klauspost/compress v1.11.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.11.12/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
github.com/klauspost/compress v1.17.1 h1:NE3C767s2ak2bweCZo3+rdP4U/HoyVXLv/X9f2gPS5g=
github.com/klauspost/compress v1.17.1/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA=
github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg=
github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs=
Expand Down

0 comments on commit 5c0fa9b

Please sign in to comment.