Skip to content

Commit

Permalink
fix(python): updates py-spy version (#440)
Browse files Browse the repository at this point in the history
This should fix #428
  • Loading branch information
petethepig committed Oct 7, 2021
1 parent 4ab01ce commit 1d5868b
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 264 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
FROM alpine:3.12 as rust-builder

RUN apk update &&\
apk add --no-cache git gcc g++ make build-base openssl-dev musl musl-dev curl
apk add --no-cache git gcc g++ make build-base openssl-dev musl musl-dev curl zlib-static

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN /root/.cargo/bin/rustup target add $(uname -m)-unknown-linux-musl
Expand All @@ -22,7 +22,7 @@ COPY third_party/rustdeps /opt/rustdeps

WORKDIR /opt/rustdeps

RUN RUSTFLAGS="-C target-feature=+crt-static" /root/.cargo/bin/cargo build --release --target $(uname -m)-unknown-linux-musl
RUN RUSTFLAGS="-L /lib -C target-feature=+crt-static" /root/.cargo/bin/cargo build --release --target $(uname -m)-unknown-linux-musl
RUN mv /opt/rustdeps/target/$(uname -m)-unknown-linux-musl/release/librustdeps.a /opt/rustdeps/librustdeps.a

# _
Expand Down
8 changes: 7 additions & 1 deletion pkg/agent/pyspy/pyspy.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ package pyspy
import "C"

import (
"bytes"
"errors"
"time"
"unsafe"
Expand Down Expand Up @@ -79,7 +80,12 @@ func (s *PySpy) Snapshot(cb func([]byte, uint64, error)) {
if r < 0 {
cb(nil, 0, errors.New(string(s.errorBuf[:-r])))
} else {
cb(s.dataBuf[:r], 1, nil)
arr := bytes.Split(s.dataBuf[:r], []byte("\n;"))
for _, s := range arr {
if len(s) > 0 {
cb(s, 1, nil)
}
}
}
}

Expand Down

0 comments on commit 1d5868b

Please sign in to comment.