From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89538EB64D7 for ; Wed, 21 Jun 2023 04:45:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229478AbjFUEpZ (ORCPT ); Wed, 21 Jun 2023 00:45:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229629AbjFUEpY (ORCPT ); Wed, 21 Jun 2023 00:45:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AEABA4; Tue, 20 Jun 2023 21:45:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 102ED61470; Wed, 21 Jun 2023 04:45:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EAF57C433C0; Wed, 21 Jun 2023 04:45:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687322722; bh=TcKINXOcw5b0Qrk9l788NJZbTAeyC81PylgQJ3fFDMQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PHEkoC5/sfpjOtf4gQOORmpCeOyEHi+l7yCBvnY6KhzN5/6US7PXwE+Ep78T9q0KN fBnX6OiPDVTsO5vQX17oXcdloZNk22sZPd+HyOeftlf97Or4w/arxg9X5S0L2EgQXE 24N7smy/EJSgxGGfFTN7BdsXwLhPNO3R4AsOF+9gpKGjiZGFGKN3M+sq3q5X+bhkjA VzwPvXOtXxAqNmqAVVvb7llMQWENPkEPxlZe61fCF+GZ31VusDM37EAu7Hwdwvlje9 YknwkoICkEa/AgqrHDusmVcQeV47cjtAJ/xTkereUos55Fkw9QK5IFxhEIC8DPvQtQ CivpVRnVRbNpQ== Date: Tue, 20 Jun 2023 21:45:20 -0700 From: Eduardo Valentin To: "Rafael J. Wysocki" Cc: Eduardo Valentin , eduval@amazon.com, linux-pm@vger.kernel.org, Daniel Lezcano , Amit Kucheria , Zhang Rui , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/7] thermal: stats: introduce tz time in trip Message-ID: References: <20230519032719.2581689-1-evalenti@kernel.org> <20230519032719.2581689-6-evalenti@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On Tue, Jun 20, 2023 at 07:27:57PM +0200, Rafael J. Wysocki wrote: > > > > On Fri, May 19, 2023 at 5:27 AM Eduardo Valentin wrote: > > > > From: Eduardo Valentin > > > > This patch adds a statistic to report how long > > the thermal zone spent on temperature intervals > > created by each trip point. The first interval > > is the range below the first trip point. All > > subsequent intervals are accounted when temperature > > is above the trip point temperature value. > > > > Samples: > > $ cat /sys//class/thermal/thermal_zone0/stats/time_in_trip_ms > > trip-1 0 0 > > The above line is confusing. > > > trip0 -10000 35188 > > trip1 25000 0 > > And the format violates the "one value per attribute" sysfs rule. > > > $ cat /sys//class/thermal/thermal_zone0/stats/time_in_trip_ms > > trip-1 0 0 > > trip0 -10000 36901 > > trip1 25000 0 > > $ echo 25001 > /sys//class/thermal/thermal_zone0/emul_temp > > $ cat /sys//class/thermal/thermal_zone0/stats/time_in_trip_ms > > trip-1 0 0 > > trip0 -10000 47810 > > trip1 25000 2259 > > $ cat /sys//class/thermal/thermal_zone0/stats/time_in_trip_ms > > trip-1 0 0 > > trip0 -10000 47810 > > trip1 25000 3224 > > $ echo 24001 > /sys//class/thermal/thermal_zone0/emul_temp > > $ cat /sys//class/thermal/thermal_zone0/stats/time_in_trip_ms > > trip-1 0 0 > > trip0 -10000 48960 > > trip1 25000 10080 > > $ cat /sys//class/thermal/thermal_zone0/stats/time_in_trip_ms > > trip-1 0 0 > > trip0 -10000 49844 > > trip1 25000 10080 > > > > Cc: "Rafael J. Wysocki" (supporter:THERMAL) > > Cc: Daniel Lezcano (supporter:THERMAL) > > Cc: Amit Kucheria (reviewer:THERMAL) > > Cc: Zhang Rui (reviewer:THERMAL) > > Cc: Jonathan Corbet (maintainer:DOCUMENTATION) > > Cc: linux-pm@vger.kernel.org (open list:THERMAL) > > Cc: linux-doc@vger.kernel.org (open list:DOCUMENTATION) > > Cc: linux-kernel@vger.kernel.org (open list) > > > > Signed-off-by: Eduardo Valentin > > --- > > .../driver-api/thermal/sysfs-api.rst | 2 + > > drivers/thermal/thermal_sysfs.c | 86 +++++++++++++++++++ > > 2 files changed, 88 insertions(+) > > > > diff --git a/Documentation/driver-api/thermal/sysfs-api.rst b/Documentation/driver-api/thermal/sysfs-api.rst > > index ed5e6ba4e0d7..4a2b92a7488c 100644 > > --- a/Documentation/driver-api/thermal/sysfs-api.rst > > +++ b/Documentation/driver-api/thermal/sysfs-api.rst > > @@ -359,6 +359,8 @@ Thermal zone device sys I/F, created once it's registered:: > > |---stats/reset_tz_stats: Writes to this file resets the statistics. > > |---stats/max_gradient: The maximum recorded dT/dt in uC/ms. > > |---stats/min_gradient: The minimum recorded dT/dt in uC/ms. > > + |---stats/time_in_trip_ms: Time spent on each temperature interval of > > + trip points. > > I would write "in each temperature interval between consecutive trip points". Ok > > Doesn't this assume a specific temperature ordering of trip points? > And so what if they are not ordered? It does. I believe other things will break if they are not ordered. Like the temperature update against the governor throttle callback invocation in the thermal core. -- All the best, Eduardo Valentin