bug#67490: [PATCH v2] tail: fix tailing sysfs files on large page kernels

2023-12-01 Thread Pádraig Brady
On 01/12/2023 01:54, Paul Eggert wrote: On 11/30/23 12:11, Pádraig Brady wrote: Though that will generally give 128K, which is good when processing all of a file, but perhaps overkill when processing just the last part of a file. The 128 KiB number was computed as being better for apps like 's

bug#67490: [PATCH v2] tail: fix tailing sysfs files on large page kernels

2023-11-30 Thread Paul Eggert
On 11/30/23 12:11, Pádraig Brady wrote: Though that will generally give 128K, which is good when processing all of a file, but perhaps overkill when processing just the last part of a file. The 128 KiB number was computed as being better for apps like 'sed' that typically read all or most of

bug#67490: [PATCH v2] tail: fix tailing sysfs files on large page kernels

2023-11-30 Thread dann frazier
On Thu, Nov 30, 2023 at 08:11:52PM +, Pádraig Brady wrote: > Much clearer thanks. > > On my system: > > $ stat /sys/kernel/profiling > File: /sys/kernel/profiling > Size: 4096Blocks: 0 IO Block: 4096 regular file > > I can easily repro by setting the buffer size

bug#67490: [PATCH v2] tail: fix tailing sysfs files on large page kernels

2023-11-30 Thread Pádraig Brady
Much clearer thanks. On my system: $ stat /sys/kernel/profiling File: /sys/kernel/profiling Size: 4096 Blocks: 0 IO Block: 4096 regular file I can easily repro by setting the buffer size < PAGE_SIZE. So this patch handles the case where sysfs reports a file is a c

bug#67490: [PATCH v2] tail: fix tailing sysfs files on large page kernels

2023-11-29 Thread dann frazier
Changes from v1: - Fallback to BUFSIZ if fstat fails instead of exiting. - Add a comment block to explain why the blksize is used in file_lines() (which I hope also clarifies why it is not needed elsewhere). - Only use blksize if it is > BUFSIZ (I had regressed to 4K reads, oops). - Update c