Commit 81d29baf authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

restore only selected files

parent 3a8afd3f
...@@ -20,7 +20,7 @@ function init(){ ...@@ -20,7 +20,7 @@ function init(){
} }
}); });
var b1 = $("<button>",{id:"b1"}).css({margin:"0px 0px 0px 10px"}).html("save to fs"); var b1 = $("<button>",{id:"b1"}).css({margin:"0px 0px 0px 10px"}).html("save to persistent storage");
b1.click(function(){ b1.click(function(){
$.ajax({ $.ajax({
...@@ -28,7 +28,7 @@ function init(){ ...@@ -28,7 +28,7 @@ function init(){
}); });
}); });
var b2 = $("<button>",{id:"b2"}).css({margin:"0px 0px 0px 10px"}).html("apply all"); var b2 = $("<button>",{id:"b2"}).css({margin:"0px 0px 0px 10px"}).html("restore configs for selected files");
b2.click(function(){ b2.click(function(){
$.ajax({ $.ajax({
......
...@@ -99,23 +99,24 @@ function update_config($data){ ...@@ -99,23 +99,24 @@ function update_config($data){
function apply_config_to_control(){ function apply_config_to_control(){
global $tmp_config; global $tmp_config;
$arr_config = json_decode(file_get_contents($tmp_config),true); $arr_config = json_decode(file_get_contents($tmp_config),true);
foreach($arr_config as $k0 => $v0){ foreach($arr_config as $k0 => $v0){
foreach($v0['configs'] as $k1 => $v1){ if ($v0['state']==1){
if ($v1['state']==1){ foreach($v0['configs'] as $k1 => $v1){
foreach($v1['lines'] as $k2 => $v2){ if ($v1['state']==1){
$file = $v2['file']; foreach($v1['lines'] as $k2 => $v2){
$lineno = $v2['lineno']; $file = $v2['file'];
$flag = $v2['flags']; $lineno = $v2['lineno'];
if ($flag=="p") $sign = "+"; $flag = $v2['flags'];
else $sign = "-"; if ($flag=="p") $sign = "+";
exec("echo -n 'file $file line $lineno ${sign}p' > /sys/kernel/debug/dynamic_debug/control"); else $sign = "-";
//echo "echo -n 'file $file line $lineno ${sign}p'\n"; exec("echo -n 'file $file line $lineno ${sign}p' > /sys/kernel/debug/dynamic_debug/control");
//echo "echo -n 'file $file line $lineno ${sign}p'\n";
}
} }
} }
} }
} }
echo "Done";
} }
function sync_to_config($file,$line,$flag){ function sync_to_config($file,$line,$flag){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment