btrfs: tracepoints: fix extent type symbolic name print
authorNikolay Borisov <nborisov@suse.com>
Fri, 19 Jun 2020 12:24:47 +0000 (15:24 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 27 Jul 2020 10:55:29 +0000 (12:55 +0200)
commit0840dd28b52f0ceba91265ec62bffdcedb82b4a9
treeb4a429e918a5bcb871ef267df6d1f84f83aad765
parent45e31869cc4fa8d7c7d2b890965b1b3abf0cfd6d
btrfs: tracepoints: fix extent type symbolic name print

extent's type is an enum and this requires that the enum values be
exported to user space so that user space tools can correctly map raw
binary data to the symbolic name. Currently tracepoints using
btrfs__file_extent_item_regular or btrfs__file_extent_item_inline result
in the following output:

fio-443   [002]   586.609450: btrfs_get_extent_show_fi_regular: f0c3bf8e-0174-4bcc-92aa-6c2d62430420:i
root=5(FS_TREE) inode=258 size=2136457216 disk_isize=0
file extent range=[2126946304 2136457216] (num_bytes=9510912
ram_bytes=9510912 disk_bytenr=0 disk_num_bytes=0 extent_offset=0
type=0x1 compression=0

E.g type is 0x1 . With this patch applie the output is:

<ommitted for brevity>  disk_bytenr=141348864 disk_num_bytes=4096 extent_offset=0 type=REG compression=0

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
include/trace/events/btrfs.h