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
a9e7f648
Commit
a9e7f648
authored
6 years ago
by
qctecmdr Service
Committed by
Gerrit - the friendly Code Review server
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge "lrdp-v2: dump Dsleep and Running task to hightlight_task.txt"
parents
246e5ea8
c59c224b
No related branches found
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/parsers/taskdump.py
+32
-4
32 additions, 4 deletions
linux-ramdump-parser-v2/parsers/taskdump.py
with
32 additions
and
4 deletions
linux-ramdump-parser-v2/parsers/taskdump.py
100644 → 100755
+
32
−
4
View file @
a9e7f648
...
...
@@ -12,7 +12,8 @@
import
string
from
print_out
import
print_out_str
from
parser_util
import
register_parser
,
RamParser
,
cleanupString
taskhighlight_out
=
None
highlight_tasks
=
"
\n
=====List of all runing and uninterruptable sleep process====
\n
"
def
find_panic
(
ramdump
,
addr_stack
,
thread_task_name
):
if
ramdump
.
arm64
:
...
...
@@ -49,8 +50,9 @@ def find_panic(ramdump, addr_stack, thread_task_name):
return
True
return
False
def
dump_thread_group
(
ramdump
,
thread_group
,
task_out
,
check_for_panic
=
0
):
task_state_name
=
[
"
Runing
"
,
"
ISleep
"
,
"
DSleep
"
]
def
dump_thread_group
(
ramdump
,
thread_group
,
task_out
,
taskhighlight_out
,
check_for_panic
=
0
):
global
highlight_tasks
offset_thread_group
=
ramdump
.
field_offset
(
'
struct task_struct
'
,
'
thread_group
'
)
offset_comm
=
ramdump
.
field_offset
(
'
struct task_struct
'
,
'
comm
'
)
...
...
@@ -85,6 +87,10 @@ def dump_thread_group(ramdump, thread_group, task_out, check_for_panic=0):
task_state
=
ramdump
.
read_word
(
next_thread_state
)
if
task_state
is
None
:
return
if
task_state
<
3
:
task_state_str
=
task_state_name
[
task_state
]
else
:
task_state_str
=
task_state
task_exit_state
=
ramdump
.
read_int
(
next_thread_exit_state
)
if
task_exit_state
is
None
:
return
...
...
@@ -96,6 +102,24 @@ def dump_thread_group(ramdump, thread_group, task_out, check_for_panic=0):
return
if
not
check_for_panic
:
task_cpu
=
ramdump
.
get_task_cpu
(
next_thread_start
,
threadinfo
)
#thread_line = thread_task_pid + task_cpu + task_state_str+ next_thread_start+thread_task_name
thread_line
=
"
PID %6d cpu %1d state %16s start 0x%x comm %32s
\n
"
%
(
thread_task_pid
,
task_cpu
,
task_state_str
,
next_thread_start
,
thread_task_name
)
if
task_state
!=
1
:
if
not
first
:
highlight_tasks
+=
"
*
"
+
thread_line
taskhighlight_out
.
write
(
"
**
"
+
thread_line
)
else
:
highlight_tasks
+=
"
"
+
thread_line
taskhighlight_out
.
write
(
"
"
+
thread_line
)
ramdump
.
unwind
.
unwind_backtrace
(
ramdump
.
thread_saved_sp
(
next_thread_start
),
ramdump
.
thread_saved_fp
(
next_thread_start
),
ramdump
.
thread_saved_pc
(
next_thread_start
),
0
,
'
'
,
taskhighlight_out
)
thread_line
=
'
+
'
+
thread_line
else
:
thread_line
=
'
'
+
thread_line
if
not
first
:
task_out
.
write
(
'
Process: {0}, cpu: {1} pid: {2} start: 0x{3:x}
\n
'
.
format
(
thread_task_name
,
task_cpu
,
thread_task_pid
,
next_thread_start
))
...
...
@@ -146,11 +170,13 @@ def do_dump_stacks(ramdump, check_for_panic=0):
seen_tasks
=
[]
if
check_for_panic
==
0
:
task_out
=
ramdump
.
open_file
(
'
tasks.txt
'
)
taskhighlight_out
=
ramdump
.
open_file
(
'
tasks_highlight.txt
'
)
else
:
task_out
=
None
taskhighlight_out
=
None
while
True
:
dump_thread_group
(
ramdump
,
init_thread_group
,
task_out
,
check_for_panic
)
task_out
,
taskhighlight_out
,
check_for_panic
)
next_task
=
ramdump
.
read_word
(
init_next_task
)
if
next_task
is
None
:
init_next_task
=
init_addr
+
offset_tasks
...
...
@@ -203,6 +229,8 @@ def do_dump_stacks(ramdump, check_for_panic=0):
break
if
check_for_panic
==
0
:
task_out
.
close
()
taskhighlight_out
.
write
(
highlight_tasks
+
"
\n
"
)
taskhighlight_out
.
close
()
print_out_str
(
'
---wrote tasks to tasks.txt
'
)
def
do_dump_task_timestamps
(
ramdump
):
...
...
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