mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 18:20:27 +00:00
Review feedback
This commit is contained in:
committed by
Paul Bellamy
parent
efd62ac5b3
commit
dfa93fe2f1
@@ -1,7 +1,7 @@
|
||||
.PHONY: run clean
|
||||
|
||||
IMAGE=weavescope-http-requests-plugin
|
||||
UPTODATE=.$(EXE).uptodate
|
||||
UPTODATE=.uptodate
|
||||
|
||||
run: $(UPTODATE)
|
||||
docker run --rm -it \
|
||||
|
||||
@@ -18,7 +18,7 @@ BPF_HASH(received_http_requests, struct received_http_requests_key_t, u64);
|
||||
int kprobe__skb_copy_datagram_iter(struct pt_regs *ctx, const struct sk_buff *skb, int offset, void *unused_iovec, int len)
|
||||
{
|
||||
|
||||
/* Inspect the beginning of docket buffers copied to user-space to determine if they
|
||||
/* Inspect the beginning of socket buffers copied to user-space to determine if they
|
||||
correspond to http requests.
|
||||
|
||||
Caveats:
|
||||
@@ -49,7 +49,7 @@ int kprobe__skb_copy_datagram_iter(struct pt_regs *ctx, const struct sk_buff *sk
|
||||
bpf_probe_read(&data, sizeof(data), skb->data + offset);
|
||||
|
||||
/* TODO: support other methods and optimize lookups */
|
||||
if ((data[0] == 'G') && (data[1] == 'E') && (data[2] == 'T')) {
|
||||
if ((data[0] == 'G') && (data[1] == 'E') && (data[2] == 'T') && (data[3] == ' ')) {
|
||||
/* Record request */
|
||||
struct received_http_requests_key_t key = {};
|
||||
key.pid = bpf_get_current_pid_tgid() >> 32;
|
||||
|
||||
Reference in New Issue
Block a user