/* This is necessary so that LLVM generates BTF for node_data struct * If it's not included, a fwd reference for node_data will be generated but * no struct. Example BTF of "node" field in map_value when not included: * * [10] PTR '(anon)' type_id=35 * [34] FWD 'node_data' fwd_kind=struct * [35] TYPE_TAG 'kptr_ref' type_id=34 * * (with no node_data struct defined) * Had to do the same w/ bpf_kfunc_call_test_release below
*/ struct node_data *just_here_because_btf_bug; struct refcounted_node *just_here_because_btf_bug2;
mapval = bpf_map_lookup_elem(&some_nodes, &idx); if (!mapval) return 1;
inner_local_kptr = bpf_obj_new(typeof(*inner_local_kptr)); if (!inner_local_kptr) return 2;
res = bpf_obj_new(typeof(*res)); if (!res) {
bpf_obj_drop(inner_local_kptr); return 3;
}
res->key = val;
inner_local_kptr = bpf_kptr_xchg(&res->stashed_in_local_kptr, inner_local_kptr); if (inner_local_kptr) { /* Should never happen, we just obj_new'd res */
bpf_obj_drop(inner_local_kptr);
bpf_obj_drop(res); return 4;
}
res = bpf_kptr_xchg(&mapval->node, res); if (res)
bpf_obj_drop(res); return 0;
}
/* Helper for refcount_acquire_without_unstash test */
SEC("tc") long stash_refcounted_node(void *ctx)
{ struct refcounted_node *p; struct stash *s; int key = 0;
s = bpf_map_lookup_elem(&refcounted_node_stash, &key); if (!s) return 1;
p = bpf_obj_new(typeof(*p)); if (!p) return 2;
p->data = 42;
p = bpf_kptr_xchg(&s->stashed, p); if (p) {
bpf_obj_drop(p); return 3;
}
return 0;
}
char _license[] SEC("license") = "GPL";
Messung V0.5
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.9Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.