Bug 559044 - RFE: strace qualifier: output only on error return from syscall
RFE: strace qualifier: output only on error return from syscall
Product: Fedora
Classification: Fedora
Component: strace (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Jeff Law
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2010-01-26 19:33 EST by John Reiser
Modified: 2012-05-24 23:38 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-05-24 23:38:11 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description John Reiser 2010-01-26 19:33:25 EST
Description of problem: [Request For Enhancement] strace should provide a trace qualifier of 'error': print a syscall only if the result generates an error when performing one of the syscalls in 'set'.  For example, to trace only when an error is generated by a 'write' or 'pwrite', then: "strace -e error=write,pwrite".  The pre-syscall actions must be performed always, but the output line should be suppressed if the syscall succeeds.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
Actual results:

Expected results:

Additional info:
Comment 1 Roland McGrath 2010-01-26 20:40:17 EST
This would entail some change to the way strace works.  That is, now it prints out the syscall name and arguments before the call is made, and then prints the results after the call returns.  This means that it prints something before a call that blocks for a long time, rather than nothing.  For the implementation, it also means that it doesn't actually keep track of what it would have printed in any data structures or anything, it just prints beforehand.  So this feature could require some substantial reworking of how strace does things internally.  Maybe we could do something clever with fmemopen or something to make it fairly painless.  But I think this is the sort of feature you should expect to have to implement yourself upstream (strace-devel@lists.sourceforge.net), or at least raise it there to see if you find someone who feels like implementing it for you.
Comment 3 Jeff Law 2012-05-24 23:38:11 EDT
Roland's comment c#1 is absolutely on target. This feature would need to be implemented upstream in the strace project.  If/when that happens we would pull it into Fedora via the usual mechanisms.

Note You need to log in before you can comment on or make changes to this bug.