Re: [PATCH] selftests: Add _GNU_SOURCE definition when including kselftest_harness.h

2024-05-09 Thread Jakub Kicinski
On Thu, 9 May 2024 13:08:36 +0800 Tao Su wrote: > > SGTM, FWIW. The print is printing a test summary line, printing more > > than 1k seems rather unreasonable. Other facilities, like TH_LOG(), > > should be used for displaying longer info. > > Thanks, do you think 1k is enough for test_name? De

Re: [PATCH] selftests: Add _GNU_SOURCE definition when including kselftest_harness.h

2024-05-08 Thread Tao Su
On Wed, May 08, 2024 at 10:57:47AM -0700, Edward Liaw wrote: > On Wed, May 8, 2024 at 7:00 AM Jakub Kicinski wrote: > > > > On Wed, 8 May 2024 10:55:05 +0800 Tao Su wrote: > > > Back to commit 38c957f07038, I don't see any advantage in using LINE_MAX. > > > Can we use a fixed value instead of LINE

Re: [PATCH] selftests: Add _GNU_SOURCE definition when including kselftest_harness.h

2024-05-08 Thread Tao Su
On Wed, May 08, 2024 at 07:00:03AM -0700, Jakub Kicinski wrote: > On Wed, 8 May 2024 10:55:05 +0800 Tao Su wrote: > > Back to commit 38c957f07038, I don't see any advantage in using LINE_MAX. > > Can we use a fixed value instead of LINE_MAX? E.g., 1024, 2048. Then we > > just need to revert commit

Re: [PATCH] selftests: Add _GNU_SOURCE definition when including kselftest_harness.h

2024-05-08 Thread Edward Liaw
On Wed, May 8, 2024 at 7:00 AM Jakub Kicinski wrote: > > On Wed, 8 May 2024 10:55:05 +0800 Tao Su wrote: > > Back to commit 38c957f07038, I don't see any advantage in using LINE_MAX. > > Can we use a fixed value instead of LINE_MAX? E.g., 1024, 2048. Then we > > just need to revert commit 80921623

Re: [PATCH] selftests: Add _GNU_SOURCE definition when including kselftest_harness.h

2024-05-08 Thread Jakub Kicinski
On Wed, 8 May 2024 10:55:05 +0800 Tao Su wrote: > Back to commit 38c957f07038, I don't see any advantage in using LINE_MAX. > Can we use a fixed value instead of LINE_MAX? E.g., 1024, 2048. Then we > just need to revert commit 809216233555. SGTM, FWIW. The print is printing a test summary line, pr

Re: [PATCH] selftests: Add _GNU_SOURCE definition when including kselftest_harness.h

2024-05-07 Thread Tao Su
On Tue, May 07, 2024 at 10:06:51AM -0700, Andrew Morton wrote: > On Tue, 7 May 2024 14:35:34 +0800 Tao Su wrote: > > > asprintf() is declared in stdio.h when defining _GNU_SOURCE, but stdio.h > > is so common that many files don’t define _GNU_SOURCE before including > > stdio.h, and defining _GN

Re: [PATCH] selftests: Add _GNU_SOURCE definition when including kselftest_harness.h

2024-05-07 Thread Andrew Morton
On Tue, 7 May 2024 14:35:34 +0800 Tao Su wrote: > asprintf() is declared in stdio.h when defining _GNU_SOURCE, but stdio.h > is so common that many files don’t define _GNU_SOURCE before including > stdio.h, and defining _GNU_SOURCE after including stdio.h will no longer > take effect. > > Since

[PATCH] selftests: Add _GNU_SOURCE definition when including kselftest_harness.h

2024-05-06 Thread Tao Su
asprintf() is declared in stdio.h when defining _GNU_SOURCE, but stdio.h is so common that many files don’t define _GNU_SOURCE before including stdio.h, and defining _GNU_SOURCE after including stdio.h will no longer take effect. Since kselftest_harness.h introduces asprintf(), it is necessary to