Skip to content

Commit 0591104

Browse files
authored
Merge pull request #105 from OpenCloudOS/dev
bpf: fix skb_clone trace exception
2 parents a8f184a + dbe7c0e commit 0591104

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

src/progs/kprobe.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,7 @@ static inline int default_handle_entry(context_info_t *info);
9595

9696
static __always_inline int get_ret_key(int func)
9797
{
98-
#ifndef BPF_MAP_TYPE_PERCPU_ARRAY
99-
return func * bpf_get_smp_processor_id();
100-
#else
10198
return func;
102-
#endif
10399
}
104100

105101
static inline void get_ret(context_info_t *info)

src/trace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ static void trace_print_enabled()
721721
} else {
722722
fmt = "tracepoint";
723723
}
724-
pr_verb("\t%s: %s, prog: %s, status: %x\n", fmt, trace->name,
724+
pr_verb("\t%s: %s, prog: %s, status: 0x%x\n", fmt, trace->name,
725725
trace->prog, trace_get_status(trace->index));
726726
}
727727
}

src/trace.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,14 @@ static inline bool trace_is_usable(trace_t *t)
225225
return trace_is_enable(t) && !trace_is_invalid(t);
226226
}
227227

228+
static inline void trace_set_status(int func, int status)
229+
{
230+
trace_ctx.bpf_args.trace_status[func] |= status;
231+
}
232+
228233
static inline void trace_set_ret(trace_t *t)
229234
{
235+
trace_set_status(t->index, FUNC_STATUS_RET);
230236
t->status |= TRACE_RET;
231237
}
232238

@@ -245,11 +251,6 @@ static inline bool trace_is_retonly(trace_t *t)
245251
return t->status & TRACE_RET_ONLY;
246252
}
247253

248-
static inline void trace_set_status(int func, int status)
249-
{
250-
trace_ctx.bpf_args.trace_status[func] |= status;
251-
}
252-
253254
static inline u8 trace_get_status(int func)
254255
{
255256
return trace_ctx.bpf_args.trace_status[func];

0 commit comments

Comments
 (0)