Skip to content

Commit 52144d8

Browse files
dmonakhovtytso
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 459c807 commit 52144d8

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

fs/ext4/extents_status.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,12 @@ static inline ext4_fsblk_t ext4_es_pblock(struct extent_status *es)
209209
return es->es_pblk & ~ES_MASK;
210210
}
211211

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+
212218
static inline void ext4_es_store_pblock(struct extent_status *es,
213219
ext4_fsblk_t pb)
214220
{

include/trace/events/ext4.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2282,7 +2282,7 @@ DECLARE_EVENT_CLASS(ext4__es_extent,
22822282
__entry->ino = inode->i_ino;
22832283
__entry->lblk = es->es_lblk;
22842284
__entry->len = es->es_len;
2285-
__entry->pblk = ext4_es_pblock(es);
2285+
__entry->pblk = ext4_es_show_pblock(es);
22862286
__entry->status = ext4_es_status(es);
22872287
),
22882288

@@ -2371,7 +2371,7 @@ TRACE_EVENT(ext4_es_find_extent_range_exit,
23712371
__entry->ino = inode->i_ino;
23722372
__entry->lblk = es->es_lblk;
23732373
__entry->len = es->es_len;
2374-
__entry->pblk = ext4_es_pblock(es);
2374+
__entry->pblk = ext4_es_show_pblock(es);
23752375
__entry->status = ext4_es_status(es);
23762376
),
23772377

@@ -2425,7 +2425,7 @@ TRACE_EVENT(ext4_es_lookup_extent_exit,
24252425
__entry->ino = inode->i_ino;
24262426
__entry->lblk = es->es_lblk;
24272427
__entry->len = es->es_len;
2428-
__entry->pblk = ext4_es_pblock(es);
2428+
__entry->pblk = ext4_es_show_pblock(es);
24292429
__entry->status = ext4_es_status(es);
24302430
__entry->found = found;
24312431
),
@@ -2593,7 +2593,7 @@ TRACE_EVENT(ext4_es_insert_delayed_block,
25932593
__entry->ino = inode->i_ino;
25942594
__entry->lblk = es->es_lblk;
25952595
__entry->len = es->es_len;
2596-
__entry->pblk = ext4_es_pblock(es);
2596+
__entry->pblk = ext4_es_show_pblock(es);
25972597
__entry->status = ext4_es_status(es);
25982598
__entry->allocated = allocated;
25992599
),

0 commit comments

Comments
 (0)