Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tools
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test-restored
platform
vendor
qcom-opensource
tools
Commits
55a16536
Commit
55a16536
authored
6 years ago
by
Linux Build Service Account
Committed by
Gerrit - the friendly Code Review server
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge "lrdp_v2: Add timeout for QTF parsing"
parents
21f42777
49e9e5f7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
linux-ramdump-parser-v2/debug_image_v2.py
+29
-12
29 additions, 12 deletions
linux-ramdump-parser-v2/debug_image_v2.py
with
29 additions
and
12 deletions
linux-ramdump-parser-v2/debug_image_v2.py
+
29
−
12
View file @
55a16536
...
@@ -400,6 +400,16 @@ class DebugImage_v2():
...
@@ -400,6 +400,16 @@ class DebugImage_v2():
self
.
formats_out
.
close
self
.
formats_out
.
close
def
wait_for_completion_timeout
(
self
,
task
,
timeout
):
delay
=
2.0
#while the process is still executing and we haven't timed-out yet
while
task
.
poll
()
is
None
and
timeout
>
0
:
time
.
sleep
(
delay
)
timeout
-=
delay
if
timeout
<=
0
:
print_out_str
(
"
QTF command timed out
"
)
task
.
kill
()
def
parse_qtf
(
self
,
ram_dump
):
def
parse_qtf
(
self
,
ram_dump
):
out_dir
=
ram_dump
.
outdir
out_dir
=
ram_dump
.
outdir
if
platform
.
system
()
!=
'
Windows
'
:
if
platform
.
system
()
!=
'
Windows
'
:
...
@@ -448,7 +458,8 @@ class DebugImage_v2():
...
@@ -448,7 +458,8 @@ class DebugImage_v2():
workspace
=
os
.
path
.
join
(
qtf_dir
,
'
qtf.workspace
'
)
workspace
=
os
.
path
.
join
(
qtf_dir
,
'
qtf.workspace
'
)
qtf_out
=
os
.
path
.
join
(
out_dir
,
'
qtf.txt
'
)
qtf_out
=
os
.
path
.
join
(
out_dir
,
'
qtf.txt
'
)
chipset
=
ram_dump
.
hw_id
chipset
=
ram_dump
.
hw_id
if
"
sdm
"
not
in
ram_dump
.
hw_id
.
lower
():
if
"
sdm
"
not
in
ram_dump
.
hw_id
.
lower
()
and
\
"
qcs
"
not
in
ram_dump
.
hw_id
.
lower
():
chipset
=
"
msm
"
+
ram_dump
.
hw_id
chipset
=
"
msm
"
+
ram_dump
.
hw_id
hlos
=
'
LA
'
hlos
=
'
LA
'
...
@@ -460,8 +471,8 @@ class DebugImage_v2():
...
@@ -460,8 +471,8 @@ class DebugImage_v2():
for
tries
in
range
(
max_tries
):
for
tries
in
range
(
max_tries
):
port
=
random
.
randint
(
12000
,
13000
)
port
=
random
.
randint
(
12000
,
13000
)
server_proc
=
subprocess
.
Popen
(
server_proc
=
subprocess
.
Popen
(
[
qtf_path
,
'
-s
'
,
'
{
0
}
'
.
format
(
port
)],
stderr
=
subprocess
.
PIPE
)
[
qtf_path
,
'
-s
'
,
'
{
:d
}
'
.
format
(
port
)],
shell
=
True
,
stderr
=
subprocess
.
PIPE
)
time
.
sleep
(
1
)
time
.
sleep
(
1
5
)
server_proc
.
poll
()
server_proc
.
poll
()
if
server_proc
.
returncode
==
1
:
if
server_proc
.
returncode
==
1
:
server_proc
.
terminate
()
server_proc
.
terminate
()
...
@@ -477,17 +488,23 @@ class DebugImage_v2():
...
@@ -477,17 +488,23 @@ class DebugImage_v2():
print_out_str
(
'
!!! Please kill all currently running qtf_server
'
print_out_str
(
'
!!! Please kill all currently running qtf_server
'
'
processes and try again
'
)
'
processes and try again
'
)
return
return
#subprocess.call('{0} -c {1} new workspace {2} {3} {4}'.format(qtf_path, port, qtf_dir, chipset, hlos))
subprocess
.
call
(
'
{0} -c {1} new workspace {2} {3} {4}
'
.
format
(
qtf_path
,
port
,
qtf_dir
,
chipset
,
hlos
))
server_proc1
=
subprocess
.
Popen
(
[
qtf_path
,
'
-c
'
,
'
{:d}
'
.
format
(
port
),
'
new workspace {0} {1} {2}
'
.
format
(
qtf_dir
,
chipset
,
hlos
)],
shell
=
True
,
stderr
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
)
server_proc1
.
communicate
()
self
.
collect_ftrace_format
(
ram_dump
)
self
.
collect_ftrace_format
(
ram_dump
)
subprocess
.
call
(
'
{0} -c {1} open workspace {2}
'
.
format
(
qtf_path
,
port
,
workspace
))
p
=
subprocess
.
Popen
(
'
{0} -c {1} open workspace {2}
'
.
format
(
qtf_path
,
port
,
workspace
))
subprocess
.
call
(
'
{0} -c {1} open bin {2}
'
.
format
(
qtf_path
,
port
,
trace_file
))
self
.
wait_for_completion_timeout
(
p
,
60
)
subprocess
.
call
(
'
{0} -c {1} stream trace table {2}
'
.
format
(
qtf_path
,
port
,
qtf_out
))
p
=
subprocess
.
Popen
(
'
{0} -c {1} open bin {2}
'
.
format
(
qtf_path
,
port
,
trace_file
))
subprocess
.
call
(
'
{0} -c {1} close
'
.
format
(
qtf_path
,
port
))
self
.
wait_for_completion_timeout
(
p
,
90
)
subprocess
.
call
(
'
{0} -c {1} exit
'
.
format
(
qtf_path
,
port
))
p
=
subprocess
.
Popen
(
'
{0} -c {1} stream trace table {2}
'
.
format
(
qtf_path
,
port
,
qtf_out
))
server_proc
.
communicate
(
'
quit
'
)
self
.
wait_for_completion_timeout
(
p
,
300
)
p
=
subprocess
.
Popen
(
'
{0} -c {1} close
'
.
format
(
qtf_path
,
port
))
self
.
wait_for_completion_timeout
(
p
,
60
)
p
=
subprocess
.
Popen
(
'
{0} -c {1} exit
'
.
format
(
qtf_path
,
port
))
self
.
wait_for_completion_timeout
(
p
,
60
)
server_proc
.
terminate
()
def
parse_dcc
(
self
,
ram_dump
):
def
parse_dcc
(
self
,
ram_dump
):
out_dir
=
ram_dump
.
outdir
out_dir
=
ram_dump
.
outdir
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment