What is the real time of your kernel? Scope A GPIO to find out

When debugging something as involved as kernel scheduler timings, you will usually use one of the available software debugging mechanisms. However, in cases where the software is close to bare metal, you don't always need to do this. Instead, you can send a signal to a GPIO and then use a logic analyzer or oscilloscope to measure the timing of the signal change - this is what [Albert David] did when evaluating patches for 'Linux kernel PREEMPT_RT real-time operation.

When you opt for a real-time kernel, latency is what matters to you; real time means that for everything you do, you have to get a response within a certain (hopefully very short) interval. [Albert] wrote a program that reads a changing GPIO input and immediately rewrites the new state, and measured both signals to determine the latency of the patched kernel in real time as it processes writes. By overlaying all incoming and outgoing signals on the same scope screen, you can quickly determine how good a scheduler is when it comes to getting acceptable response times, and [Albert] also provides a picture Ready-to-use BeagleBone that you can use for your own experiments, or say, in an educational environment.

What could you use it for? Many hobbyists use real-time kernels on Linux when building controllers for CNC machines and robots, where things like motor control put tight constraints on how quickly a decision in your software is translated into real-world consequences. , and if that sounds in your valley, check out this Linux real-time task tutorial from [Andreas]. If things get too intense for a multitasking system like Linux, you might want to use an RTOS to start with, and we have a guide on that for you too.

What is the real time of your kernel? Scope A GPIO to find out

When debugging something as involved as kernel scheduler timings, you will usually use one of the available software debugging mechanisms. However, in cases where the software is close to bare metal, you don't always need to do this. Instead, you can send a signal to a GPIO and then use a logic analyzer or oscilloscope to measure the timing of the signal change - this is what [Albert David] did when evaluating patches for 'Linux kernel PREEMPT_RT real-time operation.

When you opt for a real-time kernel, latency is what matters to you; real time means that for everything you do, you have to get a response within a certain (hopefully very short) interval. [Albert] wrote a program that reads a changing GPIO input and immediately rewrites the new state, and measured both signals to determine the latency of the patched kernel in real time as it processes writes. By overlaying all incoming and outgoing signals on the same scope screen, you can quickly determine how good a scheduler is when it comes to getting acceptable response times, and [Albert] also provides a picture Ready-to-use BeagleBone that you can use for your own experiments, or say, in an educational environment.

What could you use it for? Many hobbyists use real-time kernels on Linux when building controllers for CNC machines and robots, where things like motor control put tight constraints on how quickly a decision in your software is translated into real-world consequences. , and if that sounds in your valley, check out this Linux real-time task tutorial from [Andreas]. If things get too intense for a multitasking system like Linux, you might want to use an RTOS to start with, and we have a guide on that for you too.

What's Your Reaction?

like

dislike

love

funny

angry

sad

wow