Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp457lqb; Thu, 23 May 2024 09:07:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWIVllUPK6eZuH5OhzZxn5tJyS6vxHvejbRXz0qR/NrTm7eKPRgRpkUk80JQ5Rzl46YLh1RaRQV0roMwqVLS7L41OKbzzoTjEew3sxYnQ== X-Google-Smtp-Source: AGHT+IHQ772GSujvtUBRci0RAWDSyS/lGRkjXf1loFKWVzWysF4kt9EZb9wZtdfrJ3rybVdCv2uA X-Received: by 2002:a05:6a20:12cb:b0:1af:a2fa:e666 with SMTP id adf61e73a8af0-1b1f87f82b7mr5779692637.10.1716480437564; Thu, 23 May 2024 09:07:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716480437; cv=pass; d=google.com; s=arc-20160816; b=e2KjkAz0kKYgSBfNteh0MJ/E3gQvGkyAGe5S1KvNzh8BWH4mAFaPUVi0TLXCDSd+9x 1S9gb/WuDnL/OvrJbyF0EJ+Yphdf6VwHcZqG7Bl2FAyaz+FSR5D5OhouTb9QbUE9+D6w 3d9rIt4tPAiupEroT8LjUIwIuJCNOsWXs9QD9UTNaJ2h8fXr4bb77vDXNJOHsU0ZCeph 7wjHesIfT12U1XdD2Tu5xLLieiepG/WH+vVYK/CMyhlY1sL5mF2GA95+LjPHDdSY2yE3 QJecQ8bzgGOJVqsUuUcZhLNKxjEUiCqRj6oWGNcsAc7pavg4tFsjSyidGff42b9YW4T6 u0xA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=IkmV6Goze8klpCyzJIWO5UmdoBzZp39nz/K/g4IwLjc=; fh=GzCkp9dboMjnsRASvUnR8RkBPyyMxU6lLzxcgnbmqi0=; b=co17CaIzpzDktsdosv3LFIPSdGvqwyJuW6pG3hp+BrMG3WXz7WQsv6NucxsVaKlF8E 3TE8TPnW24jp+03E/S7oewOBLFaEeWVSHjKd73F8/X7V1TtLDAIYhjb5nBXT+YFBBkdS Kht5ShGgAQOWbR4/9Zj0G8OvxS+2dfwV6Uoil6PNhKPIjZ8iXlfbYY4JAbeSx5T+jPmJ U375baPkH02eJc8/n6/UCkpIBbWmyj3QozsbfS07Px1/y7WlcjEmBXQ7IIpqflvLxzfa sdCaUqUjKPnhp06dmm73FdmgUH+jA4tcDpD5POlYaKPvxyPOhG8rJEDkszx+/i2NGX1f UAQA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@rjwysocki.net header.s=dkim header.b=X6VZI3uW; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-187770-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187770-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-65c954451b2si1400572a12.199.2024.05.23.09.07.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 09:07:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187770-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=fail header.i=@rjwysocki.net header.s=dkim header.b=X6VZI3uW; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-187770-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187770-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D53C1283C82 for ; Thu, 23 May 2024 16:05:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1102B2C182; Thu, 23 May 2024 16:05:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=rjwysocki.net header.i=@rjwysocki.net header.b="X6VZI3uW" Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 09870111AA; Thu, 23 May 2024 16:05:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=79.96.170.134 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716480323; cv=none; b=XKv0GvvXlz/vb8NSroOA1Va8DcxHXGoqmDKgYuTXZ3DjjHo1Nui609pKdZnJenjS7uFZJT36lCdR4lbOo2YYFVqAdsnzQqD5gdcJJThtzSy1F3UWUlq9mcvWK9ymXKsfNl+XGGNV0EWz49FR1cRfRdmeqUGnpm8mBe9sWvi1zWI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716480323; c=relaxed/simple; bh=aHU0Dj74soaJ/vBUBHdYftzV9Ctsq41ZYO7C2uCE3fg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=udGS9guhGu7Y11yMGJJySfqv8bXfdX0UBUass/Yb9JQHEBCsuiUCUpfcelE0kTG2J4zyr2ge0VZTGFFksGoUI/qyNcCu+nqrM2hpk3LhCPlPeVR4ncvCYrZ20Gm0igFYhfB92svlUASIZw3eU4Bb/NjAwidGnX86k1xTwC4d2lw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net; spf=pass smtp.mailfrom=rjwysocki.net; dkim=fail (2048-bit key) header.d=rjwysocki.net header.i=@rjwysocki.net header.b=X6VZI3uW reason="signature verification failed"; arc=none smtp.client-ip=79.96.170.134 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rjwysocki.net Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 6.1.0) id 90909aeb67f4c744; Thu, 23 May 2024 18:05:13 +0200 Received: from kreacher.localnet (unknown [195.136.19.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cloudserver094114.home.pl (Postfix) with ESMTPSA id 9677A6A4927; Thu, 23 May 2024 18:05:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rjwysocki.net; s=dkim; t=1716480313; bh=aHU0Dj74soaJ/vBUBHdYftzV9Ctsq41ZYO7C2uCE3fg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=X6VZI3uW3KkuNGnes948TD1SpHO7Sjsdnq4V4wRY/D3c/aUhL/qOdRkKxi7+znvM5 2E1RZROH5sG7d/gltmh2RdLr/eWaKixs9kHiAJLP2tamKMi6rHEryMct5T1J/5LxLO LYg8wbWGPy6U++6YcZju4lAZE8/3kK8sP2PD17avc9Ecqwt6sNH6LhmwCoPlOV/Wsy NG8ym/c/cdab3DimUsSOZYsvFFpfwfQBLhIt7q5blTLCg7VkYF6w6Nr71K7tHU/0Jt GJbis8l9C+RAhjWojEGkEOGPITek2FmA1kTB3eyF2Agf74/+zdzPVNBX8Kf2HwoCRW EBn8aC9N7//KA== From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , "Rafael J. Wysocki" , Lukasz Luba , Daniel Lezcano , Srinivas Pandruvada , Zhang Rui Subject: [PATCH v1 1/4] thermal/debugfs: Print initial trip temperature and hysteresis in tze_seq_show() Date: Thu, 23 May 2024 17:57:21 +0200 Message-ID: <4918963.31r3eYUQgx@kreacher> In-Reply-To: <12438941.O9o76ZdvQC@kreacher> References: <12438941.O9o76ZdvQC@kreacher> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrvdeiiedgleehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdffueeitdfgvddtudegueejtdffteetgeefkeffvdeftddttdeuhfegfedvjefhnecukfhppeduleehrddufeeirdduledrleegnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehinhgvthepudelhedrudefiedrudelrdelgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepjedprhgtphhtthhopehlihhnuhigqdhpmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehrrghfrggvlheskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhukhgrshiirdhluhgsrgesrghrmhdrtghomhdprhgtphhtthhopegurghnihgvlhdrlhgviigt rghnoheslhhinhgrrhhordhorhhgpdhrtghpthhtohepshhrihhnihhvrghsrdhprghnughruhhvrggurgeslhhinhhugidrihhnthgvlhdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=7 Fuz1=7 Fuz2=7 From: Rafael J. Wysocki The temperature and hysteresis of a trip point may change during a mitigation episode it is involved in (it may even become invalid altogether), so in order to avoid possible confusion related to that, store the temperature and hysteresis of trip points at the time they are crossed on the way up and print those values instead of their current temperature and hysteresis. Fixes: 7ef01f228c9f ("thermal/debugfs: Add thermal debugfs information for mitigation episodes") Signed-off-by: Rafael J. Wysocki --- drivers/thermal/thermal_debugfs.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) Index: linux-pm/drivers/thermal/thermal_debugfs.c =================================================================== --- linux-pm.orig/drivers/thermal/thermal_debugfs.c +++ linux-pm/drivers/thermal/thermal_debugfs.c @@ -91,6 +91,8 @@ struct cdev_record { * * @timestamp: the trip crossing timestamp * @duration: total time when the zone temperature was above the trip point + * @trip_temp: trip temperature at mitigation start + * @trip_hyst: trip hysteresis at mitigation start * @count: the number of times the zone temperature was above the trip point * @max: maximum recorded temperature above the trip point * @min: minimum recorded temperature above the trip point @@ -99,6 +101,8 @@ struct cdev_record { struct trip_stats { ktime_t timestamp; ktime_t duration; + int trip_temp; + int trip_hyst; int count; int max; int min; @@ -574,6 +581,7 @@ void thermal_debug_tz_trip_up(struct the struct thermal_debugfs *thermal_dbg = tz->debugfs; int trip_id = thermal_zone_trip_id(tz, trip); ktime_t now = ktime_get(); + struct trip_stats *trip_stats; if (!thermal_dbg) return; @@ -639,7 +647,10 @@ void thermal_debug_tz_trip_up(struct the tz_dbg->trips_crossed[tz_dbg->nr_trips++] = trip_id; tze = list_first_entry(&tz_dbg->tz_episodes, struct tz_episode, node); - tze->trip_stats[trip_id].timestamp = now; + trip_stats = &tze->trip_stats[trip_id]; + trip_stats->trip_temp = trip->temperature; + trip_stats->trip_hyst = trip->hysteresis; + trip_stats->timestamp = now; unlock: mutex_unlock(&thermal_dbg->lock); @@ -836,8 +847,8 @@ static int tze_seq_show(struct seq_file seq_printf(s, "| %*d | %*s | %*d | %*d | %c%*lld | %*d | %*d | %*d |\n", 4 , trip_id, 8, type, - 9, trip->temperature, - 9, trip->hysteresis, + 9, trip_stats->trip_temp, + 9, trip_stats->trip_hyst, c, 10, duration_ms, 9, trip_stats->avg, 9, trip_stats->min,