Commit d2786b64 authored by 4ast's avatar 4ast Committed by GitHub

Merge pull request #1401 from iovisor/yhs_dev

bpf: rename helper function bpf_get_stackid
parents bc3c1e48 d049252d
......@@ -246,7 +246,7 @@ static int (*bpf_perf_event_output)(void *ctx, void *map, u64 index, void *data,
static int (*bpf_skb_load_bytes)(void *ctx, int offset, void *to, u32 len) =
(void *) BPF_FUNC_skb_load_bytes;
/* bpf_get_stackid will return a negative value in the case of an error
/* bcc_get_stackid will return a negative value in the case of an error
*
* BPF_STACK_TRACE(_name, _size) will allocate space for _size stack traces.
* -ENOMEM will be returned when this limit is reached.
......@@ -257,11 +257,11 @@ static int (*bpf_skb_load_bytes)(void *ctx, int offset, void *to, u32 len) =
* kernel context. Given this you can typically ignore -EFAULT errors when
* retrieving user-space stack traces.
*/
static int (*bpf_get_stackid_)(void *ctx, void *map, u64 flags) =
static int (*bcc_get_stackid_)(void *ctx, void *map, u64 flags) =
(void *) BPF_FUNC_get_stackid;
static inline __attribute__((always_inline))
int bpf_get_stackid(uintptr_t map, void *ctx, u64 flags) {
return bpf_get_stackid_(ctx, (void *)map, flags);
int bcc_get_stackid(uintptr_t map, void *ctx, u64 flags) {
return bcc_get_stackid_(ctx, (void *)map, flags);
}
static int (*bpf_csum_diff)(void *from, u64 from_size, void *to, u64 to_size, u64 seed) =
......
......@@ -363,7 +363,7 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) {
if (desc->second.type == BPF_MAP_TYPE_STACK_TRACE) {
string arg0 =
rewriter_.getRewrittenText(expansionRange(Call->getArg(0)->getSourceRange()));
txt = "bpf_get_stackid(";
txt = "bcc_get_stackid(";
txt += "bpf_pseudo_fd(1, " + fd + "), " + arg0;
rewrite_end = Call->getArg(0)->getLocEnd();
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment