Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

i) Create kmemleak.cfg file under meta-cmf-raspberrypi/recipes-kernel/linux/files with below kernel configs.
Note: Need to add this change in corresponding Platform OEM layer.

CONFIG_HAVE_DEBUG_KMEMLEAK=y
CONFIG_DEBUG_KMEMLEAK=y
CONFIG_DEBUG_KMEMLEAK_TEST=m


ii) Add kmemleak.cfg file  in meta-cmf-raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.10.52.bb 
Note
: Need to add this change in corresponding Platform OEM layer.

Please find below diff file.
Ex:

...

iii) Once build done with above changes, verify the  kernel configs are enabled in final kernel boot config file.
Path of kernel boot config file:  build-raspberrypi-rdk-mc/tmp/work/raspberrypi_rdk_mc-rdk-linux-gnueabi/linux-raspberrypi/1_5.10.52+gitAUTOINC+dbe03fa900_2697f74031-r0/image/boot/config-5.10.52-v7
Note:
Need to verify in corresponding platform specific final kernel boot config file

Ex:

csures569@dvm-yocto3-docker-csures569:~/feature-securestorage-rpi-2Mar/build-raspberrypi-rdk-mc/tmp/work/raspberrypi_rdk_mc-rdk-linux-gnueabi/linux-raspberrypi/1_5.10.52+gitAUTOINC+dbe03fa900_2697f74031-r0/image/boot$ cat config-5.10.52-v7  | grep "KMEMLEAK"
CONFIG_HAVE_DEBUG_KMEMLEAK=y
CONFIG_DEBUG_KMEMLEAK=y
CONFIG_DEBUG_KMEMLEAK_MEM_POOL_SIZE=16000
CONFIG_DEBUG_KMEMLEAK_TEST=m
# CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF is not set
CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y

...

Note: kmemleak-test.ko by default in rpi3 this module not compiled , there is no kmemleak-test.ko module , so enable to build as a module and generated module file.
kmemleak-test.ko

Note: Need to generate kmemleak-test.ko module file from corresponding platform specific kernel source code.

Step 1 : Copy kmemleak-test.ko module to this path /lib/modules/5.10.52-v7/  in box .
Step 2 : load the module to kernel space with insmod command.
Ex:

...