line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package IPC::Run3::ProfArrayBuffer; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
$VERSION = 0.048; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
IPC::Run3::ProfArrayBuffer - Store profile events in RAM in an array |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 SYNOPSIS |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 DESCRIPTION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=cut |
14
|
|
|
|
|
|
|
|
15
|
3
|
|
|
3
|
|
9639
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
267
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 METHODS |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=over |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=item C<< IPC::Run3::ProfArrayBuffer->new() >> |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=cut |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub new { |
26
|
3
|
50
|
|
3
|
1
|
38
|
my $class = ref $_[0] ? ref shift : shift; |
27
|
|
|
|
|
|
|
|
28
|
3
|
|
|
|
|
11
|
my $self = bless { @_ }, $class; |
29
|
|
|
|
|
|
|
|
30
|
3
|
|
|
|
|
21
|
$self->{Events} = []; |
31
|
|
|
|
|
|
|
|
32
|
3
|
|
|
|
|
11
|
return $self; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=item C<< $buffer->app_call(@events) >> |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=item C<< $buffer->app_exit(@events) >> |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=item C<< $buffer->run_exit(@events) >> |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
The three above methods push the given events onto the stack of recorded |
42
|
|
|
|
|
|
|
events. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=cut |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
for my $subname ( qw(app_call app_exit run_exit) ) { |
47
|
3
|
|
|
3
|
|
12
|
no strict 'refs'; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
310
|
|
48
|
|
|
|
|
|
|
*{$subname} = sub { |
49
|
7
|
|
|
7
|
|
1347
|
push @{shift->{Events}}, [ $subname => @_ ]; |
|
7
|
|
|
|
|
2831
|
|
50
|
|
|
|
|
|
|
}; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=item get_events |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Returns a list of all the events. Each event is an ARRAY reference |
56
|
|
|
|
|
|
|
like: |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
[ "app_call", 1.1, ... ]; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=cut |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub get_events { |
63
|
5
|
|
|
5
|
1
|
895
|
my $self = shift; |
64
|
5
|
|
|
|
|
11
|
@{$self->{Events}}; |
|
5
|
|
|
|
|
55
|
|
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=back |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 LIMITATIONS |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 COPYRIGHT |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Copyright 2003, R. Barrie Slaymaker, Jr., All Rights Reserved |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 LICENSE |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
You may use this module under the terms of the BSD, Artistic, or GPL licenses, |
78
|
|
|
|
|
|
|
any version. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 AUTHOR |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Barrie Slaymaker Ebarries@slaysys.comE |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=cut |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
1; |