Bug 187847
Summary: | Strace -c -o -ff creates empty output files | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 4 | Reporter: | Larry Lile <lile> | ||||
Component: | strace | Assignee: | Stepan Kasal <kasal> | ||||
Status: | CLOSED WONTFIX | QA Contact: | Brian Brock <bbrock> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 4.0 | CC: | lans, ldv, skottie | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | All | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2006-06-16 14:46:13 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Bug Depends On: | |||||||
Bug Blocks: | 176344 | ||||||
Attachments: |
|
Description
Larry Lile
2006-04-03 21:10:21 UTC
Created attachment 127260 [details]
Patch for -o -ff -c bug
This is not intended to be an argument against the patch, but the strace man page pretty clearly indicates that -c and -o are not intended to be used together. If we go forward with this patch, we should also fix the man page. I didn't read the man page in that way, it seemed somewhat undefined. The only link between the 3 options is the appending of pid, as I read it. Maybe my copy of the man page is outdated? -c Count time, calls, and errors for each system call and report a summary on program exit. On Linux, this attempts to show system time (CPU time spent running in the kernel) independent of wall clock time. -ff If the -o filename option is in effect, each pro- cesses trace is written to filename.pid where pid is the numeric process id of each process. -o filename Write the trace output to the file filename rather than to stderr. Use filename.pid if -ff is used. If the argument begins with `|' or with `!' then the rest of the argument is treated as a command and all output is piped to it. This is convenient for pip- ing the debugging output to a program without affecting the redirections of executed programs. Either way, I haven't heard from the strace maintainers as yet. Strictly speaking, I'm neither RH nor upstream strace maintainer. However, Roland's opinion is not available yet. I suppose that, as described in strace(1) synopsis, -c is not compatible with -a, -i, -r, -s, -t, and -x options. However, I think that -c is compatible with -d, -e, -f, -o, -p, -q, -u, -E and -F despite of current wording in synopsis. Regarding to -c -ff -o: unless -c is extended to handle each pid separately, this combination is not compatible, one should use smth like -c -f -o instead. That is, both manpage and source code should be corrected: code should reject incompatible options, and synopsis should be updated. Ah, I didn't check the summary and you are correct. I don't think there is a good answer to the -c -ff -o combination, with -c -ff, it summarizes parent and children so I simply made the action of -o consistent. It was also easier to code and happened to be the result set I needed at the time. -c -f -o and -c -f are consistent and produce a summary of the parent only. I'm not married to any solution on this, full summary, summary per pid, declaring the combination invalid or just waiting for the Strace maintainers to pass judgement. If I do hear from the Strace maintainers I will update the case with their response. I've changed strace upstream to refuse -c and -ff together. Oh well. :-) Maybe one of these days I'll have the free time to revisit this and provide a better patch that could support -c -ff/-o in a suitable and useful manner. It would probably require supporting -c in some other way depending on whether the user wanted a single summary of parent and children or parent and each child separately. Anyway, thanks for taking the time to consider the issue. Now it won't take anyone by surprise. Development Management has reviewed and declined this request. You may appeal this decision by reopening this request. |