Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ext4: fix extent_status trace points

Show pblock only if it has meaningful value.

# before
ext4:ext4_es_lookup_extent_exit: dev 253,0 ino 12 found 1 [1/4294967294) 576460752303423487 H
ext4:ext4_es_lookup_extent_exit: dev 253,0 ino 12 found 1 [2/4294967293) 576460752303423487 HR
# after
ext4:ext4_es_lookup_extent_exit: dev 253,0 ino 12 found 1 [1/4294967294) 0 H
ext4:ext4_es_lookup_extent_exit: dev 253,0 ino 12 found 1 [2/4294967293) 0 HR

Signed-off-by: Dmitry Monakhov <dmonakhov@gmail.com>
Link: https://lore.kernel.org/r/20191114200147.1073-2-dmonakhov@gmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>

authored by

Dmitry Monakhov and committed by
Theodore Ts'o
52144d89 459c8074

+10 -4
+6
fs/ext4/extents_status.h
··· 209 209 return es->es_pblk & ~ES_MASK; 210 210 } 211 211 212 + static inline ext4_fsblk_t ext4_es_show_pblock(struct extent_status *es) 213 + { 214 + ext4_fsblk_t pblock = ext4_es_pblock(es); 215 + return pblock == ~ES_MASK ? 0 : pblock; 216 + } 217 + 212 218 static inline void ext4_es_store_pblock(struct extent_status *es, 213 219 ext4_fsblk_t pb) 214 220 {
+4 -4
include/trace/events/ext4.h
··· 2282 2282 __entry->ino = inode->i_ino; 2283 2283 __entry->lblk = es->es_lblk; 2284 2284 __entry->len = es->es_len; 2285 - __entry->pblk = ext4_es_pblock(es); 2285 + __entry->pblk = ext4_es_show_pblock(es); 2286 2286 __entry->status = ext4_es_status(es); 2287 2287 ), 2288 2288 ··· 2371 2371 __entry->ino = inode->i_ino; 2372 2372 __entry->lblk = es->es_lblk; 2373 2373 __entry->len = es->es_len; 2374 - __entry->pblk = ext4_es_pblock(es); 2374 + __entry->pblk = ext4_es_show_pblock(es); 2375 2375 __entry->status = ext4_es_status(es); 2376 2376 ), 2377 2377 ··· 2425 2425 __entry->ino = inode->i_ino; 2426 2426 __entry->lblk = es->es_lblk; 2427 2427 __entry->len = es->es_len; 2428 - __entry->pblk = ext4_es_pblock(es); 2428 + __entry->pblk = ext4_es_show_pblock(es); 2429 2429 __entry->status = ext4_es_status(es); 2430 2430 __entry->found = found; 2431 2431 ), ··· 2593 2593 __entry->ino = inode->i_ino; 2594 2594 __entry->lblk = es->es_lblk; 2595 2595 __entry->len = es->es_len; 2596 - __entry->pblk = ext4_es_pblock(es); 2596 + __entry->pblk = ext4_es_show_pblock(es); 2597 2597 __entry->status = ext4_es_status(es); 2598 2598 __entry->allocated = allocated; 2599 2599 ),