3 # Copyright (C) 2008 Jeffrey Brian Arnold <jbarnold@mit.edu>
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License, version 2.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
19 use Cwd
'abs_path', 'getcwd';
23 use lib
'KSPLICE_DATA_DIR';
26 my ($help, $wantversion, $debug) = (0, 0, 0);
27 GetOptions
("help|?" => \
$help,
28 "version" => \
$wantversion,
29 "verbose|v!" => \
$verbose,
30 "debug=i" => \
$debug) or pod2usage
(1);
36 pod2usage
(1) if($help || scalar(@ARGV != 1));
39 $kid =~ s/^ksplice[_-]//;
42 if(! -d
"/sys/module/ksplice_$kid") {
43 die "/sys/module/ksplice_$kid does not exist";
45 elsif(! -d
"/sys/module/ksplice_$kid/parameters") {
46 runval
("echo $debug > /sys/module/ksplice_$kid/debug");
49 runval
("echo $debug > /sys/module/ksplice_$kid/parameters/debug");
54 runval
("echo 1 > /proc/ksplice_$kid");
55 if(runval_raw
("rmmod ksplice_$kid") != 0) {
56 my $dmesg = runstr
("dmesg | grep ksplice");
57 while($dmesg =~ /ksplice: Preparing to reverse/) {
61 if($dmesg =~ /to-be-reversed code is busy/) {
64 Ksplice has aborted the undo operation because it appears that the code that
65 you are trying to change is continuously in use by the system. More
66 specifically, Ksplice has been unable to find a moment when one or more of the
67 to-be-changed functions is not on a thread's kernel stack
.
79 ksplice-undo - Undo a Ksplice update that has been applied to the running kernel
83 B<ksplice-undo> I<KSPLICE_ID>
87 B<ksplice-undo> takes as input a Ksplice identification tag, as reported by
88 L<ksplice-view(8)>, and it reverses that update within the running binary kernel.
96 Reverses the update with debugging output enabled. Recommended only for
97 debugging. I<DEBUG_LEVEL> should be an integer between 0 and 2. B<--debug=2>
98 provides the most debugging information.
108 Provides basic kernel stack check debugging output.
112 Provides full kernel stack check debugging output.
120 L<ksplice-create(8)>, L<ksplice-apply(8)>, L<ksplice-view(8)>
124 Copyright (C) 2008 Jeffrey Brian Arnold <jbarnold@mit.edu>.
126 This is free software and documentation. You can redistribute and/or modify it
127 under the terms of the GNU General Public License, version 2.