Skip to content

Commit 40363cf

Browse files
Qian Caihtejun
authored andcommitted
writeback: fix -Wformat compilation warnings
The commit f05499a ("writeback: use ino_t for inodes in tracepoints") introduced a lot of GCC compilation warnings on s390, In file included from ./include/trace/define_trace.h:102, from ./include/trace/events/writeback.h:904, from fs/fs-writeback.c:82: ./include/trace/events/writeback.h: In function 'trace_raw_output_writeback_page_template': ./include/trace/events/writeback.h:76:12: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'ino_t' {aka 'unsigned int'} [-Wformat=] TP_printk("bdi %s: ino=%lu index=%lu", ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ./include/trace/trace_events.h:360:22: note: in definition of macro 'DECLARE_EVENT_CLASS' trace_seq_printf(s, print); \ ^~~~~ ./include/trace/events/writeback.h:76:2: note: in expansion of macro 'TP_printk' TP_printk("bdi %s: ino=%lu index=%lu", ^~~~~~~~~ Fix them by adding necessary casts where ino_t could be either "unsigned int" or "unsigned long". Fixes: f05499a ("writeback: use ino_t for inodes in tracepoints") Signed-off-by: Qian Cai <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent 03189e8 commit 40363cf

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

include/trace/events/writeback.h

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ DECLARE_EVENT_CLASS(writeback_page_template,
7575

7676
TP_printk("bdi %s: ino=%lu index=%lu",
7777
__entry->name,
78-
__entry->ino,
78+
(unsigned long)__entry->ino,
7979
__entry->index
8080
)
8181
);
@@ -120,7 +120,7 @@ DECLARE_EVENT_CLASS(writeback_dirty_inode_template,
120120

121121
TP_printk("bdi %s: ino=%lu state=%s flags=%s",
122122
__entry->name,
123-
__entry->ino,
123+
(unsigned long)__entry->ino,
124124
show_inode_state(__entry->state),
125125
show_inode_state(__entry->flags)
126126
)
@@ -201,8 +201,8 @@ TRACE_EVENT(inode_foreign_history,
201201

202202
TP_printk("bdi %s: ino=%lu cgroup_ino=%lu history=0x%x",
203203
__entry->name,
204-
__entry->ino,
205-
__entry->cgroup_ino,
204+
(unsigned long)__entry->ino,
205+
(unsigned long)__entry->cgroup_ino,
206206
__entry->history
207207
)
208208
);
@@ -230,9 +230,9 @@ TRACE_EVENT(inode_switch_wbs,
230230

231231
TP_printk("bdi %s: ino=%lu old_cgroup_ino=%lu new_cgroup_ino=%lu",
232232
__entry->name,
233-
__entry->ino,
234-
__entry->old_cgroup_ino,
235-
__entry->new_cgroup_ino
233+
(unsigned long)__entry->ino,
234+
(unsigned long)__entry->old_cgroup_ino,
235+
(unsigned long)__entry->new_cgroup_ino
236236
)
237237
);
238238

@@ -266,10 +266,10 @@ TRACE_EVENT(track_foreign_dirty,
266266
TP_printk("bdi %s[%llu]: ino=%lu memcg_id=%u cgroup_ino=%lu page_cgroup_ino=%lu",
267267
__entry->name,
268268
__entry->bdi_id,
269-
__entry->ino,
269+
(unsigned long)__entry->ino,
270270
__entry->memcg_id,
271-
__entry->cgroup_ino,
272-
__entry->page_cgroup_ino
271+
(unsigned long)__entry->cgroup_ino,
272+
(unsigned long)__entry->page_cgroup_ino
273273
)
274274
);
275275

@@ -296,7 +296,7 @@ TRACE_EVENT(flush_foreign,
296296

297297
TP_printk("bdi %s: cgroup_ino=%lu frn_bdi_id=%u frn_memcg_id=%u",
298298
__entry->name,
299-
__entry->cgroup_ino,
299+
(unsigned long)__entry->cgroup_ino,
300300
__entry->frn_bdi_id,
301301
__entry->frn_memcg_id
302302
)
@@ -326,9 +326,9 @@ DECLARE_EVENT_CLASS(writeback_write_inode_template,
326326

327327
TP_printk("bdi %s: ino=%lu sync_mode=%d cgroup_ino=%lu",
328328
__entry->name,
329-
__entry->ino,
329+
(unsigned long)__entry->ino,
330330
__entry->sync_mode,
331-
__entry->cgroup_ino
331+
(unsigned long)__entry->cgroup_ino
332332
)
333333
);
334334

@@ -383,7 +383,7 @@ DECLARE_EVENT_CLASS(writeback_work_class,
383383
__entry->range_cyclic,
384384
__entry->for_background,
385385
__print_symbolic(__entry->reason, WB_WORK_REASON),
386-
__entry->cgroup_ino
386+
(unsigned long)__entry->cgroup_ino
387387
)
388388
);
389389
#define DEFINE_WRITEBACK_WORK_EVENT(name) \
@@ -421,7 +421,7 @@ DECLARE_EVENT_CLASS(writeback_class,
421421
),
422422
TP_printk("bdi %s: cgroup_ino=%lu",
423423
__entry->name,
424-
__entry->cgroup_ino
424+
(unsigned long)__entry->cgroup_ino
425425
)
426426
);
427427
#define DEFINE_WRITEBACK_EVENT(name) \
@@ -489,7 +489,7 @@ DECLARE_EVENT_CLASS(wbc_class,
489489
__entry->range_cyclic,
490490
__entry->range_start,
491491
__entry->range_end,
492-
__entry->cgroup_ino
492+
(unsigned long)__entry->cgroup_ino
493493
)
494494
)
495495

@@ -528,7 +528,7 @@ TRACE_EVENT(writeback_queue_io,
528528
__entry->age, /* older_than_this in relative milliseconds */
529529
__entry->moved,
530530
__print_symbolic(__entry->reason, WB_WORK_REASON),
531-
__entry->cgroup_ino
531+
(unsigned long)__entry->cgroup_ino
532532
)
533533
);
534534

