• Rafael J. Wysocki's avatar
    thermal/debugfs: Avoid printing zero duration for mitigation events in progress · bd700ba9
    Rafael J. Wysocki authored
    If a thermal mitigation event is in progress, its duration value has
    not been updated yet, so 0 will be printed as the event duration by
    tze_seq_show() which is confusing.
    
    Avoid doing that by marking the beginning of the event with the
    KTIME_MIN duration value and making tze_seq_show() compute the current
    event duration on the fly, in which case '>' will be printed instead of
    '=' in the event duration value field.
    
    Similarly, for trip points that have been crossed on the down, mark
    the end of mitigation with the KTIME_MAX timestamp value and make
    tze_seq_show() compute the current duration on the fly for the trip
    points still involved in the mitigation, in which cases the duration
    value printed by it will be prepended with a '>' character.
    
    Fixes: 7ef01f22 ("thermal/debugfs: Add thermal debugfs information for mitigation episodes")
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    Reviewed-by: default avatarLukasz Luba <lukasz.luba@arm.com>
    Tested-by: default avatarLukasz Luba <lukasz.luba@arm.com>
    bd700ba9
thermal_debugfs.c 23.7 KB