Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316036 - Redirect error stream to file when launching stap
Summary: Redirect error stream to file when launching stap
Status: RESOLVED WONTFIX
Alias: None
Product: Linux Tools
Classification: Tools
Component: Call Graph (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Roland Grunberg CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-07 13:41 EDT by Roland Grunberg CLA
Modified: 2010-06-07 15:52 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roland Grunberg CLA 2010-06-07 13:41:16 EDT
Currently the error stream is sent straight to the console. Since message boxes are already used to display errors and how to fix them, there should be no need for the same console output. It would be nice if the error stream of stap was sent to a file, so there would be no need to create an error stream listener just to grab that data.
Comment 1 Charley Wang CLA 2010-06-07 14:00:11 EDT
Callgraph currently prints the first 500 lines of error to TEMP_ERROR_OUTPUT which is by default PluginConstants.getDefaultOutput() + "stapTempError.error" for debugging purposes.

There should be a listener registered somewhere on the process that updates the Console for error output, if we could find it we could probably deregister it.
Comment 2 Roland Grunberg CLA 2010-06-07 14:41:35 EDT
Yes this is true. TEMP_ERROR_OUTPUT contains the data collected from the error stream. However, the data is collected by using a listener on the error stream. The error stream itself outputs to the console. By redirecting the error stream to a file we could (maybe) eliminate the need to have that listener, and at the same time eliminate the output to console.
Comment 3 Charley Wang CLA 2010-06-07 14:56:36 EDT
(In reply to comment #2)
> Yes this is true. TEMP_ERROR_OUTPUT contains the data collected from the error
> stream. However, the data is collected by using a listener on the error stream.
> The error stream itself outputs to the console. By redirecting the error stream
> to a file we could (maybe) eliminate the need to have that listener, and at the
> same time eliminate the output to console.

You're right, so avenues of attack:

- Redirect error from command to /dev/null (may interfere with error collection)
- Attempt to disengage the listener that is writing errors to the console
- Attempt to modify the listener to output to a file instead of to console

The middle two are the more attractive options.

Is removing console error output what we really want to do? We can circumvent most of the problems by doing additional checks before running stap, which would leave just the parsing/compile-time errors in the console log. It could be useful for users to see those errors as they are presented by SystemTap
Comment 4 Andrew Overholt CLA 2010-06-07 14:58:05 EDT
The console _in_ Eclipse can have error messages.  We just don't want any going to the terminal from which Eclipse was launched (stderr).
Comment 5 Roland Grunberg CLA 2010-06-07 15:13:41 EDT
When severin said :

"I get:
/tmp/org.eclipse.linuxtools.profiling.launch12756903992658802859707393390776.sh: line 2: exec: stap: not found
on the console and an error dialog pops up that SystemTap is not installed. I think this is expected behaviour."

he was refering to the eclipse console.

I'm pretty sure we don't have any output being sent to the console from which eclipse is launched. The discussion charley and I were having pertained specifically to avoiding outputting to the eclipse console, but since this is acceptable I guess we can close this bug?
Comment 6 Andrew Overholt CLA 2010-06-07 15:49:43 EDT
Yes, feel free to resolve.  I was confused by the overloaded word "console" :)
Comment 7 Roland Grunberg CLA 2010-06-07 15:52:36 EDT
Won't fix the "outputting to eclipse console" since this is valid, and text being sent to the console from which eclipse was launched is not a an issue.