diff options
author | Steven Rostedt (Google) <[email protected]> | 2022-07-05 18:45:06 -0400 |
---|---|---|
committer | Steven Rostedt (Google) <[email protected]> | 2022-07-24 19:11:17 -0400 |
commit | ded4a2f1ae608772dd95e819f04bbaba1f0e78b1 (patch) | |
tree | 3185ee04226e9c3fd75bc0cc5e12ca8bb2b819b2 | |
parent | 74003fc4ae7619ac5a7bec8748a14f3a8655f3ea (diff) |
mac80211: tracing: Use the new __vstring() helper
Instead of open coding a __dynamic_array() with a fixed length (which
defeats the purpose of the dynamic array in the first place). Use the new
__vstring() helper that will use a va_list and only write enough of the
string into the ring buffer that is needed.
Link: https://lkml.kernel.org/r/[email protected]
Cc: Johannes Berg <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Steven Rostedt (Google) <[email protected]>
-rw-r--r-- | net/mac80211/trace_msg.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/mac80211/trace_msg.h b/net/mac80211/trace_msg.h index 40141df09f25..c9dbe9aab7bd 100644 --- a/net/mac80211/trace_msg.h +++ b/net/mac80211/trace_msg.h @@ -24,13 +24,11 @@ DECLARE_EVENT_CLASS(mac80211_msg_event, TP_ARGS(vaf), TP_STRUCT__entry( - __dynamic_array(char, msg, MAX_MSG_LEN) + __vstring(msg, vaf->fmt, vaf->va) ), TP_fast_assign( - WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg), - MAX_MSG_LEN, vaf->fmt, - *vaf->va) >= MAX_MSG_LEN); + __assign_vstr(msg, vaf->fmt, vaf->va); ), TP_printk("%s", __get_str(msg)) |