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
cfe49b99
Commit
cfe49b99
authored
Aug 20, 2016
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
queue requests
parent
454f21c1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
118 additions
and
19 deletions
+118
-19
debugfs.html
src/debugfs-webgui/debugfs.html
+1
-0
debugfs.js
src/debugfs-webgui/debugfs.js
+3
-3
debugfs.php
src/debugfs-webgui/debugfs.php
+22
-16
jquery.ajax.queue.js
src/debugfs-webgui/jquery.ajax.queue.js
+92
-0
No files found.
src/debugfs-webgui/debugfs.html
View file @
cfe49b99
<html>
<head>
<script
src=
"js/jquery-2.2.3.min.js"
></script>
<script
src=
"jquery.ajax.queue.js"
></script>
<script
src=
"debugfs.js"
></script>
<script
src=
"js/bootstrap/js/bootstrap.min.js"
></script>
<link
rel=
"stylesheet"
href=
"js/bootstrap/css/bootstrap.min.css"
/>
...
...
src/debugfs-webgui/debugfs.js
View file @
cfe49b99
...
...
@@ -160,7 +160,7 @@ function fill_content(record,index,target){
l
=
"<tr class='"
+
oddeven
+
"'>"
;
l
+=
" <td style='text-align:center' title='"
+
ttl
+
"'>"
+
record
[
j
].
lineno
+
"</td>"
;
l
+=
" <td style='text-align:center'><input title='p
-
flag' type='checkbox' class='tp debug' "
+
checked
+
" file='"
+
record
[
j
].
file
+
"' line='"
+
record
[
j
].
lineno
+
"' index='"
+
index
+
"' subindex='"
+
j
+
"' /></td>"
;
l
+=
" <td style='text-align:center'><input title='pflag' type='checkbox' class='tp debug' "
+
checked
+
" file='"
+
record
[
j
].
file
+
"' line='"
+
record
[
j
].
lineno
+
"' index='"
+
index
+
"' subindex='"
+
j
+
"' /></td>"
;
l
+=
" <td title=
\"
function: "
+
record
[
j
].
function
+
"
\"
>"
+
record
[
j
].
function
.
substr
(
0
,
20
)
+
cut_function
+
"</td>"
;
l
+=
" <td title=
\"
format: "
+
record
[
j
].
format
+
"
\"
>"
+
record
[
j
].
format
.
substr
(
0
,
20
)
+
cut_format
+
"</td>"
;
l
+=
"</tr>"
;
...
...
@@ -180,7 +180,8 @@ function fill_content_rebind_events(){
debugfs_data
[
index
].
configs
[
0
].
lines
[
subindex
].
flags
=
flags
;
//console.log($(this).attr("file")+", "+$(this).attr("line")+", "+$(this).prop("checked"));
$
.
ajax
({
url
:
"debugfs.php?cmd=echo&file="
+
$
(
this
).
attr
(
"file"
)
+
"&line="
+
$
(
this
).
attr
(
"line"
)
+
"&pflag="
+
$
(
this
).
prop
(
"checked"
)
url
:
"debugfs.php?cmd=echo&file="
+
$
(
this
).
attr
(
"file"
)
+
"&line="
+
$
(
this
).
attr
(
"line"
)
+
"&flags="
+
flags
,
queue
:
true
});
});
...
...
@@ -189,7 +190,6 @@ function fill_content_rebind_events(){
var
index
=
$
(
this
).
attr
(
"index"
);
var
checked
=
$
(
this
).
prop
(
"checked"
);
$
(
"#content_"
+
index
).
find
(
".debug"
).
prop
(
"checked"
,
checked
).
change
();
});
}
...
...
src/debugfs-webgui/debugfs.php
View file @
cfe49b99
...
...
@@ -121,14 +121,17 @@ function apply_config_to_control(){
echo
"Done"
;
}
function
sync_
to_config
(
$file
,
$line
,
$flag
){
function
sync_
from_debugfs_to_config
(
$file
,
$line
,
$flags
,
$sign
){
global
$tmp_config
;
//$arr_debugfs = get_control("/sys/kernel/debug/dynamic_debug/control");
$arr_config
=
json_decode
(
file_get_contents
(
$tmp_config
),
true
);
foreach
(
$arr_config
as
$k
=>
$v
){
if
(
$v
[
'file'
]
==
$file
)
$dc
=
$k
;
if
(
$v
[
'file'
]
==
$file
)
{
$dc
=
$k
;
break
;
}
}
echo
"DC=
$dc
\n
"
;
...
...
@@ -136,23 +139,28 @@ function sync_to_config($file,$line,$flag){
$tmp_arr1
=
$arr_config
[
$dc
][
'configs'
];
foreach
(
$tmp_arr1
as
$k
=>
$v
){
if
(
$v
[
'state'
]
==
1
)
$dcc
=
$k
;
if
(
$v
[
'state'
]
==
1
)
{
$dcc
=
$k
;
break
;
}
}
$tmp_arr2
=
$arr_config
[
$dc
][
'configs'
][
$dcc
][
'lines'
];
foreach
(
$tmp_arr2
as
$k
=>
$v
){
if
(
$v
[
'lineno'
]
==
$line
)
$dccc
=
$k
;
if
(
$v
[
'lineno'
]
==
$line
)
{
$dccc
=
$k
;
break
;
}
}
if
(
$
flag
==
"+"
)
$flag
=
"p"
;
if
(
$
sign
==
"+"
)
$flag
=
"p"
;
else
$flag
=
"_"
;
$arr_config
[
$dc
][
'configs'
][
$dcc
][
'lines'
][
$dccc
][
'flags'
]
=
$flag
;
print_r
(
$arr_config
);
update_config
(
json_encode
(
$arr_config
));
//print_r($arr_config);
}
function
filter_record_by_file
(
$a
,
$f
){
...
...
@@ -195,18 +203,16 @@ if ($cmd=="do_nothing"){
if
(
$cmd
==
"echo"
)
{
$file
=
$_GET
[
'file'
];
$line
=
$_GET
[
'line'
];
$flag
=
$_GET
[
'pflag
'
];
$flag
s
=
$_GET
[
'flags
'
];
//$config name
if
(
$flag
==
"true"
){
$
flag
=
"+
"
;
if
(
strpos
(
$flags
,
"p"
)
===
FALSE
){
$
sign
=
"-p
"
;
}
else
{
$
flag
=
"-
"
;
$
sign
=
"+
"
;
}
exec
(
"echo -n 'file
$file
line
$line
${flag}p' >
$DEBUGFSFILE
"
);
sync_to_config
(
$file
,
$line
,
$flag
);
exec
(
"echo -n 'file
$file
line
$line
${sign}${flags}' >
$DEBUGFSFILE
"
);
sync_from_debugfs_to_config
(
$file
,
$line
,
$flags
,
$sign
);
}
$debugfs_configs
=
"debugfs_configs"
;
...
...
src/debugfs-webgui/jquery.ajax.queue.js
0 → 100644
View file @
cfe49b99
// credits: https://blog.alexmaccaw.com/queuing-ajax-requests
// Generated by CoffeeScript 1.6.2
(
function
()
{
var
$
,
next
,
push
,
queue
,
queues
,
remove
,
running
;
$
=
jQuery
;
queues
=
{};
running
=
false
;
queue
=
function
(
name
)
{
if
(
name
===
true
)
{
name
=
'default'
;
}
return
queues
[
name
]
||
(
queues
[
name
]
=
[]);
};
next
=
function
(
name
)
{
var
deferred
,
list
,
options
,
_ref
;
list
=
queue
(
name
);
if
(
!
list
.
length
)
{
running
=
false
;
return
;
}
_ref
=
list
.
shift
(),
options
=
_ref
[
0
],
deferred
=
_ref
[
1
];
return
$
.
ajax
(
options
).
always
(
function
()
{
return
next
(
name
);
}).
done
(
function
()
{
return
deferred
.
resolve
.
apply
(
deferred
,
arguments
);
}).
fail
(
function
()
{
return
deferred
.
reject
.
apply
(
deferred
,
arguments
);
});
};
push
=
function
(
name
,
options
)
{
var
deferred
,
list
;
list
=
queue
(
name
);
deferred
=
$
.
Deferred
();
list
.
push
([
options
,
deferred
]);
if
(
!
running
)
{
next
(
name
);
}
running
=
true
;
return
deferred
.
promise
();
};
remove
=
function
(
name
,
options
)
{
var
i
,
list
,
value
,
_
,
_i
,
_len
,
_ref
,
_results
;
list
=
queue
(
name
);
_results
=
[];
for
(
i
=
_i
=
0
,
_len
=
list
.
length
;
_i
<
_len
;
i
=
++
_i
)
{
_ref
=
list
[
i
],
value
=
_ref
[
0
],
_
=
_ref
[
1
];
if
(
!
(
value
===
options
))
{
continue
;
}
list
.
splice
(
i
,
1
);
break
;
}
return
_results
;
};
$
.
ajaxTransport
(
'+*'
,
function
(
options
)
{
var
queuedOptions
;
if
(
options
.
queue
)
{
queuedOptions
=
$
.
extend
({},
options
);
queuedOptions
.
queue
=
false
;
queuedOptions
.
processData
=
false
;
return
{
send
:
function
(
headers
,
complete
)
{
return
push
(
options
.
queue
,
queuedOptions
).
done
(
function
(
data
,
textStatus
,
jqXHR
)
{
return
complete
(
jqXHR
.
status
,
jqXHR
.
statusText
,
{
text
:
jqXHR
.
responseText
},
jqXHR
.
getAllResponseHeaders
());
}).
fail
(
function
(
jqXHR
,
textStatus
,
errorThrown
)
{
return
complete
(
jqXHR
.
status
,
jqXHR
.
statusText
,
{
text
:
jqXHR
.
responseText
},
jqXHR
.
getAllResponseHeaders
());
});
},
abort
:
function
()
{
return
remove
(
options
.
queue
,
queuedOptions
);
}
};
}
});
}).
call
(
this
);
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