linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 3/3] ext4: add needed paramter to ext4_mb_discard_preallocations trace
@ 2020-08-05  1:02 brookxu
  2020-08-05  4:54 ` Andreas Dilger
  0 siblings, 1 reply; 3+ messages in thread
From: brookxu @ 2020-08-05  1:02 UTC (permalink / raw)
  To: tytso, adilger.kernel, linux-kernel; +Cc: linux-ext4

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

Signed-off-by: Chunguang Xu <brookxu@tencent.com>
---
 include/trace/events/ext4.h | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index cc41d69..61736d8 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -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,

-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 3/3] ext4: add needed paramter to ext4_mb_discard_preallocations trace
  2020-08-05  1:02 [PATCH v2 3/3] ext4: add needed paramter to ext4_mb_discard_preallocations trace brookxu
@ 2020-08-05  4:54 ` Andreas Dilger
  2020-08-05  8:51   ` brookxu
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Dilger @ 2020-08-05  4:54 UTC (permalink / raw)
  To: brookxu
  Cc: Theodore Ts'o, Linux Kernel Mailing List, Ext4 Developers List

[-- Attachment #1: Type: text/plain, Size: 1708 bytes --]

On Aug 4, 2020, at 7:02 PM, brookxu <brookxu.cn@gmail.com> wrote:
> 
> Add the needed value to ext4_mb_discard_preallocations trace, so
> we can more easily observe the requested number of trim.
> 
> Signed-off-by: Chunguang Xu <brookxu@tencent.com>

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

Cheers, Andreas

> ---
>  include/trace/events/ext4.h | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
> index cc41d69..61736d8 100644
> --- a/include/trace/events/ext4.h
> +++ b/include/trace/events/ext4.h
> @@ -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,
> 
> --
> 1.8.3.1
> 


Cheers, Andreas






[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 873 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 3/3] ext4: add needed paramter to ext4_mb_discard_preallocations trace
  2020-08-05  4:54 ` Andreas Dilger
@ 2020-08-05  8:51   ` brookxu
  0 siblings, 0 replies; 3+ messages in thread
From: brookxu @ 2020-08-05  8:51 UTC (permalink / raw)
  To: Andreas Dilger
  Cc: Theodore Ts'o, Linux Kernel Mailing List, Ext4 Developers List

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:
> On Aug 4, 2020, at 7:02 PM, brookxu <brookxu.cn@gmail.com> wrote:
>> Add the needed value to ext4_mb_discard_preallocations trace, so
>> we can more easily observe the requested number of trim.
>>
>> Signed-off-by: Chunguang Xu <brookxu@tencent.com>
> IMHO, this should be part of the previous patch that is changing the
> API for ext4_discard_preallocations().
>
> Cheers, Andreas
>
>> ---
>>  include/trace/events/ext4.h | 14 ++++++++------
>>  1 file changed, 8 insertions(+), 6 deletions(-)
>>
>> diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
>> index cc41d69..61736d8 100644
>> --- a/include/trace/events/ext4.h
>> +++ b/include/trace/events/ext4.h
>> @@ -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,
>>
>> --
>> 1.8.3.1
>>
>
> Cheers, Andreas
>
>
>
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-05  8:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-05  1:02 [PATCH v2 3/3] ext4: add needed paramter to ext4_mb_discard_preallocations trace brookxu
2020-08-05  4:54 ` Andreas Dilger
2020-08-05  8:51   ` brookxu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).