mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 19:19:32 +03:00
Add NULL guard in zfs_zrlock_class event class
The owner field could be NULL in some cases, so add a guard. Shorten __entry field names to fit assignment statements in 80 columns. Signed-off-by: Ned Bass <bass6@llnl.gov> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Fixes #3220
This commit is contained in:
parent
ee2ca1db28
commit
95a6990d9a
@ -42,28 +42,28 @@ DECLARE_EVENT_CLASS(zfs_zrlock_class,
|
|||||||
TP_PROTO(zrlock_t *zrl, uint32_t n),
|
TP_PROTO(zrlock_t *zrl, uint32_t n),
|
||||||
TP_ARGS(zrl, n),
|
TP_ARGS(zrl, n),
|
||||||
TP_STRUCT__entry(
|
TP_STRUCT__entry(
|
||||||
__field(int32_t, zr_refcount)
|
__field(int32_t, refcount)
|
||||||
#ifdef ZFS_DEBUG
|
#ifdef ZFS_DEBUG
|
||||||
__field(pid_t, zr_owner_pid)
|
__field(pid_t, owner_pid)
|
||||||
__field(const char *, zr_caller)
|
__field(const char *, caller)
|
||||||
#endif
|
#endif
|
||||||
__field(uint32_t, n)
|
__field(uint32_t, n)
|
||||||
),
|
),
|
||||||
TP_fast_assign(
|
TP_fast_assign(
|
||||||
__entry->zr_refcount = zrl->zr_refcount;
|
__entry->refcount = zrl->zr_refcount;
|
||||||
#ifdef ZFS_DEBUG
|
#ifdef ZFS_DEBUG
|
||||||
__entry->zr_owner_pid = zrl->zr_owner->pid;
|
__entry->owner_pid = zrl->zr_owner ? zrl->zr_owner->pid : 0;
|
||||||
__entry->zr_caller = zrl->zr_caller;
|
__entry->caller = zrl->zr_caller;
|
||||||
#endif
|
#endif
|
||||||
__entry->n = n;
|
__entry->n = n;
|
||||||
),
|
),
|
||||||
#ifdef ZFS_DEBUG
|
#ifdef ZFS_DEBUG
|
||||||
TP_printk("zrl { refcount %d owner_pid %d caller %s } n %u",
|
TP_printk("zrl { refcount %d owner_pid %d caller %s } n %u",
|
||||||
__entry->zr_refcount, __entry->zr_owner_pid, __entry->zr_caller,
|
__entry->refcount, __entry->owner_pid, __entry->caller,
|
||||||
__entry->n)
|
__entry->n)
|
||||||
#else
|
#else
|
||||||
TP_printk("zrl { refcount %d } n %u",
|
TP_printk("zrl { refcount %d } n %u",
|
||||||
__entry->zr_refcount, __entry->n)
|
__entry->refcount, __entry->n)
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user