[Bio] / FigKernelPackages / Tracer.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/Tracer.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.116, Thu Feb 5 06:40:13 2009 UTC revision 1.117, Thu Apr 2 01:13:32 2009 UTC
# Line 21  Line 21 
21      use strict;      use strict;
22      use base qw(Exporter);      use base qw(Exporter);
23      use vars qw(@EXPORT @EXPORT_OK);      use vars qw(@EXPORT @EXPORT_OK);
24      @EXPORT = qw(Trace T TSetup QTrace Confess Cluck Min Max Assert Open OpenDir TICK StandardSetup EmergencyKey ETracing Constrain Insure ChDir Emergency Warn TraceDump IDHASH);      @EXPORT = qw(Trace T TSetup QTrace Confess MemTrace Cluck Min Max Assert Open OpenDir TICK StandardSetup EmergencyKey ETracing Constrain Insure ChDir Emergency Warn TraceDump IDHASH);
25      @EXPORT_OK = qw(GetFile GetOptions Merge MergeOptions ParseCommand ParseRecord UnEscape Escape PrintLine PutLine);      @EXPORT_OK = qw(GetFile GetOptions Merge MergeOptions ParseCommand ParseRecord UnEscape Escape PrintLine PutLine);
26      use Carp qw(longmess croak carp);      use Carp qw(longmess croak carp);
27      use CGI;      use CGI;
# Line 512  Line 512 
512      }      }
513  }  }
514    
515    =head3 MemTrace
516    
517        MemTrace($message);
518    
519    Output a trace message that includes memory size information.
520    
521    =over 4
522    
523    =item message
524    
525    Message to display. The message will be followed by a sentence about the memory size.
526    
527    =back
528    
529    =cut
530    
531    sub MemTrace {
532        # Get the parameters.
533        my ($message) = @_;
534        my $memory = GetMemorySize();
535        Trace("$message $memory in use.");
536    }
537    
538    
539  =head3 TraceDump  =head3 TraceDump
540    
541      TraceDump($title, $object);      TraceDump($title, $object);
# Line 2523  Line 2547 
2547          } else {          } else {
2548              @retVal = readdir $dirHandle;              @retVal = readdir $dirHandle;
2549          }          }
2550            closedir $dirHandle;
2551      } elsif (! $flag) {      } elsif (! $flag) {
2552          # Here the directory would not open and it's considered an error.          # Here the directory would not open and it's considered an error.
2553          Confess("Could not open directory $dirName.");          Confess("Could not open directory $dirName.");
# Line 3525  Line 3550 
3550  }  }
3551    
3552    
3553    =head3 GetMemorySize
3554    
3555        my $string = Tracer::GetMemorySize();
3556    
3557    Return a memory size string for the current process. The string will be
3558    in comma format, with a size indicator (K, M, G) at the end.
3559    
3560    =cut
3561    
3562    sub GetMemorySize {
3563        # Get the memory size from Unix.
3564        my ($retVal) = `ps h -o vsz $$`;
3565        # Remove the ending new-line.
3566        chomp $retVal;
3567        # Format and return the result.
3568        return CommaFormat($retVal) . "K";
3569    }
3570    
3571  =head3 CompareLists  =head3 CompareLists
3572    
3573      my ($inserted, $deleted) = Tracer::CompareLists(\@newList, \@oldList, $keyIndex);      my ($inserted, $deleted) = Tracer::CompareLists(\@newList, \@oldList, $keyIndex);

Legend:
Removed from v.1.116  
changed lines
  Added in v.1.117

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3