Welcome to Our Community

While Linux.org has been around for a while, we recently changed management and had to purge most of the content (including users). If you signed up before April 23rd, 2017 please sign up again. Thanks!

CPU Context Info required

Discussion in 'General Linux' started by Naughty Neurons, Feb 9, 2018.

  1. Naughty Neurons

    Naughty Neurons New Member

    Joined:
    Feb 9, 2018
    Messages:
    1
    Likes Received:
    0
    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.
     
  2. nuna

    nuna Member

    Joined:
    Aug 29, 2017
    Messages:
    36
    Likes Received:
    57
    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.
     
  3. JasKinasis

    JasKinasis Well-Known Member

    Joined:
    Apr 25, 2017
    Messages:
    224
    Likes Received:
    399
    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:
    https://www.pixelbeat.org/programming/profiling/
    http://www.brendangregg.com/perf.html

    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! :/
     

Share This Page