diff --git a/backport/backport-include/trace/trace_events.h b/backport/backport-include/trace/trace_events.h new file mode 100644 index 00000000..fd6a4f3c --- /dev/null +++ b/backport/backport-include/trace/trace_events.h @@ -0,0 +1,16 @@ +#include <linux/version.h> + +#if LINUX_VERSION_IS_LESS(6,0,0) +#undef VSTRING_MSG_MAX +#define VSTRING_MSG_MAX 512 + +#undef __vstring +#define __vstring(msg, fmt, va) __dynamic_array(char, msg, VSTRING_MSG_MAX) + +#undef __assign_vstr +#define __assign_vstr(msg, fmt, va) \ + WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg), VSTRING_MSG_MAX, \ + fmt, *va) >= VSTRING_MSG_MAX) +#endif /* <6.0 */ + +#include_next <trace/trace_events.h>