Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
08-13-2011, 03:33 PM
|
#1
|
|
LQ Newbie
Registered: Aug 2011
Posts: 3
Rep: 
|
How accurate is strace?
Greetings all,
Anyone know how accurate strace is when displaying the time taken to execute a system call?
The reason I ask is if I use nanosleep(100000) in a program then compile it
and do a "strace -T" is shows 0.100080 which is an error of 80uS (a lifetime on a 1.7GHz PC).
In most situations such a small error is of no consequence but there are times
when it does make a difference.
Is the error in strace or in nanosleep?
B.T.W. a printf("some_text") takes 50uS to execute on the same computer according to strace.
Thanking you in advance.
|
|
|
|
08-13-2011, 05:29 PM
|
#2
|
|
Moderator
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,903
|
Just a hypothetical answer: executing a program under strace (or
anything other than a hardware debugger) would naturally incur
a performance penalty?
Cheers,
Tink
|
|
|
|
08-13-2011, 05:41 PM
|
#3
|
|
Senior Member
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Kubuntu
Posts: 1,045
|
The accurate of nanosleep() depends on kernel version, kernel configuration options (CONFIG_HZ, CONFIG_NO_HZ, CONFIG_HIGH_RES_TIMERS) and hardware clocks precision.
|
|
|
|
08-13-2011, 10:09 PM
|
#4
|
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 11,225
|
I use strace more for functionality rather than precision - I often just use relative timing. But for comparison, not absolute timings.
Maybe have a look at perf stats or (kernel) function tracing.
Last edited by syg00; 08-14-2011 at 01:26 AM.
Reason: typo
|
|
|
|
08-14-2011, 02:55 AM
|
#5
|
|
LQ Newbie
Registered: Aug 2011
Posts: 3
Original Poster
Rep: 
|
Thank you all for your comments and guidance.
I did expect an overhead running strace I just didn't expect 80uS worth.
I will investigate the kernel config. options and look at perf stats.
Thanks once again.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
|
strace
|
palisetty_suman |
Linux - Newbie |
2 |
07-01-2012 08:24 AM |
|
strace option
|
mohit_parihar |
Linux - General |
4 |
01-26-2010 11:39 PM |
|
strace app
|
RajRed |
Linux - Software |
1 |
12-03-2005 12:39 AM |
|
Usage of strace
|
mdb84 |
Linux - Software |
1 |
03-25-2005 02:13 AM |
|
strace useradd
|
phoenix_fei |
Programming |
1 |
11-29-2004 10:32 AM |
All times are GMT -5. The time now is 08:03 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|