Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions libbpf-tools/ksnoop.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ static struct trace *get_trace(struct pt_regs *ctx, bool entry)
/* get address of last function we called */
if (last_stack_depth >= 0 &&
last_stack_depth < FUNC_MAX_STACK_DEPTH)
last_ip = func_stack->ips[last_stack_depth];
bpf_probe_read_kernel(&last_ip, sizeof(last_ip),
&func_stack->ips[last_stack_depth]);
/* push ip onto stack. return will pop it. */
func_stack->ips[stack_depth] = ip;
/* mask used in case bounds checks are optimized out */
Expand Down Expand Up @@ -202,7 +203,7 @@ static struct trace *get_trace(struct pt_regs *ctx, bool entry)

static void output_trace(struct pt_regs *ctx, struct trace *trace)
{
__u16 trace_len;
__u64 trace_len;

if (trace->buf_len == 0)
goto skip;
Expand Down
Loading