I am trying to see how many times is the malloc function called in userspace using a kernel module and kprobes on mmap and brk. I found the system calls inside the kernel as sys_mmap and sys_brk, but when I try to insert the module inside the kernel it says:
insmod: can't insert mallocmonitor.ko. Operation not permitted
Also, when I register a kprobe on __kmalloc, kfree, or map_region functions it works without any problem.
Does anyone has an insight on this?