Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-web-393
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
elphel-web-393
Commits
aabe003b
Commit
aabe003b
authored
Aug 19, 2016
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
restore all
parent
4b52beab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
2 deletions
+38
-2
debugfs.js
src/debugfs-webgui/debugfs.js
+10
-1
debugfs.php
src/debugfs-webgui/debugfs.php
+28
-1
No files found.
src/debugfs-webgui/debugfs.js
View file @
aabe003b
...
@@ -28,7 +28,16 @@ function init(){
...
@@ -28,7 +28,16 @@ function init(){
});
});
});
});
$
(
"body"
).
append
(
$
(
"<div>"
).
css
({
padding
:
"0px 0px 10px 0px"
}).
append
(
b0
).
append
(
b1
));
var
b2
=
$
(
"<button>"
,{
id
:
"b2"
}).
css
({
margin
:
"0px 0px 0px 10px"
}).
html
(
"apply all"
);
b2
.
click
(
function
(){
$
.
ajax
({
url
:
"debugfs.php?cmd=restore"
});
});
$
(
"body"
).
append
(
$
(
"<div>"
).
css
({
padding
:
"0px 0px 10px 0px"
}).
append
(
b0
).
append
(
b1
).
append
(
b2
));
var
t
=
$
(
"<table border=
\"
1
\"
>"
).
html
(
"
\
var
t
=
$
(
"<table border=
\"
1
\"
>"
).
html
(
"
\
<tr>
\
<tr>
\
...
...
src/debugfs-webgui/debugfs.php
View file @
aabe003b
...
@@ -96,6 +96,28 @@ function update_config($data){
...
@@ -96,6 +96,28 @@ function update_config($data){
file_put_contents
(
$tmp_config
,
$data
);
file_put_contents
(
$tmp_config
,
$data
);
}
}
function
apply_config_to_control
(){
global
$tmp_config
;
$arr_config
=
json_decode
(
file_get_contents
(
$tmp_config
),
true
);
foreach
(
$arr_config
as
$k0
=>
$v0
){
foreach
(
$v0
[
'configs'
]
as
$k1
=>
$v1
){
if
(
$v1
[
'state'
]
==
1
){
foreach
(
$v1
[
'lines'
]
as
$k2
=>
$v2
){
$file
=
$v2
[
'file'
];
$lineno
=
$v2
[
'lineno'
];
$flag
=
$v2
[
'flags'
];
if
(
$flag
==
"p"
)
$sign
=
"+"
;
else
$sign
=
"-"
;
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
"
;
}
}
}
}
}
function
sync_to_config
(
$file
,
$line
,
$flag
){
function
sync_to_config
(
$file
,
$line
,
$flag
){
global
$tmp_config
;
global
$tmp_config
;
...
@@ -130,7 +152,7 @@ function sync_to_config($file,$line,$flag){
...
@@ -130,7 +152,7 @@ function sync_to_config($file,$line,$flag){
update_config
(
json_encode
(
$arr_config
));
update_config
(
json_encode
(
$arr_config
));
}
}
if
(
(
$cmd
==
"do_nothing"
)
||
(
$cmd
==
"restore"
)
){
if
(
$cmd
==
"do_nothing"
){
if
(
isset
(
$_GET
[
'file'
]))
$file
=
$_GET
[
'file'
];
if
(
isset
(
$_GET
[
'file'
]))
$file
=
$_GET
[
'file'
];
else
$file
=
"/sys/kernel/debug/dynamic_debug/control"
;
else
$file
=
"/sys/kernel/debug/dynamic_debug/control"
;
...
@@ -190,6 +212,11 @@ if ($cmd=="sync"){
...
@@ -190,6 +212,11 @@ if ($cmd=="sync"){
if
(
$cmd
==
"savetofs"
){
if
(
$cmd
==
"savetofs"
){
copy
(
$tmp_config
,
$config
);
copy
(
$tmp_config
,
$config
);
}
}
if
(
$cmd
==
"restore"
){
apply_config_to_control
();
}
//single line: echo -n 'file gamma_tables.c +p' > /sys/kernel/debug/dynamic_debug/control
//single line: echo -n 'file gamma_tables.c +p' > /sys/kernel/debug/dynamic_debug/control
?>
?>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment