| 1 | # | ||||||||||||||||||||||
| 2 | # $Id: Header.pm,v 1.9 2003/12/24 20:38:54 oratrc Exp $ | ||||||||||||||||||||||
| 3 | # | ||||||||||||||||||||||
| 4 | package Oracle::Trace::Header; | ||||||||||||||||||||||
| 5 | |||||||||||||||||||||||
| 6 | 1 | ▶ | use 5.008001; | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 7 | 1 | ▶ | use strict; | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 8 | 1 | ▶ | use warnings; | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 9 | 1 | ▶ | use Data::Dumper; | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 10 | 1 | ▶ | use Oracle::Trace::Entry; | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 11 | |||||||||||||||||||||||
| 12 | 1 | our @ISA = qw(Oracle::Trace::Entry); | |||||||||||||||||||||
| 13 | |||||||||||||||||||||||
| 14 | 1 | our $VERSION = do { my @r = (q$Revision: 1.9 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; | |||||||||||||||||||||
| 15 | |||||||||||||||||||||||
| 16 | 1 | ▶ | my $DEBUG = $ENV{Oracle_Trace_DEBUG} || 0; | ||||||||||||||||||||
|
Condition50%1/2
$ENV{'Oracle_Trace_DEBUG'} || 0
MC/DC0%0/1
$ENV{'Oracle_Trace_DEBUG'} || 0
$ENV{'Oracle_Trace_DEBUG'}
Truth table50%1/2
A
A= $ENV{'Oracle_Trace_DEBUG'}
| |||||||||||||||||||||||
| 17 | |||||||||||||||||||||||
| 18 | # Chunk | ||||||||||||||||||||||
| 19 | |||||||||||||||||||||||
| 20 | 1 | ▶ | sub parse { | ||||||||||||||||||||
|
Subroutine
parse: called CC=13 SCAR=25.8
Pod
documented
| |||||||||||||||||||||||
| 21 | 1 | my $self = shift; | |||||||||||||||||||||
| 22 | 1 | my $data = shift; | |||||||||||||||||||||
| 23 | 1 | ▶ | $self->debug("incoming: ".Dumper($data)) if $DEBUG >= 3; | ||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||
| 24 | 1 | my $i_line = 0; | |||||||||||||||||||||
| 25 | 1 | ▶ | if ($data) { | ||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||
| 26 | LINE: | ||||||||||||||||||||||
| 27 | 1 | foreach my $line (split("\n", $data)) { | |||||||||||||||||||||
| 28 | 18 | ▶ | $self->debug("line[".$i_line."] $line") if $DEBUG >= 2; | ||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||
| 29 | 18 | $i_line++; | |||||||||||||||||||||
| 30 | 18 | ▶ | next LINE if $line =~ /^\*\*\*\s+\d+/; | ||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||
| 31 | CHUNK: | ||||||||||||||||||||||
| 32 | 17 | foreach my $c (split(',', $line)) { | |||||||||||||||||||||
| 33 | 17 | ▶ | if ($c =~ /^\s*\**\s*([^-:]+)\s*?[-:]+\s*(.+)\s*$/) { | ||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||
| 34 | 13 | my ($k, $v) = ($1, $2); | |||||||||||||||||||||
| 35 | 13 | push @{$self->{_data}->{$k}}, $v; | |||||||||||||||||||||
| 36 | } elsif ($c =~ /^\s*(ORACLE_HOME)\s*=\s*(\S+)\s*$/i) { | ||||||||||||||||||||||
| 37 | 1 | push @{$self->{_data}->{$1}}, $2; | |||||||||||||||||||||
| 38 | } elsif ($c =~ /^([:\\\/\w_]+?\w+\.trc)\s*$/i) { | ||||||||||||||||||||||
| 39 | 1 | push @{$self->{_data}->{tracefile}}, $1; | |||||||||||||||||||||
| 40 | } elsif ($c =~ /^\s*(APPNAME)\s*mod=([\S]+)?\s*(.+)$/i) { | ||||||||||||||||||||||
| 41 | 1 | push @{$self->{_data}->{$1}}, "$2 ($3)"; | |||||||||||||||||||||
| 42 | } else { | ||||||||||||||||||||||
| 43 | 1 | push @{$self->{_data}{other}}, $c; | |||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||
| 46 | # SESSION ID:(9.5) 2003-12-23 20:43:09.907 | ||||||||||||||||||||||
| 47 | # (sid.serial#) | ||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||
| 50 | 1 | ▶ | $self->debug("_data: ".Dumper($self->{_data})) if $DEBUG >= 3; | ||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||
| 51 | 1 | ▶ | $self->debug("lines read: $i_line") if $DEBUG; | ||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||
| 52 | 1 | return $self; | |||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||
| 54 | |||||||||||||||||||||||
| 55 | 1 | 1; | |||||||||||||||||||||
| 56 | __END__ | ||||||||||||||||||||||