[PATCH v2 04/11] block/file-posix: add trace event for fallocate() calls

Andrey Drobyshev posted 11 patches 6 months, 2 weeks ago
Maintainers: Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>
There is a newer version of this series
[PATCH v2 04/11] block/file-posix: add trace event for fallocate() calls
Posted by Andrey Drobyshev 6 months, 2 weeks ago
This would ease debugging of write zeroes and discard operations.

Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
---
 block/file-posix.c | 1 +
 block/trace-events | 1 +
 2 files changed, 2 insertions(+)

diff --git a/block/file-posix.c b/block/file-posix.c
index 35684f7e21..45134f0eef 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -1859,6 +1859,7 @@ static int translate_err(int err)
 static int do_fallocate(int fd, int mode, off_t offset, off_t len)
 {
     do {
+        trace_file_do_fallocate(fd, mode, offset, len);
         if (fallocate(fd, mode, offset, len) == 0) {
             return 0;
         }
diff --git a/block/trace-events b/block/trace-events
index 8e789e1f12..2f7ad28996 100644
--- a/block/trace-events
+++ b/block/trace-events
@@ -203,6 +203,7 @@ curl_setup_preadv(uint64_t bytes, uint64_t start, const char *range) "reading %"
 curl_close(void) "close"
 
 # file-posix.c
+file_do_fallocate(int fd, int mode, int64_t offset, int64_t len) "fd=%d mode=0x%02x offset=%" PRIi64 " len=%" PRIi64
 file_copy_file_range(void *bs, int src, int64_t src_off, int dst, int64_t dst_off, int64_t bytes, int flags, int64_t ret) "bs %p src_fd %d offset %"PRIu64" dst_fd %d offset %"PRIu64" bytes %"PRIu64" flags %d ret %"PRId64
 file_FindEjectableOpticalMedia(const char *media) "Matching using %s"
 file_setup_cdrom(const char *partition) "Using %s as optical disc"
-- 
2.39.3
Re: [PATCH v2 04/11] block/file-posix: add trace event for fallocate() calls
Posted by Alberto Garcia 6 months ago
On Mon 13 May 2024 09:31:56 AM +03, Andrey Drobyshev wrote:
> This would ease debugging of write zeroes and discard operations.
>
> Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>

Reviewed-by: Alberto Garcia <berto@igalia.com>

Berto
Re: [PATCH v2 04/11] block/file-posix: add trace event for fallocate() calls
Posted by Alexander Ivanov 6 months, 1 week ago

On 5/13/24 08:31, Andrey Drobyshev wrote:
> This would ease debugging of write zeroes and discard operations.
>
> Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
> ---
>   block/file-posix.c | 1 +
>   block/trace-events | 1 +
>   2 files changed, 2 insertions(+)
>
> diff --git a/block/file-posix.c b/block/file-posix.c
> index 35684f7e21..45134f0eef 100644
> --- a/block/file-posix.c
> +++ b/block/file-posix.c
> @@ -1859,6 +1859,7 @@ static int translate_err(int err)
>   static int do_fallocate(int fd, int mode, off_t offset, off_t len)
>   {
>       do {
> +        trace_file_do_fallocate(fd, mode, offset, len);
>           if (fallocate(fd, mode, offset, len) == 0) {
>               return 0;
>           }
> diff --git a/block/trace-events b/block/trace-events
> index 8e789e1f12..2f7ad28996 100644
> --- a/block/trace-events
> +++ b/block/trace-events
> @@ -203,6 +203,7 @@ curl_setup_preadv(uint64_t bytes, uint64_t start, const char *range) "reading %"
>   curl_close(void) "close"
>   
>   # file-posix.c
> +file_do_fallocate(int fd, int mode, int64_t offset, int64_t len) "fd=%d mode=0x%02x offset=%" PRIi64 " len=%" PRIi64
>   file_copy_file_range(void *bs, int src, int64_t src_off, int dst, int64_t dst_off, int64_t bytes, int flags, int64_t ret) "bs %p src_fd %d offset %"PRIu64" dst_fd %d offset %"PRIu64" bytes %"PRIu64" flags %d ret %"PRId64
>   file_FindEjectableOpticalMedia(const char *media) "Matching using %s"
>   file_setup_cdrom(const char *partition) "Using %s as optical disc"
Reviewed-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>

-- 
Best regards,
Alexander Ivanov