5 tails-persistence-setup - setup Tails persistent storage
16 our $VERSION = '2.0.1';
19 use lib
"$FindBin::Bin/../lib";
22 sub record_memory_usage
{ 1 }
23 sub report_memory_usage
{ 1 }
28 if (exists $ENV{REPORT_MEMORY_USAGE
}
29 && defined $ENV{REPORT_MEMORY_USAGE
}
30 && $ENV{REPORT_MEMORY_USAGE
}) {
31 require Memory
::Usage
;
32 $mu = Memory
::Usage
->new();
33 no warnings
'redefine';
34 *record_memory_usage
= sub { $mu->record(shift) };
35 *report_memory_usage
= sub { $mu->dump() };
36 push @options, ('memory_usage' => $mu);
37 say STDERR
"Enabled memory usage reporting";
41 $SIG{'INT'} = $SIG{'TERM'} = sub { report_memory_usage
(); exit(0); };
42 $SIG{'USR1'} = sub { report_memory_usage
(); };
44 record_memory_usage
('before loading Tails::Persistence::Setup');
45 use Tails
::Persistence
::Setup
;
46 record_memory_usage
('after loading Tails::Persistence::Setup');
48 Tails
::Persistence
::Setup
->new_with_options()->run;
49 record_memory_usage
('after Tails::Persistence::Setup->run is done');
51 report_memory_usage
();