Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3955338
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:13:11+00:00 2026-05-20T02:13:11+00:00

Is there any way I can log the CPU activities, like time-stamp: actual activity

  • 0

Is there any way I can log the CPU activities, like “time-stamp: actual activity” (like context switching, etc.)? It should be like syslog, sar or top, however with more fine grained time values (in nano seconds).

Please let me know if there is a tool which can do this else I am ready for recompiling the Kernel code as well.

I have read a related SO question in this context, where the discussion was mainly related to threads and checked other questions too, however did not get any lead..

Thank you.

[EDIT]: I am looking for a tool(API)/code-change suggestion which can work only at Kernel level, as my context has nothing to do with Application/User space.

[EDIT2]: Brief background: I modified Linux/Android SDIO UART driver and performed benchmarking tests on it (metrics: data transfer speed). The changes which I did indeed improved the performance, however it posed a few questions too. Theoretically the data write time should have been approx 50ns however I observed it to be approx 200ns. In the quest to understand the latency/delay of 150ns, would like to track what CPU does so that I get some cues/answer.

Now, my hopes are on systemtap.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T02:13:11+00:00Added an answer on May 20, 2026 at 2:13 am

    You can’t easily record CPU activities, but you can record your software and kernel activities.

    Oprofile can is a sampling profiler that records a stack trace. Can record the stack of both the user-space application and the kernel.

    Systemtap is another tool (similar to much touted DTrace) that allows to instrument applications and kernel and get detailed stack traces with function arguments and timestamps.

    Using Systemtap you can benchmark functions in the Linux kernel. When analyzing performance on a running system, it is not enough to get min/max/mean/median/stddev because your mean is often going to be too noisy, e.g. the mean of your write function execution time can be 150nsec and stddev is 100nsec, obviously that does not tell you much. Because a picture is worth a thousand words, a good start would be to identify one or more interesting functions in your driver, sample their execution times and then display the sample set as a histogram.

    This can be done by inserting probes at function entry and return. The function entry probe saves the current time as entry time. The function return probe takes current time and subtracts the entry time to get the function execution time. Use the function execution time as a subscript/key into an array (Systemtap arrays are hash tables in fact) and increment the sample count associated with that key. After you’ve collected enough samples (you can count them) finish the Systemtap session. On session exit display the array as a histogram, Systemtap provides a function that does it.

    I don’t provide any samples because Systemtap has an excellent tutorial.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way I can log a Wordpress user in given only their
Is there any way can declare a bean in just like JSP UseBean in
Is there any way that I can log / record / monitor / view
Is there any way I can force git log to read commit history from
Is there any way I can make postgres server only log incoming statements without
I am learning to use <cfscript> . Is there any way I can log
Is there any way I can set a formatter on models that will convert
Is there any way we can fetch X509 Public Cetrificates using c# from AD
Is there any way I can use JPA or hibernate annotations to specify the
Is there any way I can do Select TableName.SomeColumn As SomeAlias FROM TableName In

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.