I'm working on some eBPF and Redis-related tasks. However, I've run into some difficulties. When I attach a uprobe to the processCommand function in Redis, I want to retrieve some values from the parameters of the processCommand function. This parameter is a pointer to a structure (client* c) that contains many fields. I'm only interested in certain fields from this structure.
Is there a way in an eBPF program to retrieve just a specific field's value from the structure without copying the entire client structure definition from Redis? The client structure also includes other structures, and copying its definition seems very complicated.
bpf_probe_read_user(&val, sizeof(val), c.some.field)