Skip to content

Commit

Permalink
Merge Main to Release 1.0 (#61)
Browse files Browse the repository at this point in the history
* Mocks for public APIs

* PR feedback

* Make the sdk client global for mocks

* Update sdk client for NA mocks (#26)

* Update sdk client

* fix var

* API interface change and UTs for TC functions (#25)

* UTs for tc functions

* Fix vet

* Add mocks

* Feedback

* PR feedbacl

* UTs for recovery and progs (#27)

* UTs for recovery and progs

* PR feedbacks

* UTs for cache and kprobes (#28)

* Xdp and Events UT (#29)

* XDP and events update

* cleanup

* Third party attribution doc

* readme-v1 (#30)

* Update README.md (#33)

* Update README.md

* chore: spelling in README (#36)

* Add github action for functional tests

* Merge issue with func tests (#38)

* test-data: Fix to use __builtin_memset() instead of memset() (#40)

In BPF programs, when using functions like `memset()` and `memcpy()`,
you should use LLVM built-in functions like `__builtin_memset()`.

Signed-off-by: shun159 <dreamdiagnosis@gmail.com>

* Bump golang.org/x/sys from 0.6.0 to 0.12.0 (#41)

Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.6.0 to 0.12.0.
- [Commits](golang/sys@v0.6.0...v0.12.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fixup poller for events race condition (#43)

* Fixup poller for events race condition

* Testing package go tidy

* makefile: fix to remove unused option from build-bpf target (#42)

* makefile: fix to remove unused option from build-bpf target

Signed-off-by: shun159 <dreamdiagnosis@gmail.com>

* makefile: refactor using pattern rule

Signed-off-by: shun159 <dreamdiagnosis@gmail.com>

---------

Signed-off-by: shun159 <dreamdiagnosis@gmail.com>

* test-data: fix to solve compile warning for test-data (#45)

* test-data: fix to solve compile warning for test-data

use `void`instead of the `struct sched_process_fork_t` to solve
compile warnings for resolvedata and tc.ingress

```shellsesson
$ doas make test-data/recoverydata.bpf.elf
clang -I../../.. -g -O2 -Wall -fpie -target bpf -DCORE -D__BPF_TRACING__ -D__TARGET_ARCH_x86  -c test-data/recoverydata.bpf.c -o test-data/recoverydata.bpf.elf
test-data/recoverydata.bpf.c:101:31: warning: declaration of 'struct sched_process_fork_t' will not be visible outside of this function [-Wvisibility]
int sched_process_fork(struct sched_process_fork_t *ctx) {
                              ^
1 warning generated.
```

Signed-off-by: shun159 <dreamdiagnosis@gmail.com>

* makefile: Refactor the vmlinux and unit-test targets

1. Check the existence of the /sys/kernel/btf/vmlinux file before generating the header file using bpftool.

2. Improve the idempotency of the vmlinux target.

3. Add the `LOGFILE_PATH` variable to allow specifying a different path for the `AWS_EBPF_SDK_LOG_FILE`.

Signed-off-by: shun159 <dreamdiagnosis@gmail.com>

---------

Signed-off-by: shun159 <dreamdiagnosis@gmail.com>

* kprobe: Add defer statements for resource cleanup in KprobeAttach()/KretprobeAttach (#46)

Ensure that file handle is properly closed using `defer` statements.

Signed-off-by: shun159 <dreamdiagnosis@gmail.com>

* Add v6 test and inc log level (#53)

* Fix verifier log buffer size (#54)

* Use defer close

* Minor cleanup

* Bump go.uber.org/zap from 1.25.0 to 1.26.0 (#52)

Bumps [go.uber.org/zap](https://github.com/uber-go/zap) from 1.25.0 to 1.26.0.
- [Release notes](https://github.com/uber-go/zap/releases)
- [Changelog](https://github.com/uber-go/zap/blob/master/CHANGELOG.md)
- [Commits](uber-go/zap@v1.25.0...v1.26.0)

---
updated-dependencies:
- dependency-name: go.uber.org/zap
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump golang.org/x/sys from 0.12.0 to 0.14.0 (#59)

Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.12.0 to 0.14.0.
- [Commits](golang/sys@v0.12.0...v0.14.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

---------

Signed-off-by: shun159 <dreamdiagnosis@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Apurup Chevuru <60630804+achevuru@users.noreply.github.com>
Co-authored-by: Alex Jones <alex@k8sgpt.ai>
Co-authored-by: Davanum Srinivas <davanum@gmail.com>
Co-authored-by: Eishun Kondoh <dreamdiagnosis@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
6 people authored Nov 8, 2023
1 parent 3a4f0f5 commit f9a830a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ require (
github.com/golang/mock v1.6.0
github.com/stretchr/testify v1.8.4
github.com/vishvananda/netlink v1.1.0
go.uber.org/zap v1.25.0
golang.org/x/sys v0.12.0
go.uber.org/zap v1.26.0
golang.org/x/sys v0.14.0
gopkg.in/natefinch/lumberjack.v2 v2.2.1
)

Expand Down
9 changes: 4 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
Expand All @@ -15,8 +14,8 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1
go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk=
go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ=
go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c=
go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk=
go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
Expand All @@ -31,8 +30,8 @@ golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
Expand Down
2 changes: 1 addition & 1 deletion pkg/maps/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ func (m *BpfMap) BulkRefreshMapEntries(newMapContents map[string]uintptr) error
// 4. Delete stale Keys
log.Infof("Check for stale entries and got %d entries from BPF map", len(retrievedMapKeyList))
for _, key := range retrievedMapKeyList {
log.Infof("Checking if key %s is deltable", key)
log.Infof("Checking if key %s is deletable", key)
if _, ok := newMapContents[key]; !ok {
log.Infof("This can be deleted, not needed anymore...")
deletableKeyByte := []byte(key)
Expand Down

0 comments on commit f9a830a

Please sign in to comment.