@@ -622,7 +622,7 @@ TRACE_EVENT(bdi_dirty_ratelimit,
622622
__entry->dirty_ratelimit, /* base ratelimit */
623623
__entry->task_ratelimit, /* ratelimit with position control */
624624
__entry->balanced_dirty_ratelimit, /* the balanced ratelimit */
625-
__entry->cgroup_ino
625+
(unsigned long)__entry->cgroup_ino
626626
)
627627
);
628628

@@ -707,7 +707,7 @@ TRACE_EVENT(balance_dirty_pages,
707707
__entry->pause, /* ms */
708708
__entry->period, /* ms */
709709
__entry->think, /* ms */
710-
__entry->cgroup_ino
710+
(unsigned long)__entry->cgroup_ino
711711
)
712712
);
713713

@@ -735,11 +735,11 @@ TRACE_EVENT(writeback_sb_inodes_requeue,
735735

736736
TP_printk("bdi %s: ino=%lu state=%s dirtied_when=%lu age=%lu cgroup_ino=%lu",
737737
__entry->name,
738-
__entry->ino,
738+
(unsigned long)__entry->ino,
739739
show_inode_state(__entry->state),
740740
__entry->dirtied_when,
741741
(jiffies - __entry->dirtied_when) / HZ,
742-
__entry->cgroup_ino
742+
(unsigned long)__entry->cgroup_ino
743743
)
744744
);
745745

@@ -813,14 +813,14 @@ DECLARE_EVENT_CLASS(writeback_single_inode_template,
813813
TP_printk("bdi %s: ino=%lu state=%s dirtied_when=%lu age=%lu "
814814
"index=%lu to_write=%ld wrote=%lu cgroup_ino=%lu",
815815
__entry->name,
816-
__entry->ino,
816+
(unsigned long)__entry->ino,
817817
show_inode_state(__entry->state),
818818
__entry->dirtied_when,
819819
(jiffies - __entry->dirtied_when) / HZ,
820820
__entry->writeback_index,
821821
__entry->nr_to_write,
822822
__entry->wrote,
823-
__entry->cgroup_ino
823+
(unsigned long)__entry->cgroup_ino
824824
)
825825
);
826826

@@ -861,7 +861,7 @@ DECLARE_EVENT_CLASS(writeback_inode_template,
861861

862862
TP_printk("dev %d,%d ino %lu dirtied %lu state %s mode 0%o",
863863
MAJOR(__entry->dev), MINOR(__entry->dev),
864-
__entry->ino, __entry->dirtied_when,
864+
(unsigned long)__entry->ino, __entry->dirtied_when,
865865
show_inode_state(__entry->state), __entry->mode)
866866
);
867867

0 commit comments

Comments
 (0)