scoutfs: trace print lockspace and lock names correctly

We weren't using the right string macros in the recent lock traces, fix
that. Also osb->cconn->cc_name is NULL terminated so we don't need to
keep the string length around.

Signed-off-by: Mark Fasheh <mfasheh@versity.com>
This commit is contained in:
Mark Fasheh
2017-12-15 15:34:07 -08:00
committed by Zach Brown
parent cdc2249fcf
commit 29d97086aa
+28 -32
View File
@@ -1957,9 +1957,8 @@ TRACE_EVENT(ocfs2_cluster_lock,
TP_ARGS(osb, lockres, requested, lkm_flags, arg_flags),
TP_STRUCT__entry(
__field(char *, lockspace)
__field(int, lockspace_len)
__field(char *, lockname)
__string(lockspace, osb->cconn->cc_name)
__string(lockname, lockres->l_pretty_name)
__field(int, requested)
__field(unsigned int, lkm_flags)
__field(unsigned int, arg_flags)
@@ -1972,9 +1971,8 @@ TRACE_EVENT(ocfs2_cluster_lock,
),
TP_fast_assign(
__entry->lockspace = osb->cconn->cc_name;
__entry->lockspace_len = osb->cconn->cc_namelen;
__entry->lockname = lockres->l_pretty_name;
__assign_str(lockspace, osb->cconn->cc_name);
__assign_str(lockname, lockres->l_pretty_name);
__entry->requested = requested;
__entry->lkm_flags = lkm_flags;
__entry->arg_flags = arg_flags;
@@ -1986,11 +1984,12 @@ TRACE_EVENT(ocfs2_cluster_lock,
__entry->ex_holders = lockres->l_ex_holders;
),
TP_printk("lockspace %.*s lock %s requested %d lkm_flags 0x%x arg_flags 0x%x lockres->level %d lockres->flags 0x%x lockres->blocking %d holders cw/pr/ex %u/%u/%u",
__entry->lockspace_len, __entry->lockspace, __entry->lockname,
__entry->requested, __entry->lkm_flags, __entry->arg_flags,
__entry->lockres_level, __entry->lockres_flags, __entry->blocking,
__entry->cw_holders, __entry->pr_holders, __entry->ex_holders)
TP_printk("lockspace %s lock %s requested %d lkm_flags 0x%x arg_flags 0x%x lockres->level %d lockres->flags 0x%x lockres->blocking %d holders cw/pr/ex %u/%u/%u",
__get_str(lockspace), __get_str(lockname), __entry->requested,
__entry->lkm_flags, __entry->arg_flags,
__entry->lockres_level, __entry->lockres_flags,
__entry->blocking, __entry->cw_holders, __entry->pr_holders,
__entry->ex_holders)
);
TRACE_EVENT(ocfs2_cluster_unlock,
@@ -2000,9 +1999,8 @@ TRACE_EVENT(ocfs2_cluster_unlock,
TP_ARGS(osb, lockres, level),
TP_STRUCT__entry(
__field(char *, lockspace)
__field(int, lockspace_len)
__field(char *, lockname)
__string(lockspace, osb->cconn->cc_name)
__string(lockname, lockres->l_pretty_name)
__field(int, level)
__field(unsigned int, lockres_flags)
__field(int, lockres_level)
@@ -2013,9 +2011,8 @@ TRACE_EVENT(ocfs2_cluster_unlock,
),
TP_fast_assign(
__entry->lockspace = osb->cconn->cc_name;
__entry->lockspace_len = osb->cconn->cc_namelen;
__entry->lockname = lockres->l_pretty_name;
__assign_str(lockspace, osb->cconn->cc_name);
__assign_str(lockname, lockres->l_pretty_name);
__entry->level = level;
__entry->lockres_flags = lockres->l_flags;
__entry->lockres_level = lockres->l_level;
@@ -2025,11 +2022,11 @@ TRACE_EVENT(ocfs2_cluster_unlock,
__entry->ex_holders = lockres->l_ex_holders;
),
TP_printk("lockspace %.*s lock %s level %d lockres->level %d lockres->flags 0x%x lockres->blocking %d holders cw/pr/ex: %u/%u/%u",
__entry->lockspace_len, __entry->lockspace, __entry->lockname,
__entry->level, __entry->lockres_level, __entry->lockres_flags,
__entry->blocking, __entry->cw_holders, __entry->pr_holders,
__entry->ex_holders)
TP_printk("lockspace %s lock %s level %d lockres->level %d lockres->flags 0x%x lockres->blocking %d holders cw/pr/ex: %u/%u/%u",
__get_str(lockspace), __get_str(lockname), __entry->level,
__entry->lockres_level, __entry->lockres_flags,
__entry->blocking, __entry->cw_holders, __entry->pr_holders,
__entry->ex_holders)
);
DECLARE_EVENT_CLASS(ocfs2_lock_res_class,
@@ -2038,9 +2035,8 @@ DECLARE_EVENT_CLASS(ocfs2_lock_res_class,
TP_ARGS(osb, lockres),
TP_STRUCT__entry(
__field(char *, lockspace)
__field(int, lockspace_len)
__field(char *, lockname)
__string(lockspace, osb->cconn->cc_name)
__string(lockname, lockres->l_pretty_name)
__field(unsigned int, lockres_flags)
__field(int, lockres_level)
__field(int, blocking)
@@ -2050,9 +2046,8 @@ DECLARE_EVENT_CLASS(ocfs2_lock_res_class,
),
TP_fast_assign(
__entry->lockspace = osb->cconn->cc_name;
__entry->lockspace_len = osb->cconn->cc_namelen;
__entry->lockname = lockres->l_pretty_name;
__assign_str(lockspace, osb->cconn->cc_name);
__assign_str(lockname, lockres->l_pretty_name);
__entry->lockres_flags = lockres->l_flags;
__entry->lockres_level = lockres->l_level;
__entry->blocking = lockres->l_blocking;
@@ -2061,10 +2056,11 @@ DECLARE_EVENT_CLASS(ocfs2_lock_res_class,
__entry->ex_holders = lockres->l_ex_holders;
),
TP_printk("lockspace %.*s lock %s lockres->level %d lockres->flags 0x%x lockres->blocking %d holders cw/pr/ex: %u/%u/%u",
__entry->lockspace_len, __entry->lockspace, __entry->lockname,
__entry->lockres_level, __entry->lockres_flags, __entry->blocking,
__entry->cw_holders, __entry->pr_holders, __entry->ex_holders)
TP_printk("lockspace %s lock %s lockres->level %d lockres->flags 0x%x lockres->blocking %d holders cw/pr/ex: %u/%u/%u",
__get_str(lockspace), __get_str(lockname),
__entry->lockres_level, __entry->lockres_flags,
__entry->blocking, __entry->cw_holders,
__entry->pr_holders, __entry->ex_holders)
);
DEFINE_EVENT(ocfs2_lock_res_class, ocfs2_simple_drop_lockres,