diff -r ed1c9f64298a -r 5b9d4d8641ce trace/traceviewer/com.nokia.traceviewer.help/html/tasks/externalfilter.htm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/trace/traceviewer/com.nokia.traceviewer.help/html/tasks/externalfilter.htm Wed Jun 23 14:49:59 2010 +0300 @@ -0,0 +1,72 @@ + + +
+You can specify an external filter application used while tracing. +Every trace is then pushed to the stdin of the specified application. +The application can handle the trace in various ways (write it to file, +modify it, and so on), or write it back to the stdout, where +TraceViewer will catch it and write it to the view.
To use an +external filter application, do the following:
+If there are normal filter rules defined in TraceViewer, they are +applied after traces have been processed through the external +filter application. This means that only Text rules are applied +because the format is changed to text.
+For more information, see Setting up +rules and filters.
+ +The following Perl script uses automatic flushing because otherwise some traces +can be left in a buffer and never get back to TraceViewer. The script reads +from the sdtin, gets a line, adds the text "Prefix: " in front of the +line and prints it back to the stdout for TraceViewer to catch.
+ +#!perl -w + +use English; +use Strict; + +$OUTPUT_AUTOFLUSH = 1; + +while (<>) { + print "Prefix: " . $_; +}+ +
As a result, the following traces are displayed:
+Note: If the external filter application does not print traces back to +the stdout, no traces will be visible in the TraceViewer view. Also, +the external filter application does not have to be a Perl script as in this +example, it can be anything, as long it gets data from stdin and writes +it back to stdout.
+ +