Commit Graph

15 Commits

Author SHA1 Message Date
Eng Zer Jun
382bb0fde6
pkg/proc/internal/ebpf: remove redundant nil check (#3502)
From the Go specification:

  "1. For a nil slice, the number of iterations is 0." [1]

Therefore, an additional nil check for before the loop is unnecessary.

[1]: https://go.dev/ref/spec#For_range

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-09-18 08:01:52 -07:00
Derek Parker
f0b534ddcc
pkg/proc: add support for more types in ebpf tracing backend (#3474) 2023-08-18 19:56:44 +02:00
Derek Parker
1d28ceccdc
pkg/proc: fix ebpf probe tracing backen uprobe handling (#3417)
Uprobes get automatically cleaned and removed when the reference to
the Link object is lost. Hold a reference to any active Uprobe Link
for duration of Delve execution and ensure they are cleaned up
at exit.

Fixes ebpf probes don't work after time.Sleep() #3227
2023-06-15 12:07:32 +02:00
Derek Parker
f3bfa7c177
pkg/proc: remove memlock limit for ebpf trace backend (#3353)
Fixes #3283
2023-05-03 09:41:32 +02:00
Hengqi Chen
64d5ce26d6
proc: Simplify eBPF backend implementation (#3325)
* Remove standard C headers since we have vmlinux.h already
* Simplify get_goroutine_id() implementation, this reduces a map
  and thus reduces runtime memory comsumption.

While at it, unify all indention using 4 spaces.

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
2023-04-24 13:37:58 -07:00
Derek Parker
5c5fca4849
pkg/proc/internal/ebpf: Fix handling of entry / return (#3081)
This patch removes the old error-prone way of tracking
whether the tracepoint is for a function entry or
return. Instead of trying to guess, let the data structure
simply tell us directly.
2022-07-29 12:00:32 +02:00
Derek Parker
36b35aad00
pkg/proc/internal/ebpf: Fix size of ebpf type for fn_addr (#3080)
Must have been an issue overlooked in the initial implementation but
we should be using a 64-bit wide type to store the function address.
2022-07-28 11:30:08 +02:00
Alessandro Arzilli
5452c30fac
proc/internal/ebpf: drop dependency on cgo (#3072)
The ebpf implementations uses cgo, but only to access some C struct
definitions. Instead of using cgo simply duplicate the defintion of
those two structs in Go and add a test to check that the duplicate
definitions remain synchronized.

Fixes #2827
2022-07-22 19:39:18 +02:00
Derek Parker
661cb33699
pkg/proc: switch to Dual MIT/GPL license for ebpf (#2849) 2021-12-30 20:14:37 +01:00
Derek Parker
a88c9bde4a
pkg/proc: add build scripts & docker image for ebpf (#2847)
Adds a few build scripts and a container image for reproducible builds
of the ebpf programs.
2021-12-30 09:04:59 +01:00
Alessandro Arzilli
2cd9d268d3
proc: add dummy files to fix vendoring of Delve (#2807)
Add some dummy go files so that 'go mod vendor' works for modules that
require Delve, becuase directories that do not contain any go code will
not be vendored.
2021-12-07 09:20:10 -08:00
Derek Parker
cd9e6c02a6
*: Replace libbpfgo with cilium/ebpf (#2771) 2021-11-03 16:58:04 +01:00
Derek Parker
689e08260b
eBPF tracing backend return value parsing (#2704)
Add return value parsing for eBPF tracing backend.
2021-10-25 12:37:36 -07:00
Derek Parker
1b2f7f0051
pkg/proc: Parse Goroutine ID in eBPF tracer (#2654)
This patch enables the eBPF tracer backend to parse the ID of the
Goroutine which hit the uprobe. This implementation is specific to AMD64
and will have to be generalized further in order to be used on other
architectures.
2021-08-24 14:53:27 +02:00
Derek Parker
10406f96d5
*: Initial eBPF tracing support (#2625) 2021-07-31 17:16:26 +02:00