Skip to content

Commit

Permalink
Address review issues
Browse files Browse the repository at this point in the history
Signed-off-by: Kemal Akkoyun <[email protected]>
  • Loading branch information
kakkoyun committed Apr 20, 2022
1 parent 2677ab1 commit 14fc8ba
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions parca-agent.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,18 @@ int do_sample(struct bpf_perf_event_data *ctx) {
return 0;

// create map key
stack_count_key_t key = {.pid = tgid};
stack_count_key_t key = {
.pid = tgid,
.user_stack_id = 0,
.kernel_stack_id = 0,
};

// get user stack id
key.user_stack_id = 0;
int stack_id = bpf_get_stackid(ctx, &stack_traces, BPF_F_USER_STACK);
if (stack_id >= 0)
key.user_stack_id = stack_id;

// get kernel stack id
key.kernel_stack_id = 0;
int kernel_stack_id = bpf_get_stackid(ctx, &stack_traces, 0);
if (kernel_stack_id >= 0)
key.kernel_stack_id = kernel_stack_id;
Expand Down

0 comments on commit 14fc8ba

Please sign in to comment.