#define SCX_BUG_ON(__cond, __fmt, ...) \ do { \ if (__cond) \
SCX_BUG((__fmt) __VA_OPT__(,) __VA_ARGS__); \
} while (0)
/** * RESIZE_ARRAY - Convenience macro for resizing a BPF array * @__skel: the skeleton containing the array * @elfsec: the data section of the BPF program in which the array exists * @arr: the name of the array * @n: the desired array element count * * For BPF arrays declared with RESIZABLE_ARRAY(), this macro performs two * operations. It resizes the map which corresponds to the custom data * section that contains the target array. As a side effect, the BTF info for * the array is adjusted so that the array length is sized to cover the new * data section size. The second operation is reassigning the skeleton pointer * for that custom data section so that it points to the newly memory mapped * region.
*/ #define RESIZE_ARRAY(__skel, elfsec, arr, n) \ do { \
size_t __sz; \
bpf_map__set_value_size((__skel)->maps.elfsec##_##arr, \ sizeof((__skel)->elfsec##_##arr->arr[0]) * (n)); \
(__skel)->elfsec##_##arr = \
bpf_map__initial_value((__skel)->maps.elfsec##_##arr, &__sz); \
} while (0)
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.