Skip to contentSkip to conversation

ext4: add needed paramter to ext4_mb_discard_preallocations trace

PATCH Superseded brookxu 2 participants 3 messages Aug 5, 2020

Subsystems (2)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

brookxu

author
#0 lore raw

PATCH v2 3/3 ext4: add needed paramter to ext4_mb_discard_preallocations trace

Add the needed value to ext4_mb_discard_preallocations trace, so we can more easily observe the requested number of trim.

---
 include/trace/events/ext4.h | 14 ++++++++------

 1 file changed, 8 insertions(+), 6 deletions(-)
include/trace/events/ext4.h +0 -0
index cc41d69..61736d8 100644
@@ -746,24 +746,26 @@

 );

 TRACE_EVENT(ext4_discard_preallocations,
-    TP_PROTO(struct inode *inode),
+    TP_PROTO(struct inode *inode, unsigned int needed),
-    TP_ARGS(inode),
+    TP_ARGS(inode, needed),

     TP_STRUCT__entry(
-        __field(    dev_t,    dev            ) -        __field(    ino_t,    ino            ) +        __field(    dev_t,        dev        ) +        __field(    ino_t,        ino        ) +        __field(    unsigned int,    needed        )
     ),

     TP_fast_assign(
         __entry->dev    = inode->i_sb->s_dev; __entry->ino    = inode->i_ino;
+        __entry->needed    = needed;
     ),

-    TP_printk("dev %d,%d ino %lu",
+    TP_printk("dev %d,%d ino %lu needed %u", MAJOR(__entry->dev), MINOR(__entry->dev), -          (unsigned long) __entry->ino)
+          (unsigned long) __entry->ino, __entry->needed) );

 TRACE_EVENT(ext4_mb_discard_preallocations,

Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 5 lines · brookxu

Add the needed value to ext4_mb_discard_preallocations trace, so we can more easily observe the requested number of trim.

IMHO, this should be part of the previous patch that is changing the API for ext4_discard_preallocations().

Cheers, Andreas

Quoted 43 lines
---
 include/trace/events/ext4.h | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
include/trace/events/ext4.h +8 -7
index cc41d69..61736d8 100644
@@ -746,24 +746,26 @@
 );
 
 TRACE_EVENT(ext4_discard_preallocations,
-    TP_PROTO(struct inode *inode),
+    TP_PROTO(struct inode *inode, unsigned int needed),
 
-    TP_ARGS(inode),
+    TP_ARGS(inode, needed),
 
     TP_STRUCT__entry(
-        __field(    dev_t,    dev            )
-        __field(    ino_t,    ino            )
+        __field(    dev_t,        dev        )
+        __field(    ino_t,        ino        )
+        __field(    unsigned int,    needed        )
 
     ),
 
     TP_fast_assign(
         __entry->dev    = inode->i_sb->s_dev;
         __entry->ino    = inode->i_ino;
+        __entry->needed    = needed;
     ),
 
-    TP_printk("dev %d,%d ino %lu",
+    TP_printk("dev %d,%d ino %lu needed %u",
           MAJOR(__entry->dev), MINOR(__entry->dev),
-          (unsigned long) __entry->ino)
+          (unsigned long) __entry->ino, __entry->needed)
 );
 
 TRACE_EVENT(ext4_mb_discard_preallocations,
 
--
Quoted 2 lines

1.8.3.1

Cheers, Andreas

author
#2 lore raw

Thanks, this is a good suggestion, and I will merged this patch with the previous patch.

Thanks

Andreas Dilger wrote on 2020/8/5 12:54:

Quoted 62 lines · brookxu
Quoted 4 lines

Add the needed value to ext4_mb_discard_preallocations trace, so we can more easily observe the requested number of trim.

IMHO, this should be part of the previous patch that is changing the API for ext4_discard_preallocations().

Cheers, Andreas

Quoted 43 lines
---
 include/trace/events/ext4.h | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
include/trace/events/ext4.h +8 -7
index cc41d69..61736d8 100644
@@ -746,24 +746,26 @@
 );
 
 TRACE_EVENT(ext4_discard_preallocations,
-    TP_PROTO(struct inode *inode),
+    TP_PROTO(struct inode *inode, unsigned int needed),
 
-    TP_ARGS(inode),
+    TP_ARGS(inode, needed),
 
     TP_STRUCT__entry(
-        __field(    dev_t,    dev            )
-        __field(    ino_t,    ino            )
+        __field(    dev_t,        dev        )
+        __field(    ino_t,        ino        )
+        __field(    unsigned int,    needed        )
 
     ),
 
     TP_fast_assign(
         __entry->dev    = inode->i_sb->s_dev;
         __entry->ino    = inode->i_ino;
+        __entry->needed    = needed;
     ),
 
-    TP_printk("dev %d,%d ino %lu",
+    TP_printk("dev %d,%d ino %lu needed %u",
           MAJOR(__entry->dev), MINOR(__entry->dev),
-          (unsigned long) __entry->ino)
+          (unsigned long) __entry->ino, __entry->needed)
 );
 
 TRACE_EVENT(ext4_mb_discard_preallocations,
 
--
Quoted 2 lines

1.8.3.1

Cheers, Andreas