sipwise / rtpengine

The Sipwise media proxy for Kamailio
GNU General Public License v3.0
763 stars 360 forks source link

How to get linux/btree.h #1834

Closed dilyanpalauzov closed 1 month ago

dilyanpalauzov commented 1 month ago

rtpengine version the issue has been seen with

No response

Used distribution and its version

No response

Linux kernel version used

No response

CPU architecture issue was seen on (see uname -m)

None

Expected behaviour you didn't see

https://github.com/sipwise/rtpengine/commit/38b17eb04d33746f74 inserts in kernel-module/xt_RTPENGINE.c: #include <linux/btree.h>. I cannot convince the kernel, after compiling it, to install linux/btree.h.

Unexpected behaviour you saw

No response

Steps to reproduce the problem

No response

Additional program output to the terminal or logs illustrating the issue

No response

Anything else?

No response

rfuchs commented 1 month ago

Debian ships btree.h in their linux-headers package. We can't support random custom kernel builds.

dilyanpalauzov commented 1 month ago

The problem with the missing linux/btree.h somehow disappeared. The next challenge was to have btree_init provided by the kernel. My investigations showed, that for btree_init to be available, CONFIG_BTREE=Y must be set, which means some symbol must call select BTREE. In the 5.10.218 kernel these are only drivers/staging/vc04_services/bcm2835-camera — VIDEO_BCM2835 : “BCM2835 Camera”; drivers/scsi/qla2xxx (under SCSI Low-level drivers) SCSI_QLA_FC: “QLogic QLA2XXX Fibre Channel Support” and TCM_QLA2XXX: “TCM_QLA2XXX fabric module for QLogic 24xx+ series target mode HBAs”.

Without select BTREE:

$ nm vmlinux.o|grep -i [^ru]btree
0000000000069720 r btree_aops
00000000005141d0 t btree_csum_one_bio
0000000000514420 t btree_invalidatepage
000000000003c695 t btree_invalidatepage.cold
0000000000513650 t btree_migratepage
000000000058ea40 T btree_readahead_hook
0000000000514d30 t btree_read_extent_buffer_pages
00000000005136d0 t btree_releasepage
0000000000513710 t btree_set_page_dirty
0000000000514410 t btree_submit_bio_start
0000000000547fe0 T btree_write_cache_pages
0000000000513720 t btree_writepages
00000000005178d0 T btrfs_btree_balance_dirty
0000000000517930 T btrfs_btree_balance_dirty_nodelay
000000000053ef30 t set_btree_ioerr
0000000000105fd0 d __TRACE_SYSTEM_IO_TREE_BTREE_INODE_IO
00000000000006f8 d TRACE_SYSTEM_IO_TREE_BTREE_INODE_IO

With select BTREE:

$ nm vmlinux.o|grep -i [^ru]btree
00000000006e1800 T btree_alloc                                      
0000000000069720 r btree_aops                                       
000000000023af10 b btree_cachep                                     
00000000005141d0 t btree_csum_one_bio                            
00000000006e1a10 T btree_destroy                                    
00000000006e1870 t __btree_for_each                                 
00000000006e1810 T btree_free                                       
00000000002c7e40 D btree_geo128                                     
00000000002c7e60 D btree_geo32
00000000002c7e50 D btree_geo64
00000000006e1ab0 T btree_get_prev
00000000006e19a0 T btree_grim_visitor
00000000006e1820 T btree_init
00000000006e1710 T btree_init_mempool
00000000006e2bb0 T btree_insert
00000000006e2630 t btree_insert_level
0000000000514420 t btree_invalidatepage
… and many more …

To sum up, prerequisite to compile rtpengine’s kernel module, is to enable one of the above symbols when compiling the kernel. These symbols can be compiled as modules, which modules are never loaded at runtime, and they ensure that btree_init is available in the kernel.