@@ -94,7 +94,6 @@ struct cdev_record {
94
94
* @trip_temp: trip temperature at mitigation start
95
95
* @trip_hyst: trip hysteresis at mitigation start
96
96
* @count: the number of times the zone temperature was above the trip point
97
- * @max: maximum recorded temperature above the trip point
98
97
* @min: minimum recorded temperature above the trip point
99
98
* @avg: average temperature above the trip point
100
99
*/
@@ -104,7 +103,6 @@ struct trip_stats {
104
103
int trip_temp ;
105
104
int trip_hyst ;
106
105
int count ;
107
- int max ;
108
106
int min ;
109
107
int avg ;
110
108
};
@@ -122,12 +120,14 @@ struct trip_stats {
122
120
* @timestamp: first trip point crossed the way up
123
121
* @duration: total duration of the mitigation episode
124
122
* @node: a list element to be added to the list of tz events
123
+ * @max_temp: maximum zone temperature during this episode
125
124
* @trip_stats: per trip point statistics, flexible array
126
125
*/
127
126
struct tz_episode {
128
127
ktime_t timestamp ;
129
128
ktime_t duration ;
130
129
struct list_head node ;
130
+ int max_temp ;
131
131
struct trip_stats trip_stats [];
132
132
};
133
133
@@ -561,11 +561,11 @@ static struct tz_episode *thermal_debugfs_tz_event_alloc(struct thermal_zone_dev
561
561
INIT_LIST_HEAD (& tze -> node );
562
562
tze -> timestamp = now ;
563
563
tze -> duration = KTIME_MIN ;
564
+ tze -> max_temp = INT_MIN ;
564
565
565
566
for (i = 0 ; i < tz -> num_trips ; i ++ ) {
566
567
tze -> trip_stats [i ].trip_temp = THERMAL_TEMP_INVALID ;
567
568
tze -> trip_stats [i ].min = INT_MAX ;
568
- tze -> trip_stats [i ].max = INT_MIN ;
569
569
}
570
570
571
571
return tze ;
@@ -738,11 +738,13 @@ void thermal_debug_update_trip_stats(struct thermal_zone_device *tz)
738
738
739
739
tze = list_first_entry (& tz_dbg -> tz_episodes , struct tz_episode , node );
740
740
741
+ if (tz -> temperature > tze -> max_temp )
742
+ tze -> max_temp = tz -> temperature ;
743
+
741
744
for (i = 0 ; i < tz_dbg -> nr_trips ; i ++ ) {
742
745
int trip_id = tz_dbg -> trips_crossed [i ];
743
746
struct trip_stats * trip_stats = & tze -> trip_stats [trip_id ];
744
747
745
- trip_stats -> max = max (trip_stats -> max , tz -> temperature );
746
748
trip_stats -> min = min (trip_stats -> min , tz -> temperature );
747
749
trip_stats -> avg += (tz -> temperature - trip_stats -> avg ) /
748
750
++ trip_stats -> count ;
@@ -798,10 +800,10 @@ static int tze_seq_show(struct seq_file *s, void *v)
798
800
c = '=' ;
799
801
}
800
802
801
- seq_printf (s , ",-Mitigation at %llums, duration%c%llums\n" ,
802
- ktime_to_ms (tze -> timestamp ), c , duration_ms );
803
+ seq_printf (s , ",-Mitigation at %llums, duration%c%llums, max. temp=%dm°C \n" ,
804
+ ktime_to_ms (tze -> timestamp ), c , duration_ms , tze -> max_temp );
803
805
804
- seq_printf (s , "| trip | type | temp(m°C) | hyst(m°C) | duration(ms) | avg(m°C) | min(m°C) | max(m°C) | \n" );
806
+ seq_printf (s , "| trip | type | temp(m°C) | hyst(m°C) | duration(ms) | avg(m°C) | min(m°C) |\n" );
805
807
806
808
for_each_trip_desc (tz , td ) {
807
809
const struct thermal_trip * trip = & td -> trip ;
@@ -842,15 +844,14 @@ static int tze_seq_show(struct seq_file *s, void *v)
842
844
c = ' ' ;
843
845
}
844
846
845
- seq_printf (s , "| %*d | %*s | %*d | %*d | %c%*lld | %*d | %*d | %*d | \n" ,
847
+ seq_printf (s , "| %*d | %*s | %*d | %*d | %c%*lld | %*d | %*d |\n" ,
846
848
4 , trip_id ,
847
849
8 , type ,
848
850
9 , trip_stats -> trip_temp ,
849
851
9 , trip_stats -> trip_hyst ,
850
852
c , 11 , duration_ms ,
851
853
9 , trip_stats -> avg ,
852
- 9 , trip_stats -> min ,
853
- 9 , trip_stats -> max );
854
+ 9 , trip_stats -> min );
854
855
}
855
856
856
857
return 0 ;
0 commit comments