Skip to content

Commit

Permalink
Use multiples of 8 for field sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
damemi committed May 6, 2024
1 parent 452b413 commit 3401852
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 35 deletions.
6 changes: 4 additions & 2 deletions internal/pkg/inject/offset_results.json
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,8 @@
"0.21.0",
"0.22.0",
"0.23.0",
"0.24.0"
"0.24.0",
"0.25.0"
]
}
]
Expand Down Expand Up @@ -1023,7 +1024,8 @@
"0.21.0",
"0.22.0",
"0.23.0",
"0.24.0"
"0.24.0",
"0.25.0"
]
}
]
Expand Down
10 changes: 5 additions & 5 deletions internal/pkg/instrumentation/bpf/net/http/client/bpf/probe.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ char __license[] SEC("license") = "Dual MIT/GPL";

#define MAX_HOSTNAME_SIZE 128
#define MAX_PROTO_SIZE 8
#define MAX_PATH_SIZE 100
#define MAX_PATH_SIZE 128
#define MAX_SCHEME_SIZE 8
#define MAX_OPAQUE_SIZE 8
#define MAX_RAWPATH_SIZE 8
#define MAX_RAWQUERY_SIZE 128
#define MAX_FRAGMENT_SIZE 50
#define MAX_RAWFRAGMENT_SIZE 50
#define MAX_FRAGMENT_SIZE 56
#define MAX_RAWFRAGMENT_SIZE 56
#define MAX_USERNAME_SIZE 8
#define MAX_METHOD_SIZE 10
#define MAX_CONCURRENT 50
#define MAX_METHOD_SIZE 16
#define MAX_CONCURRENT 56

struct http_request_t {
BASE_SPAN_PROPERTIES
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions internal/pkg/instrumentation/bpf/net/http/client/probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,15 @@ type event struct {
Host [128]byte
Proto [8]byte
StatusCode uint64
Method [10]byte
Path [100]byte
Method [16]byte
Path [128]byte
Scheme [8]byte
Opaque [8]byte
RawPath [8]byte
Username [8]byte
RawQuery [128]byte
Fragment [50]byte
RawFragment [50]byte
Fragment [56]byte
RawFragment [56]byte
ForceQuery uint8
OmitHost uint8
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ func TestConvertEvent(t *testing.T) {
copy(proto[:], protoString)
var protoFoo [8]byte
copy(protoFoo[:], protoFooString)
var method [10]byte
var method [16]byte
copy(method[:], methodString)
var path [100]byte
var path [128]byte
copy(path[:], pathString)
var scheme [8]byte
copy(scheme[:], schemeString)
Expand All @@ -66,9 +66,9 @@ func TestConvertEvent(t *testing.T) {
copy(username[:], []byte(usernameString))
var rawQuery [128]byte
copy(rawQuery[:], []byte(rawQueryString))
var fragment [50]byte
var fragment [56]byte
copy(fragment[:], []byte(fragmentString))
var rawFragment [50]byte
var rawFragment [56]byte
copy(rawFragment[:], []byte(rawFragmentString))

spId, err := trace.SpanIDFromHex("00f067aa0ba902b7")
Expand Down

0 comments on commit 3401852

Please sign in to comment.