create thermal dump in gs-common
Bug: 257880034 Test: adb bugreport Change-Id: I0d93796c2639148dfb00b0d739cbae483091bfd4
This commit is contained in:
parent
30b4bba516
commit
486bbb9212
10
thermal/Android.bp
Normal file
10
thermal/Android.bp
Normal file
@ -0,0 +1,10 @@
|
||||
package {
|
||||
default_applicable_licenses: ["Android-Apache-2.0"],
|
||||
}
|
||||
|
||||
sh_binary {
|
||||
name: "dump_thermal.sh",
|
||||
src: "dump_thermal.sh",
|
||||
vendor: true,
|
||||
sub_dir: "dump",
|
||||
}
|
46
thermal/dump_thermal.sh
Normal file
46
thermal/dump_thermal.sh
Normal file
@ -0,0 +1,46 @@
|
||||
#!/vendor/bin/sh
|
||||
|
||||
echo "Temperatures"
|
||||
for f in /sys/class/thermal/thermal* ; do
|
||||
printf "%s: %s\n" `cat $f/type` `cat $f/temp`
|
||||
done
|
||||
|
||||
echo "Cooling Device Current State"
|
||||
for f in /sys/class/thermal/cooling* ; do
|
||||
printf "%s: %s\n" `cat $f/type` `cat $f/cur_state`
|
||||
done
|
||||
|
||||
echo "Cooling Device User Vote State"
|
||||
for f in /sys/class/thermal/cooling* ; do
|
||||
if [ ! -f $f/user_vote ]; then continue; fi;
|
||||
printf "%s: %s\n" `cat $f/type` `cat $f/user_vote`
|
||||
done
|
||||
|
||||
echo "Cooling Device Time in State"
|
||||
for f in /sys/class/thermal/cooling* ; do
|
||||
printf "%s: %s\n" `cat $f/type` `cat $f/stats/time_in_state_ms`
|
||||
done
|
||||
|
||||
echo "Cooling Device Trans Table"
|
||||
for f in /sys/class/thermal/cooling* ; do
|
||||
printf "%s: %s\n" `cat $f/type` `cat $f/stats/trans_table`
|
||||
done
|
||||
|
||||
echo "Cooling Device State2Power Table"
|
||||
for f in /sys/class/thermal/cooling* ; do
|
||||
if [ ! -f $f/state2power_table ]; then continue; fi;
|
||||
printf "%s: %s\n" `cat $f/type` `cat $f/state2power_table`
|
||||
done
|
||||
|
||||
echo "TMU state:"
|
||||
cat /sys/module/gs_thermal/parameters/tmu_reg_dump_state
|
||||
echo "TMU current temperature:"
|
||||
cat /sys/module/gs_thermal/parameters/tmu_reg_dump_current_temp
|
||||
echo "TMU_TOP rise thresholds:"
|
||||
cat /sys/module/gs_thermal/parameters/tmu_top_reg_dump_rise_thres
|
||||
echo "TMU_TOP fall thresholds:"
|
||||
cat /sys/module/gs_thermal/parameters/tmu_top_reg_dump_fall_thres
|
||||
echo "TMU_SUB rise thresholds:"
|
||||
cat /sys/module/gs_thermal/parameters/tmu_sub_reg_dump_rise_thres
|
||||
echo "TMU_SUB fall thresholds:"
|
||||
cat /sys/module/gs_thermal/parameters/tmu_sub_reg_dump_fall_thres
|
6
thermal/sepolicy/dump_thermal.te
Normal file
6
thermal/sepolicy/dump_thermal.te
Normal file
@ -0,0 +1,6 @@
|
||||
pixel_bugreport(dump_thermal)
|
||||
|
||||
allow dump_thermal sysfs_thermal:dir r_dir_perms;
|
||||
allow dump_thermal sysfs_thermal:file r_file_perms;
|
||||
allow dump_thermal sysfs_thermal:lnk_file r_file_perms;
|
||||
allow dump_thermal vendor_toolbox_exec:file execute_no_trans;
|
1
thermal/sepolicy/file_contexts
Normal file
1
thermal/sepolicy/file_contexts
Normal file
@ -0,0 +1 @@
|
||||
/vendor/bin/dump/dump_thermal\.sh u:object_r:dump_thermal_exec:s0
|
3
thermal/sepolicy/genfs_contexts
Normal file
3
thermal/sepolicy/genfs_contexts
Normal file
@ -0,0 +1,3 @@
|
||||
# thermal sysfs files
|
||||
genfscon sysfs /module/gs_thermal/parameters u:object_r:sysfs_thermal:s0
|
||||
|
3
thermal/thermal.mk
Normal file
3
thermal/thermal.mk
Normal file
@ -0,0 +1,3 @@
|
||||
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/thermal/sepolicy
|
||||
|
||||
PRODUCT_PACKAGES += dump_thermal.sh
|
Loading…
x
Reference in New Issue
Block a user