← Index
NYTProf Performance Profile   « line view »
For /usr/local/bin/sa-learn
  Run on Tue Nov 7 05:38:10 2017
Reported on Tue Nov 7 06:16:03 2017

Filename/usr/local/lib/perl5/site_perl/Mail/SpamAssassin/Locker/UnixNFSSafe.pm
StatementsExecuted 244 statements in 12.3ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
6112.39ms2.39msMail::SpamAssassin::Locker::UnixNFSSafe::::CORE:linkMail::SpamAssassin::Locker::UnixNFSSafe::CORE:link (opcode)
3222.20ms3.34sMail::SpamAssassin::Locker::UnixNFSSafe::::safe_lockMail::SpamAssassin::Locker::UnixNFSSafe::safe_lock
8411.01ms1.01msMail::SpamAssassin::Locker::UnixNFSSafe::::CORE:unlinkMail::SpamAssassin::Locker::UnixNFSSafe::CORE:unlink (opcode)
111983µs3.81msMail::SpamAssassin::Locker::UnixNFSSafe::::BEGIN@26Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@26
322868µs5.47sMail::SpamAssassin::Locker::UnixNFSSafe::::safe_unlockMail::SpamAssassin::Locker::UnixNFSSafe::safe_unlock
311761µs761µsMail::SpamAssassin::Locker::UnixNFSSafe::::CORE:sysopenMail::SpamAssassin::Locker::UnixNFSSafe::CORE:sysopen (opcode)
921670µs670µsMail::SpamAssassin::Locker::UnixNFSSafe::::CORE:printMail::SpamAssassin::Locker::UnixNFSSafe::CORE:print (opcode)
311585µs585µsMail::SpamAssassin::Locker::UnixNFSSafe::::CORE:openMail::SpamAssassin::Locker::UnixNFSSafe::CORE:open (opcode)
1241331µs331µsMail::SpamAssassin::Locker::UnixNFSSafe::::CORE:lstatMail::SpamAssassin::Locker::UnixNFSSafe::CORE:lstat (opcode)
621102µs102µsMail::SpamAssassin::Locker::UnixNFSSafe::::CORE:closeMail::SpamAssassin::Locker::UnixNFSSafe::CORE:close (opcode)
11164µs74µsMail::SpamAssassin::Locker::UnixNFSSafe::::BEGIN@20Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@20
31147µs47µsMail::SpamAssassin::Locker::UnixNFSSafe::::CORE:statMail::SpamAssassin::Locker::UnixNFSSafe::CORE:stat (opcode)
11137µs102µsMail::SpamAssassin::Locker::UnixNFSSafe::::BEGIN@23Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@23
11136µs59µsMail::SpamAssassin::Locker::UnixNFSSafe::::newMail::SpamAssassin::Locker::UnixNFSSafe::new
11135µs112µsMail::SpamAssassin::Locker::UnixNFSSafe::::BEGIN@27Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@27
11132µs62µsMail::SpamAssassin::Locker::UnixNFSSafe::::BEGIN@21Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@21
11131µs3.06msMail::SpamAssassin::Locker::UnixNFSSafe::::BEGIN@31Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@31
11129µs108µsMail::SpamAssassin::Locker::UnixNFSSafe::::BEGIN@33Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@33
11129µs238µsMail::SpamAssassin::Locker::UnixNFSSafe::::BEGIN@28Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@28
11126µs39µsMail::SpamAssassin::Locker::UnixNFSSafe::::BEGIN@22Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@22
11126µs207µsMail::SpamAssassin::Locker::UnixNFSSafe::::BEGIN@57Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@57
11126µs196µsMail::SpamAssassin::Locker::UnixNFSSafe::::BEGIN@30Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@30
11117µs17µsMail::SpamAssassin::Locker::UnixNFSSafe::::BEGIN@25Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@25
62117µs17µsMail::SpamAssassin::Locker::UnixNFSSafe::::CORE:umaskMail::SpamAssassin::Locker::UnixNFSSafe::CORE:umask (opcode)
11114µs14µsMail::SpamAssassin::Locker::UnixNFSSafe::::BEGIN@29Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@29
0000s0sMail::SpamAssassin::Locker::UnixNFSSafe::::refresh_lockMail::SpamAssassin::Locker::UnixNFSSafe::refresh_lock
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1# <@LICENSE>
2# Licensed to the Apache Software Foundation (ASF) under one or more
3# contributor license agreements. See the NOTICE file distributed with
4# this work for additional information regarding copyright ownership.
5# The ASF licenses this file to you under the Apache License, Version 2.0
6# (the "License"); you may not use this file except in compliance with
7# the License. You may obtain a copy of the License at:
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16# </@LICENSE>
17
18package Mail::SpamAssassin::Locker::UnixNFSSafe;
19
20273µs285µs
# spent 74µs (64+11) within Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@20 which was called: # once (64µs+11µs) by Mail::SpamAssassin::BEGIN@2 at line 20
use strict;
# spent 74µs making 1 call to Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@20 # spent 11µs making 1 call to strict::import
21269µs292µs
# spent 62µs (32+30) within Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@21 which was called: # once (32µs+30µs) by Mail::SpamAssassin::BEGIN@2 at line 21
use warnings;
# spent 62µs making 1 call to Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@21 # spent 30µs making 1 call to warnings::import
22272µs252µs
# spent 39µs (26+12) within Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@22 which was called: # once (26µs+12µs) by Mail::SpamAssassin::BEGIN@2 at line 22
use bytes;
# spent 39µs making 1 call to Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@22 # spent 12µs making 1 call to bytes::import
23266µs2166µs
# spent 102µs (37+64) within Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@23 which was called: # once (37µs+64µs) by Mail::SpamAssassin::BEGIN@2 at line 23
use re 'taint';
# spent 102µs making 1 call to Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@23 # spent 64µs making 1 call to re::import
24
25251µs117µs
# spent 17µs within Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@25 which was called: # once (17µs+0s) by Mail::SpamAssassin::BEGIN@2 at line 25
use Mail::SpamAssassin;
262278µs13.81ms
# spent 3.81ms (983µs+2.83) within Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@26 which was called: # once (983µs+2.83ms) by Mail::SpamAssassin::BEGIN@2 at line 26
use Mail::SpamAssassin::Locker;
27273µs2189µs
# spent 112µs (35+77) within Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@27 which was called: # once (35µs+77µs) by Mail::SpamAssassin::BEGIN@2 at line 27
use Mail::SpamAssassin::Util;
# spent 112µs making 1 call to Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@27 # spent 77µs making 1 call to Exporter::import
28267µs2447µs
# spent 238µs (29+209) within Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@28 which was called: # once (29µs+209µs) by Mail::SpamAssassin::BEGIN@2 at line 28
use Mail::SpamAssassin::Logger;
# spent 238µs making 1 call to Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@28 # spent 209µs making 1 call to Exporter::import
29258µs114µs
# spent 14µs within Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@29 which was called: # once (14µs+0s) by Mail::SpamAssassin::BEGIN@2 at line 29
use File::Spec;
30280µs2367µs
# spent 196µs (26+170) within Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@30 which was called: # once (26µs+170µs) by Mail::SpamAssassin::BEGIN@2 at line 30
use Time::Local;
# spent 196µs making 1 call to Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@30 # spent 170µs making 1 call to Exporter::import
31292µs26.10ms
# spent 3.06ms (31µs+3.03) within Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@31 which was called: # once (31µs+3.03ms) by Mail::SpamAssassin::BEGIN@2 at line 31
use Fcntl qw(:DEFAULT :flock);
# spent 3.06ms making 1 call to Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@31 # spent 3.03ms making 1 call to Exporter::import
32
3312µs
# spent 108µs (29+79) within Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@33 which was called: # once (29µs+79µs) by Mail::SpamAssassin::BEGIN@2 at line 35
use vars qw{
34 @ISA
351167µs2187µs};
# spent 108µs making 1 call to Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@33 # spent 79µs making 1 call to vars::import
36
37116µs@ISA = qw(Mail::SpamAssassin::Locker);
38
39###########################################################################
40
41
# spent 59µs (36+23) within Mail::SpamAssassin::Locker::UnixNFSSafe::new which was called: # once (36µs+23µs) by Mail::SpamAssassin::create_locker at line 3 of (eval 33)[Mail/SpamAssassin.pm:475]
sub new {
4212µs my $class = shift;
43115µs123µs my $self = $class->SUPER::new(@_);
# spent 23µs making 1 call to Mail::SpamAssassin::Locker::new
44115µs $self;
45}
46
47###########################################################################
48# NFS-safe locking (I hope!):
49# Attempt to create a file lock, using NFS-safe locking techniques.
50#
51# Locking code adapted from code by Alexis Rosen <alexis@panix.com>
52# by Kelsey Cummings <kgc@sonic.net>, with mods by jm and quinlan
53#
54# A good implementation of Alexis' code, for reference, is here:
55# http://mail-index.netbsd.org/netbsd-bugs/1996/04/17/0002.html
56
5722.25ms2387µs
# spent 207µs (26+180) within Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@57 which was called: # once (26µs+180µs) by Mail::SpamAssassin::BEGIN@2 at line 57
use constant LOCK_MAX_AGE => 600; # seconds
# spent 207µs making 1 call to Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@57 # spent 180µs making 1 call to constant::import
58
59
# spent 3.34s (2.20ms+3.34) within Mail::SpamAssassin::Locker::UnixNFSSafe::safe_lock which was called 3 times, avg 1.11s/call: # 2 times (1.71ms+2.63s) by Mail::SpamAssassin::BayesStore::DBM::tie_db_writable at line 280 of Mail/SpamAssassin/BayesStore/DBM.pm, avg 1.32s/call # once (489µs+705ms) by Mail::SpamAssassin::DBBasedAddrList::new_checker at line 71 of Mail/SpamAssassin/DBBasedAddrList.pm
sub safe_lock {
60312µs my ($self, $path, $max_retries, $mode) = @_;
6137µs my $is_locked = 0;
6237µs my @stat;
63
6436µs $max_retries ||= 30;
6536µs $mode ||= "0700";
66313µs $mode = (oct $mode) & 0666;
67332µs336µs dbg ("locker: mode is $mode");
# spent 36µs making 3 calls to Mail::SpamAssassin::Logger::dbg, avg 12µs/call
68
69311µs my $lock_file = "$path.lock";
70329µs3368µs my $hname = Mail::SpamAssassin::Util::fq_hostname();
# spent 368µs making 3 calls to Mail::SpamAssassin::Util::fq_hostname, avg 123µs/call
71347µs3396µs my $lock_tmp = Mail::SpamAssassin::Util::untaint_file_path
# spent 396µs making 3 calls to Mail::SpamAssassin::Util::untaint_file_path, avg 132µs/call
72 ($path.".lock.".$hname.".".$$);
73
74 # keep this for unlocking
75322µs $self->{lock_tmp} = $lock_tmp;
76
77346µs310µs my $umask = umask(~$mode);
# spent 10µs making 3 calls to Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:umask, avg 3µs/call
783624µs3585µs if (!open(LTMP, ">$lock_tmp")) {
# spent 585µs making 3 calls to Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:open, avg 195µs/call
79 umask $umask; # just in case
80 die "locker: safe_lock: cannot create tmp lockfile $lock_tmp for $lock_file: $!\n";
81 }
82328µs37µs umask $umask;
# spent 7µs making 3 calls to Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:umask, avg 2µs/call
83352µs3417µs autoflush LTMP 1;
# spent 417µs making 3 calls to IO::Handle::autoflush, avg 139µs/call
84330µs326µs dbg("locker: safe_lock: created $lock_tmp");
# spent 26µs making 3 calls to Mail::SpamAssassin::Logger::dbg, avg 9µs/call
85
86336µs for (my $retries = 0; $retries < $max_retries; $retries++) {
87976µs33.33s if ($retries > 0) { $self->jittery_one_second_sleep(); }
# spent 3.33s making 3 calls to Mail::SpamAssassin::Locker::jittery_one_second_sleep, avg 1.11s/call
8861.31ms6427µs print LTMP "$hname.$$\n" or warn "Error writing to $lock_tmp: $!";
# spent 427µs making 6 calls to Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:print, avg 71µs/call
896123µs699µs dbg("locker: safe_lock: trying to get lock on $path with $retries retries");
# spent 99µs making 6 calls to Mail::SpamAssassin::Logger::dbg, avg 16µs/call
9062.46ms62.39ms if (link($lock_tmp, $lock_file)) {
# spent 2.39ms making 6 calls to Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:link, avg 399µs/call
91327µs319µs dbg("locker: safe_lock: link to $lock_file: link ok");
# spent 19µs making 3 calls to Mail::SpamAssassin::Logger::dbg, avg 6µs/call
9237µs $is_locked = 1;
93313µs last;
94 }
95 # link _may_ return false even if the link _is_ created
963123µs368µs @stat = lstat($lock_tmp);
# spent 68µs making 3 calls to Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:lstat, avg 23µs/call
9737µs @stat or warn "locker: error accessing $lock_tmp: $!";
9839µs if (defined $stat[3] && $stat[3] > 1) {
99 dbg("locker: safe_lock: link to $lock_file: stat ok");
100 $is_locked = 1;
101 last;
102 }
103 # check age of lockfile ctime
104313µs my $now = ($#stat < 11 ? undef : $stat[10]);
1053170µs394µs @stat = lstat($lock_file);
# spent 94µs making 3 calls to Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:lstat, avg 31µs/call
10638µs @stat or warn "locker: error accessing $lock_file: $!";
107314µs my $lock_age = ($#stat < 11 ? undef : $stat[10]);
108320µs if (defined($lock_age) && defined($now) && ($now - $lock_age) > LOCK_MAX_AGE)
109 {
110 # we got a stale lock, break it
111114µs16µs dbg("locker: safe_lock: breaking stale $lock_file: age=" .
# spent 6µs making 1 call to Mail::SpamAssassin::Logger::dbg
112 (defined $lock_age ? $lock_age : "undef") . " now=$now");
1131179µs1166µs unlink($lock_file)
114 or warn "locker: safe_lock: unlink of lock file $lock_file failed: $!\n";
115 }
116 }
117
118386µs352µs close LTMP or die "error closing $lock_tmp: $!";
# spent 52µs making 3 calls to Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:close, avg 17µs/call
1193224µs3197µs unlink($lock_tmp)
# spent 197µs making 3 calls to Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:unlink, avg 66µs/call
120 or warn "locker: safe_lock: unlink of temp lock $lock_tmp failed: $!\n";
121
122 # record this for safe unlocking
123312µs if ($is_locked) {
1243124µs378µs @stat = lstat($lock_file);
# spent 78µs making 3 calls to Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:lstat, avg 26µs/call
12537µs @stat or warn "locker: error accessing $lock_file: $!";
126313µs my $lock_ctime = ($#stat < 11 ? undef : $stat[10]);
127
128313µs $self->{lock_ctimes} ||= { };
129314µs $self->{lock_ctimes}->{$path} = $lock_ctime;
130 }
131
132350µs return $is_locked;
133}
134
135###########################################################################
136
137
# spent 5.47s (868µs+5.47) within Mail::SpamAssassin::Locker::UnixNFSSafe::safe_unlock which was called 3 times, avg 1.82s/call: # 2 times (524µs+1.62ms) by Mail::SpamAssassin::BayesStore::DBM::untie_db at line 627 of Mail/SpamAssassin/BayesStore/DBM.pm, avg 1.07ms/call # once (344µs+5.47s) by Mail::SpamAssassin::DBBasedAddrList::finish at line 113 of Mail/SpamAssassin/DBBasedAddrList.pm
sub safe_unlock {
138310µs my ($self, $path) = @_;
139
140316µs my $lock_file = "$path.lock";
141314µs my $lock_tmp = $self->{lock_tmp};
14237µs if (!$lock_tmp) {
143 dbg("locker: safe_unlock: $path.lock never locked");
144 return;
145 }
146
147 # 1. Build a temp file and stat that to get an idea of what the server
148 # thinks the current time is (our_tmp.st_ctime). note: do not use time()
149 # directly because the server's clock may be out of sync with the client's.
150
15138µs my @stat_ourtmp;
1523847µs3761µs if (!defined sysopen(LTMP, $lock_tmp, O_CREAT|O_WRONLY|O_EXCL, 0700)) {
# spent 761µs making 3 calls to Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:sysopen, avg 254µs/call
153 warn "locker: safe_unlock: failed to create lock tmpfile $lock_tmp: $!";
154 return;
155 } else {
156365µs3582µs autoflush LTMP 1;
# spent 582µs making 3 calls to IO::Handle::autoflush, avg 194µs/call
1573278µs3243µs print LTMP "\n" or warn "Error writing to $lock_tmp: $!";
# spent 243µs making 3 calls to Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:print, avg 81µs/call
158
1593146µs347µs if (!(@stat_ourtmp = stat(LTMP)) || (scalar(@stat_ourtmp) < 11)) {
# spent 47µs making 3 calls to Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:stat, avg 16µs/call
160 @stat_ourtmp or warn "locker: error accessing $lock_tmp: $!";
161 warn "locker: safe_unlock: failed to create lock tmpfile $lock_tmp";
162 close LTMP or die "error closing $lock_tmp: $!";
163 unlink($lock_tmp)
164 or warn "locker: safe_lock: unlink of lock file failed: $!\n";
165 return;
166 }
167 }
168
16937µs my $ourtmp_ctime = $stat_ourtmp[10]; # paranoia
17037µs if (!defined $ourtmp_ctime) {
171 die "locker: safe_unlock: stat failed on $lock_tmp";
172 }
173
174380µs349µs close LTMP or die "error closing $lock_tmp: $!";
# spent 49µs making 3 calls to Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:close, avg 16µs/call
1753569µs3526µs unlink($lock_tmp)
# spent 526µs making 3 calls to Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:unlink, avg 175µs/call
176 or warn "locker: safe_lock: unlink of lock file failed: $!\n";
177
178 # 2. If the ctime hasn't been modified, unlink the file and return. If the
179 # lock has expired, sleep the usual random interval before returning. If we
180 # didn't sleep, there could be a race if the caller immediately tries to
181 # relock the file.
182
183317µs my $lock_ctime = $self->{lock_ctimes}->{$path};
18437µs if (!defined $lock_ctime) {
185 warn "locker: safe_unlock: no ctime recorded for $lock_file";
186 return;
187 }
188
1893137µs391µs my @stat_lock = lstat($lock_file);
# spent 91µs making 3 calls to Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:lstat, avg 30µs/call
190355µs @stat_lock or warn "locker: error accessing $lock_file: $!";
191
19237µs my $now_ctime = $stat_lock[10];
193
19438µs if (defined $now_ctime && $now_ctime == $lock_ctime)
195 {
196 # things are good: the ctimes match so it was our lock
1971130µs1118µs unlink($lock_file)
198 or warn "locker: safe_unlock: unlink failed: $lock_file\n";
199110µs18µs dbg("locker: safe_unlock: unlink $lock_file");
# spent 8µs making 1 call to Mail::SpamAssassin::Logger::dbg
200
20116µs if ($ourtmp_ctime >= $lock_ctime + LOCK_MAX_AGE) {
202 # the lock has expired, so sleep a bit; use some randomness
203 # to avoid race conditions.
204112µs16µs dbg("locker: safe_unlock: lock expired on $lock_file expired safely; sleeping");
# spent 6µs making 1 call to Mail::SpamAssassin::Logger::dbg
205236µs my $i; for ($i = 0; $i < 5; $i++) {
206569µs55.47s $self->jittery_one_second_sleep();
# spent 5.47s making 5 calls to Mail::SpamAssassin::Locker::jittery_one_second_sleep, avg 1.09s/call
207 }
208 }
209146µs return;
210 }
211
212 # 4. Either ctime has been modified, or the entire lock file is missing.
213 # If the lock should still be ours, based on the ctime of the temp
214 # file, warn it was stolen. If not, then our lock is expired and
215 # someone else has grabbed the file, so warn it was lost.
216242µs if ($ourtmp_ctime < $lock_ctime + LOCK_MAX_AGE) {
217 warn "locker: safe_unlock: lock on $lock_file was stolen";
218 } else {
219256µs warn "locker: safe_unlock: lock on $lock_file was lost due to expiry";
220 }
221}
222
223###########################################################################
224
225sub refresh_lock {
226 my($self, $path) = @_;
227
228 return unless $path;
229
230 # this could arguably read the lock and make sure the same process
231 # owns it, but this shouldn't, in theory, be an issue.
232 # TODO: in NFS, it definitely may be one :(
233
234 my $lock_file = "$path.lock";
235 utime time, time, $lock_file;
236
237 # update the lock_ctimes entry
238 my @stat = lstat($lock_file);
239 @stat or warn "locker: error accessing $lock_file: $!";
240
241 my $lock_ctime = ($#stat < 11 ? undef : $stat[10]);
242 $self->{lock_ctimes}->{$path} = $lock_ctime;
243
244 dbg("locker: refresh_lock: refresh $path.lock");
245}
246
247###########################################################################
248
249113µs1;
 
# spent 102µs within Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:close which was called 6 times, avg 17µs/call: # 3 times (52µs+0s) by Mail::SpamAssassin::Locker::UnixNFSSafe::safe_lock at line 118, avg 17µs/call # 3 times (49µs+0s) by Mail::SpamAssassin::Locker::UnixNFSSafe::safe_unlock at line 174, avg 16µs/call
sub Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:close; # opcode
# spent 2.39ms within Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:link which was called 6 times, avg 399µs/call: # 6 times (2.39ms+0s) by Mail::SpamAssassin::Locker::UnixNFSSafe::safe_lock at line 90, avg 399µs/call
sub Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:link; # opcode
# spent 331µs within Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:lstat which was called 12 times, avg 28µs/call: # 3 times (94µs+0s) by Mail::SpamAssassin::Locker::UnixNFSSafe::safe_lock at line 105, avg 31µs/call # 3 times (91µs+0s) by Mail::SpamAssassin::Locker::UnixNFSSafe::safe_unlock at line 189, avg 30µs/call # 3 times (78µs+0s) by Mail::SpamAssassin::Locker::UnixNFSSafe::safe_lock at line 124, avg 26µs/call # 3 times (68µs+0s) by Mail::SpamAssassin::Locker::UnixNFSSafe::safe_lock at line 96, avg 23µs/call
sub Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:lstat; # opcode
# spent 585µs within Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:open which was called 3 times, avg 195µs/call: # 3 times (585µs+0s) by Mail::SpamAssassin::Locker::UnixNFSSafe::safe_lock at line 78, avg 195µs/call
sub Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:open; # opcode
# spent 670µs within Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:print which was called 9 times, avg 74µs/call: # 6 times (427µs+0s) by Mail::SpamAssassin::Locker::UnixNFSSafe::safe_lock at line 88, avg 71µs/call # 3 times (243µs+0s) by Mail::SpamAssassin::Locker::UnixNFSSafe::safe_unlock at line 157, avg 81µs/call
sub Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:print; # opcode
# spent 47µs within Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:stat which was called 3 times, avg 16µs/call: # 3 times (47µs+0s) by Mail::SpamAssassin::Locker::UnixNFSSafe::safe_unlock at line 159, avg 16µs/call
sub Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:stat; # opcode
# spent 761µs within Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:sysopen which was called 3 times, avg 254µs/call: # 3 times (761µs+0s) by Mail::SpamAssassin::Locker::UnixNFSSafe::safe_unlock at line 152, avg 254µs/call
sub Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:sysopen; # opcode
# spent 17µs within Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:umask which was called 6 times, avg 3µs/call: # 3 times (10µs+0s) by Mail::SpamAssassin::Locker::UnixNFSSafe::safe_lock at line 77, avg 3µs/call # 3 times (7µs+0s) by Mail::SpamAssassin::Locker::UnixNFSSafe::safe_lock at line 82, avg 2µs/call
sub Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:umask; # opcode
# spent 1.01ms within Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:unlink which was called 8 times, avg 126µs/call: # 3 times (526µs+0s) by Mail::SpamAssassin::Locker::UnixNFSSafe::safe_unlock at line 175, avg 175µs/call # 3 times (197µs+0s) by Mail::SpamAssassin::Locker::UnixNFSSafe::safe_lock at line 119, avg 66µs/call # once (166µs+0s) by Mail::SpamAssassin::Locker::UnixNFSSafe::safe_lock at line 113 # once (118µs+0s) by Mail::SpamAssassin::Locker::UnixNFSSafe::safe_unlock at line 197
sub Mail::SpamAssassin::Locker::UnixNFSSafe::CORE:unlink; # opcode