CPU Context Info required

Naughty Neurons

New Member
Feb 9, 2018
Reaction score
I am running Linux Kernel Version 2.6.35 on single core PowerPC. To debug the behavior of some user/application programs running on my system, I need a software that can tell me information about the trace of processes running on CPU and when/how they are switched and which new process takes the CPU. So, in a nutshell I need CPU Context Info with timestamps. I know that I can generate the required information using Ftrace Tool, but the problem is that the support of such tools have to be build into the linux while compiling the kernel. Since the already build kernel doesn't have this feature build in it, and since the kernel compilation is not possible for me at the moment as there are many customization in the system as well and I don´t have the required documents/config files to re-compile the kernel.

Is there a way to get CPU context information with timestamp using a software that doesnot require having to recompile the kernel.
Any help in this regard would be highly appreciable.

Welcome ~
First and foremost, this is kind of out of my scope so take my words with a grain of salt as I'm stepping out of my comfort zone.
After reading your post, the firsts words that came to mind were strace and sysdig.
Choosing a linux tracer has some notes on perf, lttng, dtrace, ktap, systemtap, strace, sysdig, and other pages refer to ptrace, kprobes... You'll have to research if they met your needs and work with your current kernel and architecture.

On the other side, many Linux Monitoring tools can track the history of process and CPU activity to help identify offending processes. Once identified, tracing tools can give some more clues.

Maybe @JasKinasis and some other developers can give you better advice.
I'm more of a desktop/user-space applications programmer, so I've never really messed around much at the kernel level.

I've used things like valgrind in the past to help track down memory leaks in applications, but I've not really had to deal much with system-wide profiling.

Have you taken a look at perf? Support for perf has been built into the kernel since 2.6.31- not sure if it's a standard thing that's built in by default, or whether it's an optional thing - but it might be worth a look. I've used it once or twice in the past when trying to diagnose performance related problems. (When an application was performing badly and I wanted to see if it was the application itself, or one of its dependencies that was causing the issue).

I've just had a dig through some old Firefox bookmarks I backed up a few years ago and found these two links that helped me to get started with perf:

I've heard of most of the other tools in Nuna's post above, but I haven't really used any of them.
Off the top of my head, one other profiling tool that hasn't been mentioned yet is sysprof. Again, I've never used it - it's just something I know the name of!

Hope this is in some way useful! :/

Members online

Latest posts