Commit eb068818 authored by Shyam Prasad N's avatar Shyam Prasad N Committed by Steve French

cifs: fix string declarations and assignments in tracepoints

We missed using the variable length string macros in several
tracepoints. Fixed them in this change.

There's probably more useful macros that we can use to print
others like flags etc. But I'll submit sepawrate patches for
those at a future date.
Signed-off-by: default avatarShyam Prasad N <sprasad@microsoft.com>
Cc: <stable@vger.kernel.org> # v5.12
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 6d2fcfe6
...@@ -12,6 +12,11 @@ ...@@ -12,6 +12,11 @@
#include <linux/tracepoint.h> #include <linux/tracepoint.h>
/*
* Please use this 3-part article as a reference for writing new tracepoints:
* https://lwn.net/Articles/379903/
*/
/* For logging errors in read or write */ /* For logging errors in read or write */
DECLARE_EVENT_CLASS(smb3_rw_err_class, DECLARE_EVENT_CLASS(smb3_rw_err_class,
TP_PROTO(unsigned int xid, TP_PROTO(unsigned int xid,
...@@ -529,16 +534,16 @@ DECLARE_EVENT_CLASS(smb3_exit_err_class, ...@@ -529,16 +534,16 @@ DECLARE_EVENT_CLASS(smb3_exit_err_class,
TP_ARGS(xid, func_name, rc), TP_ARGS(xid, func_name, rc),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(unsigned int, xid) __field(unsigned int, xid)
__field(const char *, func_name) __string(func_name, func_name)
__field(int, rc) __field(int, rc)
), ),
TP_fast_assign( TP_fast_assign(
__entry->xid = xid; __entry->xid = xid;
__entry->func_name = func_name; __assign_str(func_name, func_name);
__entry->rc = rc; __entry->rc = rc;
), ),
TP_printk("\t%s: xid=%u rc=%d", TP_printk("\t%s: xid=%u rc=%d",
__entry->func_name, __entry->xid, __entry->rc) __get_str(func_name), __entry->xid, __entry->rc)
) )
#define DEFINE_SMB3_EXIT_ERR_EVENT(name) \ #define DEFINE_SMB3_EXIT_ERR_EVENT(name) \
...@@ -583,14 +588,14 @@ DECLARE_EVENT_CLASS(smb3_enter_exit_class, ...@@ -583,14 +588,14 @@ DECLARE_EVENT_CLASS(smb3_enter_exit_class,
TP_ARGS(xid, func_name), TP_ARGS(xid, func_name),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(unsigned int, xid) __field(unsigned int, xid)
__field(const char *, func_name) __string(func_name, func_name)
), ),
TP_fast_assign( TP_fast_assign(
__entry->xid = xid; __entry->xid = xid;
__entry->func_name = func_name; __assign_str(func_name, func_name);
), ),
TP_printk("\t%s: xid=%u", TP_printk("\t%s: xid=%u",
__entry->func_name, __entry->xid) __get_str(func_name), __entry->xid)
) )
#define DEFINE_SMB3_ENTER_EXIT_EVENT(name) \ #define DEFINE_SMB3_ENTER_EXIT_EVENT(name) \
...@@ -857,16 +862,16 @@ DECLARE_EVENT_CLASS(smb3_reconnect_class, ...@@ -857,16 +862,16 @@ DECLARE_EVENT_CLASS(smb3_reconnect_class,
TP_STRUCT__entry( TP_STRUCT__entry(
__field(__u64, currmid) __field(__u64, currmid)
__field(__u64, conn_id) __field(__u64, conn_id)
__field(char *, hostname) __string(hostname, hostname)
), ),
TP_fast_assign( TP_fast_assign(
__entry->currmid = currmid; __entry->currmid = currmid;
__entry->conn_id = conn_id; __entry->conn_id = conn_id;
__entry->hostname = hostname; __assign_str(hostname, hostname);
), ),
TP_printk("conn_id=0x%llx server=%s current_mid=%llu", TP_printk("conn_id=0x%llx server=%s current_mid=%llu",
__entry->conn_id, __entry->conn_id,
__entry->hostname, __get_str(hostname),
__entry->currmid) __entry->currmid)
) )
...@@ -891,7 +896,7 @@ DECLARE_EVENT_CLASS(smb3_credit_class, ...@@ -891,7 +896,7 @@ DECLARE_EVENT_CLASS(smb3_credit_class,
TP_STRUCT__entry( TP_STRUCT__entry(
__field(__u64, currmid) __field(__u64, currmid)
__field(__u64, conn_id) __field(__u64, conn_id)
__field(char *, hostname) __string(hostname, hostname)
__field(int, credits) __field(int, credits)
__field(int, credits_to_add) __field(int, credits_to_add)
__field(int, in_flight) __field(int, in_flight)
...@@ -899,7 +904,7 @@ DECLARE_EVENT_CLASS(smb3_credit_class, ...@@ -899,7 +904,7 @@ DECLARE_EVENT_CLASS(smb3_credit_class,
TP_fast_assign( TP_fast_assign(
__entry->currmid = currmid; __entry->currmid = currmid;
__entry->conn_id = conn_id; __entry->conn_id = conn_id;
__entry->hostname = hostname; __assign_str(hostname, hostname);
__entry->credits = credits; __entry->credits = credits;
__entry->credits_to_add = credits_to_add; __entry->credits_to_add = credits_to_add;
__entry->in_flight = in_flight; __entry->in_flight = in_flight;
...@@ -907,7 +912,7 @@ DECLARE_EVENT_CLASS(smb3_credit_class, ...@@ -907,7 +912,7 @@ DECLARE_EVENT_CLASS(smb3_credit_class,
TP_printk("conn_id=0x%llx server=%s current_mid=%llu " TP_printk("conn_id=0x%llx server=%s current_mid=%llu "
"credits=%d credit_change=%d in_flight=%d", "credits=%d credit_change=%d in_flight=%d",
__entry->conn_id, __entry->conn_id,
__entry->hostname, __get_str(hostname),
__entry->currmid, __entry->currmid,
__entry->credits, __entry->credits,
__entry->credits_to_add, __entry->credits_to_add,
......
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