After long research on my own, I have come to ask for help here.
I want to measure the latency of the kernel for an application.
For example, I have a C-based application, when I run it I want to measure the time it takes for the kernel to schedule it.
I have used the time.h library in my C application but it tells me the time it takes for the execution of the application and not how much time the kernel is taking to schedule it.
PS: I have been using PREEMPT_RT patch, and my kernel is already PREEMPTIVE, if that information is somehow useful for you to answer.