NAME
LogFile::Filter - Perl module for filtering out certain time stamps from a set of profiling data.
SYNOPSIS
use LogFile::Parser; use LogFile::Filter;
LogFile::Filter::process_comand_line ();
my $profiling_data = LogFile::Parser::parse ("profiling_data_1234.log"); $profiling_data = LogFile::Filter::apply_filter ($profiling_data);
Sets up the inclusion and exclusion filters from the command line, filters the profiling data set, and returns a new, filtered list.
DESCRIPTION
The LogFileFilter holds an inclusion and an exclusion filter which allow to derive a sub-set of interesting time stamps from a given set of profiling data.
Both filters are specified through a file of regular expressions used for matching function/scope names and messages each. The inclusion filter is used for keeping only those time stamps in the data set that match a regular expression. An empty inclusion filter does not change the data set. The exclusion filter is used to remove all time stamps that match a regular expression. If both filters are given then a time stamp remains in the data set if it matches a regular expression of the inclusion filter but none of the exclusion filter.
Keep the following things in mind:
- Function/scope name and message of a time stamp are divided by the string ' : '.
- Function/scope name or message but not both may be empty.
process_command_line
Looks for the options -i <filename> and -e <filename> in @ARGV. If it finds either or both of them it removes them from @ARGV and initializes the respective filter. The files have to be simple text files with one regular expression per line with optional empty lines or comment lines whose first character is a '#'. Those are ignored.
apply_filter
Apply the inclusion and exclusion filters to the given list of profiling data
sets. The returned value is a new filtered list of data sets.
The list of data sets taken as argument and returned have the same structure as
that returned by LogFileParser::parse
.