diff options
author | Richard Yao <[email protected]> | 2016-01-12 21:01:14 -0500 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-01-15 15:38:35 -0800 |
commit | 546f38433a870a2cf9907c6c61daad22a289fe39 (patch) | |
tree | 0b8ab4b63aa9e66ae930eddaba2801bae50f0247 /include/sys/trace_dbuf.h | |
parent | b10695c8f1ce317cd24d99af7998741a35a5ce48 (diff) |
SET_ERROR should print strings
When debugging with tracepoints, we see string pointers:
zfs 3017 [006] 8878.728915: zfs:zfs_set__error: ffffffffa0eec3fc:3013:ffffffffa0ebcd60(): error 0x2
ffffffffa0e1ca43 spa_open_common (/lib/modules/3.12.21-gentoo-r1/extra/zfs/zfs.ko)
ffffffffa0e1cbe3 spa_open (/lib/modules/3.12.21-gentoo-r1/extra/zfs/zfs.ko)
ffffffffa0e6f6ef zfs_ioc_stable (/lib/modules/3.12.21-gentoo-r1/extra/zfs/zfs.ko)
ffffffffa0e6f2a9 zfsdev_ioctl (/lib/modules/3.12.21-gentoo-r1/extra/zfs/zfs.ko)
ffffffff811909dd do_vfs_ioctl ([kernel.kallsyms])
ffffffff81190c41 sys_ioctl ([kernel.kallsyms])
ffffffff8156e2e9 system_call_fastpath ([kernel.kallsyms])
7ff7d8be69c7 __GI___ioctl (/lib64/libc-2.19.so)
7ff7d90cac53 lzc_ioctl.constprop.3 (/lib64/libzfs_core.so.1.0.0)
636f695f637a6c00 [unknown] ([unknown])
Printing the actual strings is more convenient:
zfs 3461 [001] 10599.847692: zfs:zfs_set__error: spa.c:3013:spa_open_common(): error 0x2
ffffffffa116ba43 spa_open_common (/lib/modules/3.12.21-gentoo-r1/extra/zfs/zfs.ko)
ffffffffa116bbe3 spa_open (/lib/modules/3.12.21-gentoo-r1/extra/zfs/zfs.ko)
ffffffffa11be8df zfs_ioc_stable (/lib/modules/3.12.21-gentoo-r1/extra/zfs/zfs.ko)
ffffffffa11be499 zfsdev_ioctl (/lib/modules/3.12.21-gentoo-r1/extra/zfs/zfs.ko)
ffffffff811909dd do_vfs_ioctl ([kernel.kallsyms])
ffffffff81190c41 sys_ioctl ([kernel.kallsyms])
ffffffff8156e2e9 system_call_fastpath ([kernel.kallsyms])
7f11b843c9c7 __GI___ioctl (/lib64/libc-2.19.so)
7f11b8920c53 lzc_ioctl.constprop.3 (/lib64/libzfs_core.so.1.0.0)
636f695f637a6c00 [unknown] ([unknown])
A few other tracepoints have strings as well, so switch to printing
the actual string values at the same time.
Signed-off-by: Richard Yao <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #4212
Diffstat (limited to 'include/sys/trace_dbuf.h')
-rw-r--r-- | include/sys/trace_dbuf.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/sys/trace_dbuf.h b/include/sys/trace_dbuf.h index 49e35e3dc..aca6d6531 100644 --- a/include/sys/trace_dbuf.h +++ b/include/sys/trace_dbuf.h @@ -42,7 +42,8 @@ */ #define DBUF_TP_STRUCT_ENTRY \ - __field(const char *, os_spa) \ + __string(os_spa, \ + spa_name(DB_DNODE(db)->dn_objset->os_spa)) \ __field(uint64_t, ds_object) \ __field(uint64_t, db_object) \ __field(uint64_t, db_level) \ @@ -53,8 +54,8 @@ __field(int64_t, db_holds) \ #define DBUF_TP_FAST_ASSIGN \ - __entry->os_spa = \ - spa_name(DB_DNODE(db)->dn_objset->os_spa); \ + __assign_str(os_spa, \ + spa_name(DB_DNODE(db)->dn_objset->os_spa)); \ \ __entry->ds_object = db->db_objset->os_dsl_dataset ? \ db->db_objset->os_dsl_dataset->ds_object : 0; \ @@ -72,7 +73,7 @@ "blkid %llu offset %llu size %llu state %llu holds %lld }" #define DBUF_TP_PRINTK_ARGS \ - __entry->os_spa, __entry->ds_object, \ + __get_str(os_spa), __entry->ds_object, \ __entry->db_object, __entry->db_level, \ __entry->db_blkid, __entry->db_offset, \ __entry->db_size, __entry->db_state, __entry->db_holds |