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
ff093217
Commit
ff093217
authored
10 years ago
by
Linux Build Service Account
Committed by
Gerrit - the friendly Code Review server
10 years ago
Browse files
Options
Downloads
Plain Diff
Merge "linux-ramdump-parser-v2: add support for thermal-info"
parents
29695aa2
4261bf2b
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/thermal_data.py
+84
-0
84 additions, 0 deletions
linux-ramdump-parser-v2/parsers/thermal_data.py
with
84 additions
and
0 deletions
linux-ramdump-parser-v2/parsers/thermal_data.py
0 → 100755
+
84
−
0
View file @
ff093217
# Copyright (c) 2015, The Linux Foundation. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 and
# only version 2 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
from
print_out
import
print_out_str
from
parser_util
import
register_parser
,
RamParser
@register_parser
(
'
--thermal-info
'
,
'
Useful information from thermal data structures
'
)
class
Thermal_info
(
RamParser
):
def
print_thermal_info
(
self
,
sensor_dbg_info_start_address
,
ram_dump
,
time_stamp
,
sensor_mapping
):
for
ncpu
in
ram_dump
.
iter_cpus
():
self
.
output_file
.
write
(
"
------------------------------------------------
\n
"
)
self
.
output_file
.
write
(
"
TEMPERATURE ENTRIES FOR CPU:{0}
\n
"
.
format
(
int
(
ncpu
)))
self
.
output_file
.
write
(
"
------------------------------------------------
\n
"
)
cpu_sensor_addr
=
sensor_dbg_info_start_address
+
\
sensor_mapping
[
ncpu
]
for
i
in
range
(
0
,
10
):
temp
=
self
.
ramdump
.
read_word
(
cpu_sensor_addr
+
(
i
*
8
),
True
)
time
=
self
.
ramdump
.
read_word
(
cpu_sensor_addr
+
time_stamp
+
(
i
*
8
),
True
)
self
.
output_file
.
write
(
"
Temperature reading - {0}
"
.
format
(
int
(
temp
)))
self
.
output_file
.
write
(
"
TimeStamp - {0}
\n
"
.
format
(
long
(
time
)))
def
tmdev_data
(
self
,
ram_dump
):
sensor_mapping
=
[]
self
.
output_file
.
write
(
"
Thermal sensor data
\n
"
)
tmdev
=
self
.
ramdump
.
addr_lookup
(
'
tmdev
'
)
tmdev_address
=
self
.
ramdump
.
read_word
(
tmdev
,
True
)
sensor_dbg_info_size
=
ram_dump
.
sizeof
(
'
struct tsens_sensor_dbg_info
'
)
sensor_dbg_info
=
self
.
ramdump
.
field_offset
(
'
struct tsens_tm_device
'
,
'
sensor_dbg_info
'
)
time_stamp
=
self
.
ramdump
.
field_offset
(
'
struct tsens_sensor_dbg_info
'
,
'
time_stmp
'
)
cpus_sensor
=
self
.
ramdump
.
addr_lookup
(
'
cpus
'
)
cpus_sensor_size
=
ram_dump
.
sizeof
(
'
struct cpu_info
'
)
sensor_id_offset
=
self
.
ramdump
.
field_offset
(
'
struct cpu_info
'
,
'
sensor_id
'
)
if
not
all
((
tmdev
,
sensor_dbg_info_size
,
sensor_dbg_info
,
time_stamp
,
cpus_sensor
,
cpus_sensor_size
,
sensor_id_offset
)):
self
.
output_file
.
write
(
"
Not supported for this target yet :-(
\n
"
)
return
for
i
in
ram_dump
.
iter_cpus
():
cpu_sensor_id_address
=
cpus_sensor
+
sensor_id_offset
sensor_id
=
self
.
ramdump
.
read_u32
(
cpu_sensor_id_address
,
True
)
cpus_sensor
=
cpus_sensor
+
cpus_sensor_size
sensor_mapping
.
append
((
sensor_id
-
1
)
*
sensor_dbg_info_size
)
self
.
print_thermal_info
(
(
tmdev_address
+
sensor_dbg_info
),
ram_dump
,
time_stamp
,
sensor_mapping
)
def
parse
(
self
):
self
.
output_file
=
self
.
ramdump
.
open_file
(
'
thermal_info.txt
'
)
self
.
tmdev_data
(
self
.
ramdump
)
self
.
output_file
.
close
()
print_out_str
(
"
--- Wrote the output to thermal_info.txt
"
)
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