Bug 559044 - RFE: strace qualifier: output only on error return from syscall
Summary: RFE: strace qualifier: output only on error return from syscall
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: strace
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jeff Law
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-01-27 00:33 UTC by John Reiser
Modified: 2012-05-25 03:38 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-05-25 03:38:11 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description John Reiser 2010-01-27 00:33:25 UTC
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):
strace-4.5.19-1.fc12.x86_64


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Roland McGrath 2010-01-27 01:40:17 UTC
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.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-25 03:38:11 UTC
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.