diff mbox series

[2/2] tools/testing/memblock: define pr_warn_ratelimited

Message ID 1661755140-3331-1-git-send-email-chensong_2000@189.cn (mailing list archive)
State New
Headers show
Series [1/2] tools/libs/slab.c: fix compiling mistakes of uatomic_inc/uatomic_dec | expand

Commit Message

Song Chen Aug. 29, 2022, 6:39 a.m. UTC
Commit 14d9a675fd0d("mm: Ratelimited mirrored memory related warning
messages") introduced pr_warn_ratelimited in memblock.c, which breaks
tools/test/memblock, below is the message:

/usr/bin/ld: memblock.o: in function `memblock_find_in_range.constprop.0':
memblock.c:(.text+0x4603): undefined reference to `pr_warn_ratelimited'
/usr/bin/ld: memblock.o: in function `memblock_alloc_range_nid':
memblock.c:(.text+0x786a): undefined reference to `pr_warn_ratelimited'
collect2: error: ld returned 1 exit status

A fake pr_warn_ratelimited needs to be defined in printk.h like other
prink functions.

Signed-off-by: Song Chen <chensong_2000@189.cn>
---
 tools/testing/memblock/linux/printk.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Mike Rapoport Aug. 29, 2022, 8:24 a.m. UTC | #1
On Mon, Aug 29, 2022 at 02:39:00PM +0800, Song Chen wrote:
> Commit 14d9a675fd0d("mm: Ratelimited mirrored memory related warning
> messages") introduced pr_warn_ratelimited in memblock.c, which breaks
> tools/test/memblock, below is the message:
> 
> /usr/bin/ld: memblock.o: in function `memblock_find_in_range.constprop.0':
> memblock.c:(.text+0x4603): undefined reference to `pr_warn_ratelimited'
> /usr/bin/ld: memblock.o: in function `memblock_alloc_range_nid':
> memblock.c:(.text+0x786a): undefined reference to `pr_warn_ratelimited'
> collect2: error: ld returned 1 exit status
> 
> A fake pr_warn_ratelimited needs to be defined in printk.h like other
> prink functions.

This is fixed by commit 0a7e91528202 ("memblock tests: fix compilation errors")
 
> Signed-off-by: Song Chen <chensong_2000@189.cn>
> ---
Song Chen Aug. 29, 2022, 8:32 a.m. UTC | #2
Hi,


在 2022/8/29 16:24, Mike Rapoport 写道:
> On Mon, Aug 29, 2022 at 02:39:00PM +0800, Song Chen wrote:
>> Commit 14d9a675fd0d("mm: Ratelimited mirrored memory related warning
>> messages") introduced pr_warn_ratelimited in memblock.c, which breaks
>> tools/test/memblock, below is the message:
>>
>> /usr/bin/ld: memblock.o: in function `memblock_find_in_range.constprop.0':
>> memblock.c:(.text+0x4603): undefined reference to `pr_warn_ratelimited'
>> /usr/bin/ld: memblock.o: in function `memblock_alloc_range_nid':
>> memblock.c:(.text+0x786a): undefined reference to `pr_warn_ratelimited'
>> collect2: error: ld returned 1 exit status
>>
>> A fake pr_warn_ratelimited needs to be defined in printk.h like other
>> prink functions.
> 
> This is fixed by commit 0a7e91528202 ("memblock tests: fix compilation errors")

Is there a commit taking care of 902c2d91582c(mirrored_kernelcore) ? it 
brakes memblock test too. If not, i have fixed it and will send a patch 
soon.

Song

>   
>> Signed-off-by: Song Chen <chensong_2000@189.cn>
>> ---
>
Mike Rapoport Aug. 29, 2022, 8:45 a.m. UTC | #3
On Mon, Aug 29, 2022 at 04:32:47PM +0800, Song Chen wrote:
> Hi,
> 
> 
> 在 2022/8/29 16:24, Mike Rapoport 写道:
> > On Mon, Aug 29, 2022 at 02:39:00PM +0800, Song Chen wrote:
> > > Commit 14d9a675fd0d("mm: Ratelimited mirrored memory related warning
> > > messages") introduced pr_warn_ratelimited in memblock.c, which breaks
> > > tools/test/memblock, below is the message:
> > > 
> > > /usr/bin/ld: memblock.o: in function `memblock_find_in_range.constprop.0':
> > > memblock.c:(.text+0x4603): undefined reference to `pr_warn_ratelimited'
> > > /usr/bin/ld: memblock.o: in function `memblock_alloc_range_nid':
> > > memblock.c:(.text+0x786a): undefined reference to `pr_warn_ratelimited'
> > > collect2: error: ld returned 1 exit status
> > > 
> > > A fake pr_warn_ratelimited needs to be defined in printk.h like other
> > > prink functions.
> > 
> > This is fixed by commit 0a7e91528202 ("memblock tests: fix compilation errors")
> 
> Is there a commit taking care of 902c2d91582c(mirrored_kernelcore) ? it
> brakes memblock test too. If not, i have fixed it and will send a patch
> soon.

Yes, the same commit that fixed pr_warn_ratelimited() issue.

Please work with recent version of the kernel tree to avoid work
duplication.
 
> Song
>
diff mbox series

Patch

diff --git a/tools/testing/memblock/linux/printk.h b/tools/testing/memblock/linux/printk.h
index 61af424d8c6c..bdca5eedbe4c 100644
--- a/tools/testing/memblock/linux/printk.h
+++ b/tools/testing/memblock/linux/printk.h
@@ -21,5 +21,6 @@ 
 #define pr_cont printk
 #define pr_err printk
 #define pr_warn printk
+#define pr_warn_ratelimited printf
 
 #endif