]>
git.ipfire.org Git - thirdparty/squid.git/blob - scripts/trace-job.pl
3 # Reads cache.log and displays lines that correspond to a given async job.
5 # If job entering/exiting line format changes, the script must be updated.
6 # Keep the old RE around for a while because they may be handy for working
7 # with folks running older Squids.
12 my $XactId = shift or die("usage: $0 <xaction id> [log file]\n");
14 # Squid uses asyncNNN, jobNNN, icapxNNN for the same job/transaction
15 # TODO: use jobNNN everywhere
16 $XactId =~ s/^(?:async|job|icapx)(\d+)$/(async|job|icapx)$1/ and
17 warn("Replacing xaction ID with $XactId\n");
24 $entering = $_ if !$inside && /[|:] entering\b/;
25 undef $entering if /[|:] leaving\b/;
27 # if (!$inside && /\bcalled\b.*\b$XactId\b/o) {
28 if (!$inside && /\bstatus in\b.*\b$XactId\b/o) {
29 print $entering if defined $entering;
33 my $external = !$inside && /\b$XactId\b/o;
35 print $_ if $inside || $external;
36 print "\n" if $external;
40 # if (/\bended\b.*\b$XactId\b/o || /\bswan\s+sang\b.*\b$XactId\b/o) {
41 # if (/\bstatus out\b.*\b$XactId\b/o || /\bswan\s+sang\b.*\b$XactId\b/o ||
42 if (/[|:] leaving\b/) {