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
2fd09253
Commit
2fd09253
authored
Aug 18, 2016
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. tmp version in /tmp 2. savetofs button
parent
8a7451f6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
12 deletions
+33
-12
debugfs.js
src/debugfs-webgui/debugfs.js
+9
-1
debugfs.php
src/debugfs-webgui/debugfs.php
+24
-11
No files found.
src/debugfs-webgui/debugfs.js
View file @
2fd09253
...
...
@@ -19,7 +19,15 @@ function init(){
}
});
$
(
"body"
).
append
(
$
(
"<div>"
).
css
({
padding
:
"0px 0px 10px 0px"
}).
append
(
b0
));
var
b1
=
$
(
"<button>"
,{
id
:
"b1"
}).
css
({
margin
:
"0px 0px 0px 10px"
}).
html
(
"save to fs"
);
b1
.
click
(
function
(){
$
.
ajax
({
url
:
"debugfs.php?cmd=savetofs"
});
});
$
(
"body"
).
append
(
$
(
"<div>"
).
css
({
padding
:
"0px 0px 10px 0px"
}).
append
(
b0
).
append
(
b1
));
var
t
=
$
(
"<table border=
\"
1
\"
>"
).
html
(
"
\
<tr>
\
...
...
src/debugfs-webgui/debugfs.php
View file @
2fd09253
<?php
//globals
$config
=
"debugfs.json"
;
$tmp_config
=
"/tmp/
$config
"
;
if
(
isset
(
$_GET
[
'cmd'
]))
$cmd
=
$_GET
[
'cmd'
];
...
...
@@ -27,7 +30,6 @@ function control_records_sort($a,$b){
}
return
(
$afile
<
$bfile
)
?-
1
:
1
;
}
function
get_control
(
$f
){
...
...
@@ -89,13 +91,16 @@ function get_control($f){
}
function
update_config
(
$data
){
global
$tmp_config
;
// debugfs.json
file_put_contents
(
"debugfs.json"
,
$data
);
file_put_contents
(
$tmp_config
,
$data
);
}
function
sync_to_config
(
$file
,
$line
,
$flag
){
global
$tmp_config
;
//$arr_debugfs = get_control("/sys/kernel/debug/dynamic_debug/control");
$arr_config
=
json_decode
(
file_get_contents
(
"debugfs.json"
),
true
);
$arr_config
=
json_decode
(
file_get_contents
(
$tmp_config
),
true
);
foreach
(
$arr_config
as
$k
=>
$v
){
if
(
$v
[
'file'
]
==
$file
)
$dc
=
$k
;
...
...
@@ -132,16 +137,22 @@ if (($cmd=="do_nothing")||($cmd=="restore")){
//echo json_encode(get_control($file));
//echo "<pre>";
if
(
!
is_file
(
"debugfs.json"
))
{
if
(
!
is_file
(
$tmp_config
))
{
if
(
is_file
(
$config
))
{
copy
(
$config
,
$tmp_config
);
$json_data
=
file_get_contents
(
$tmp_config
);
echo
$json_data
;
}
else
{
$arr
=
get_control
(
$file
);
//print_r($arr);
update_config
(
json_encode
(
$arr
));
echo
json_encode
(
$arr
);
}
//echo "debugfs.json was missing, refresh page\n";
}
else
{
$json_data
=
file_get_contents
(
"debugfs.json"
);
//print_r(json_decode($json_data));
$json_data
=
file_get_contents
(
$tmp_config
);
echo
$json_data
;
//print_r(json_decode($json_data));
}
}
...
...
@@ -176,7 +187,9 @@ if ($cmd=="sync"){
update_config
(
$data
);
}
if
(
$cmd
==
"savetofs"
){
copy
(
$tmp_config
,
$config
);
}
//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