143 |
'debug', qq|<a href=/our/debug/| . boolean::toggle($debug) . qq|>$debug</a>|, |
'debug', qq|<a href=/our/debug/| . boolean::toggle($debug) . qq|>$debug</a>|, |
144 |
); |
); |
145 |
|
|
146 |
|
my $debug_proc; |
147 |
|
|
148 |
warn 'pids: ', dump( $pids ); |
warn 'pids: ', dump( $pids ); |
149 |
foreach my $name ( keys %$pids ) { |
foreach my $name ( keys %$pids ) { |
150 |
my $pid = $pids->{$name} || next; |
my $pid = $pids->{$name} || next; |
|
my $proc = "/proc/$pid/status"; |
|
151 |
|
|
152 |
my $html = qq|<a href=/$name>$pid</a>|; |
my $html = qq|<a href=/$name>$pid</a>|; |
153 |
$html .= qq|<pre style="font-size: 10%">| |
|
154 |
. ( $debug && -e $proc ? read_file($proc) : '' ) |
if ( $debug ) { |
155 |
. qq|</pre>| if $debug; |
$html .= qq| <a name=$pid href=#proc-$pid>?</a>|; |
156 |
|
|
157 |
|
my $proc = "/proc/$pid/status"; |
158 |
|
$debug_proc |
159 |
|
.= qq|<a name=proc-$pid href=#$pid>$proc</a><pre style="font-size: 10%">| |
160 |
|
. read_file($proc) |
161 |
|
. qq|</pre>| |
162 |
|
if -e $proc; |
163 |
|
} |
164 |
|
|
165 |
push @rows, ( $name => $html ); |
push @rows, ( $name => $html ); |
166 |
} |
} |
175 |
} |
} |
176 |
} |
} |
177 |
|
|
178 |
print $client $ok, html::table( 2, @rows ); |
print $client $ok, html::table( 2, @rows ), $debug_proc; |
179 |
|
|
180 |
} elsif ( $path =~ m{^/our/(\w+)/(\S+)} ) { |
} elsif ( $path =~ m{^/our/(\w+)/(\S+)} ) { |
181 |
eval 'our $' . $1 . ' = ' . $2; |
eval 'our $' . $1 . ' = ' . $2; |