GNU bug report logs - #68309
[PATCH] gnu: Add powertop-service-type.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Ian Eure <ian@HIDDEN>; Keywords: patch; dated Sun, 7 Jan 2024 21:23:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 68309 <at> debbugs.gnu.org:


Received: (at 68309) by debbugs.gnu.org; 17 Jan 2024 10:15:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 17 05:15:53 2024
Received: from localhost ([127.0.0.1]:50880 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rQ2xd-0008TP-0O
	for submit <at> debbugs.gnu.org; Wed, 17 Jan 2024 05:15:53 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:43650)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <othacehe@HIDDEN>) id 1rQ2xc-0008JR-Cv
 for 68309 <at> debbugs.gnu.org; Wed, 17 Jan 2024 05:15:52 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <othacehe@HIDDEN>)
 id 1rQ2xW-0000Ab-2e; Wed, 17 Jan 2024 05:15:46 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=51COeu+49A4leErFpaTCrtPRM4VJ7LTTT00WbYsx+qQ=; b=ZG3mUszsTuzojTozj7gN
 9U7GKI9SnCDmyzW0wbZdduCuBlJ/ql/jxgI83eAE5UaQxBSona6MuTV+2rwRUBa673LdDgc8ewstq
 PXkukigajaZhCBti7f9S0d24HKZJkRFhT/3vn+TB/xtrabDZ5wAlgZVf49xXQ1j4u65E0ThvfVdnq
 dsg/F3puFDOwnAislHbLP26LTDGNzan9pWKJP74tJ/fFT6nchtOC3AsNGY5O8GMHsV1EjJ89Kzwrw
 MfWNC3z0VdGO30UZrzgbVI+5iJXnecYWWmnV7lTogwnAjE3dEpG30MJ9sVYzwueXrByKC89PWpNHL
 P7bj9lugumCSQg==;
From: Mathieu Othacehe <othacehe@HIDDEN>
To: Ian Eure <ian@HIDDEN>
Subject: Re: [bug#68309] [PATCH 1/2] gnu: Add powertop-service-type.
In-Reply-To: <20240114004019.5019-1-ian@HIDDEN> (Ian Eure's message of
 "Sat, 13 Jan 2024 16:40:17 -0800")
References: <20240107212122.21810-1-ian@HIDDEN>
 <20240114004019.5019-1-ian@HIDDEN>
Date: Wed, 17 Jan 2024 11:15:44 +0100
Message-ID: <87a5p4jmen.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68309
Cc: 68309 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)


Hey,

Thanks for the v2!

> +The @code{(gnu services pm)} module provides a Guix service definition
> +for PowerTOP.  When started, it tunes kernel settings to reduce power
> +consumption.

I have this error when building the documentation:

--8<---------------cut here---------------start------------->8---
guix.texi:34841: `@end' expected `lisp', but saw `defvar'
--8<---------------cut here---------------end--------------->8---

> +
> +
> +

Kill that extra line

> +;;;
> +;;; powertop
> +;;;
> +;;; Calls `powertop --auto-tune' to reduce energy consumption.
> +
> +

That one too.

> +   (description "Tune power-related kernel parameters to reduce energy consumption.")))

Wrap it to be under 78 characters.

Thanks,

Mathieu




Information forwarded to guix-patches@HIDDEN:
bug#68309; Package guix-patches. Full text available.

Message received at 68309 <at> debbugs.gnu.org:


Received: (at 68309) by debbugs.gnu.org; 14 Jan 2024 00:40:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 13 19:40:42 2024
Received: from localhost ([127.0.0.1]:41364 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rOoYL-0000s2-RT
	for submit <at> debbugs.gnu.org; Sat, 13 Jan 2024 19:40:42 -0500
Received: from out2-smtp.messagingengine.com ([66.111.4.26]:34387)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ian@HIDDEN>) id 1rOoYH-0000rZ-GU
 for 68309 <at> debbugs.gnu.org; Sat, 13 Jan 2024 19:40:38 -0500
Received: from compute6.internal (compute6.nyi.internal [10.202.2.47])
 by mailout.nyi.internal (Postfix) with ESMTP id 7B4D85C0113;
 Sat, 13 Jan 2024 19:40:33 -0500 (EST)
Received: from mailfrontend2 ([10.202.2.163])
 by compute6.internal (MEProxy); Sat, 13 Jan 2024 19:40:33 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=retrospec.tv; h=
 cc:cc:content-transfer-encoding:content-type:date:date:from:from
 :in-reply-to:in-reply-to:message-id:mime-version:references
 :reply-to:subject:subject:to:to; s=fm1; t=1705192833; x=
 1705279233; bh=ljUlfQP5YLSmrmtRdK6YmkiHaibElqJTI0Kp879Hm8E=; b=S
 5aVXihtSMk3i1fgDy5EdcacX7eHnvoJ63emzJjw+4BVb66MLgIftqzxMa9DGQWHb
 1l7LayhRXTqgUg5wnBmWzGYqJgaHWJsT6Mc1u2YgFS/P6VTxVGxDFHTi+A8Pec05
 SsqvsKdjnc1efxKWTwOTklVlIzGDzFqYvvfkAqoumJG/k4vGtQeNRnMtLMLhCtEO
 5S2mcPRidVQxy6/DWevyinN1WpOn1v709kwOk7mPNXfbPUAl6iIoV1q5aj/lqZwj
 sVMMbD6TTJ/lrBDnUvCJzIZ+A8JOe3UebJabVb4fCh72gQJAlb7T6e67zj8+EWHn
 wpybhDQbogWMJ8k1XIKUw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:date:date:feedback-id:feedback-id:from:from
 :in-reply-to:in-reply-to:message-id:mime-version:references
 :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1705192833; x=
 1705279233; bh=ljUlfQP5YLSmrmtRdK6YmkiHaibElqJTI0Kp879Hm8E=; b=6
 mzobsQJBQYyvQ0oaW4D7S2bLwKlObN1QLr5QZH5JZWeAHxrH8H2phgqgoCBMV977
 wB9fqsdLq9Uz189lBABkHWYRJvl+8eKHXEtNveYK58poFcrBAZ/SX0bPN8NZvTC/
 re9kXY/Txz64NrOaBL7XL0wlaJygdBPl12PsA9F5E10NK+jlI1/vuYs+JHjzsFq5
 G5UX0Nw3yEHK7E/vedNud+X78pjNPf8IKXbY70AP0NXOn2xMFLI0/1b009tkqI0E
 V3YQJtwRGGuc0knkrcS93T3CutqYs5a1ilLfMP482zUmCA3H4DorJ1t09buWMAhR
 zkhNxRshj6uq987LkaZ+A==
X-ME-Sender: <xms:gS2jZfUIZYnZ2S-57a7-IW9S96aqP4yFFdyRXq_Fe-kV4GmDbZtPAQ>
 <xme:gS2jZXkK40WohWDmMxAUJ3d4-yfO5Pf8SRlNCbdOfvGHnkxxHHrSk7g6J7J4kT8y5
 TJoJfRs9QMxGZvV5g>
X-ME-Received: <xmr:gS2jZbaDAEqtmmQI9ro2NcQsvEWlCoRS-KaDgNX5mYHYZVf2N6649sorAKkh2ut6QC9mzDKYEtSBMVcg9zT3cLbc57pOJ_ih34hfDo59ntX1SWQaww>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeikedgvdehucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke
 ertdertddtnecuhfhrohhmpefkrghnucfguhhrvgcuoehirghnsehrvghtrhhoshhpvggt
 rdhtvheqnecuggftrfgrthhtvghrnhepgfeiveehgeeijeeifeekfedthfejudduhfduhe
 ehjeeuhfettdehkedthfegudeinecuffhomhgrihhnpedtuddrohhrghenucevlhhushht
 vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehirghnsehrvghtrhhosh
 hpvggtrdhtvh
X-ME-Proxy: <xmx:gS2jZaUEOX3HBQZ3F0Tz3yt8sNeppks8HihX8XD27enUZto2vm_TEQ>
 <xmx:gS2jZZn80iXVvA-Yqe2_9IsVZurhElpQdIvINio_3mGoPRWHn0-rew>
 <xmx:gS2jZXefubWyia5odI7HLQZQTYqBWmSR86suGrWnwauVRS1lKSgWrg>
 <xmx:gS2jZYshehck67cemJnoKFANwi6XYPD3aM8Hws-WQiMLWCrU8Z8fTA>
Feedback-ID: id9014242:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat,
 13 Jan 2024 19:40:32 -0500 (EST)
From: Ian Eure <ian@HIDDEN>
To: 68309 <at> debbugs.gnu.org
Subject: [PATCH 2/2] gnu: Correct package description.
Date: Sat, 13 Jan 2024 16:40:18 -0800
Message-ID: <20240114004019.5019-2-ian@HIDDEN>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <20240114004019.5019-1-ian@HIDDEN>
References: <20240114004019.5019-1-ian@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 68309
Cc: Ian Eure <ian@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

* gnu/packages/linux.scm (powertop): Correct package description.

Change-Id: Ifc81ed62158df8b3c235d335731590e977dcc725
---
 gnu/packages/linux.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 716f5907f0..3cd63df6ee 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -3634,7 +3634,7 @@ (define-public powertop
     (inputs
      (list kmod libnl ncurses pciutils zlib))
     (home-page "https://01.org/powertop/")
-    (synopsis "Analyze power consumption on Intel-based laptops")
+    (synopsis "Analyze power consumption on x86-based laptops")
     (description
      "PowerTOP is a Linux tool to diagnose issues with power consumption and
 power management.  In addition to being a diagnostic tool, PowerTOP also has
-- 
2.41.0





Information forwarded to guix-patches@HIDDEN:
bug#68309; Package guix-patches. Full text available.

Message received at 68309 <at> debbugs.gnu.org:


Received: (at 68309) by debbugs.gnu.org; 14 Jan 2024 00:40:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 13 19:40:37 2024
Received: from localhost ([127.0.0.1]:41359 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rOoYH-0000rm-90
	for submit <at> debbugs.gnu.org; Sat, 13 Jan 2024 19:40:37 -0500
Received: from out2-smtp.messagingengine.com ([66.111.4.26]:40803)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ian@HIDDEN>) id 1rOoYF-0000rV-Ek
 for 68309 <at> debbugs.gnu.org; Sat, 13 Jan 2024 19:40:36 -0500
Received: from compute2.internal (compute2.nyi.internal [10.202.2.46])
 by mailout.nyi.internal (Postfix) with ESMTP id 6F4CD5C007C;
 Sat, 13 Jan 2024 19:40:30 -0500 (EST)
Received: from mailfrontend2 ([10.202.2.163])
 by compute2.internal (MEProxy); Sat, 13 Jan 2024 19:40:30 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=retrospec.tv; h=
 cc:cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:message-id:mime-version:reply-to
 :subject:subject:to:to; s=fm1; t=1705192830; x=1705279230; bh=xr
 wr6lWSvmvdPfw1YGL0Z4/QEXJtHhFuf8u5XXoyxKc=; b=mJZVI9Z7I/I4khrAwr
 YkmV1w5Q0BQz9nJAD6V/XEa8UlLtdq2yHiWQisft5SubnwFUcOs/O3xD+4/5syTH
 mgBd0ljkBDfAwYhEpNLfOKPlzbF5dFIVR32qiZG5rX6ASFu9PhJ9Vd4BgZPPyqOV
 ytGVP4hE37AeEyMoGloOopMaTKqK+0Qa83Th8enj0kMNx7XSL8Ie27zdMZpt8SIi
 Gl8cT8aDtOi7YE9DuIX3KvpXUxNS0XFbGtQYaMNfzlG5y3WvB5IT5l/UiPIQw3Qy
 +yddpCEPOCAR3c/58PaMyDdLihZeft9cJugbYbmxq9du+4OEu6lBxaWdbKZWhEer
 C0cA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:message-id:mime-version:reply-to:subject
 :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
 :x-sasl-enc; s=fm2; t=1705192830; x=1705279230; bh=xrwr6lWSvmvdP
 fw1YGL0Z4/QEXJtHhFuf8u5XXoyxKc=; b=9CXKGnRzRKkP13NFcVkfDWGB55bjo
 Talw9YPDK+xxRBB29O+EblkvHiv4ktL8BxqLaXZAZTIB3VKfADAIOhMUIuXQSr3+
 rMl3ummFw2zmqkv3dWdsH4p64fPMIiPwUVRg1fAeL9TcEqOJ6c6g3p7Aroy30xtn
 hxWxmmJa2sOHk3QPrjCvy+4gwpZd8c1z8jRN1BvkcyEMCL+9UtmosTfMkIjZzpL7
 sHagyK+9c/NlqVO8G6+44QuRbsQ9W+VQ/yt4o0hEv1gfnSVO68Xfy7Vakbb8aW7X
 Aict5DDX1wgIR7jE6cS1hHnhAHOhYNzflFMDvlgYzzuTD2C7DpBY+gB/Q==
X-ME-Sender: <xms:fi2jZUCVNeudLg6_mKEVgzss1JMjKhpR9M-yEo3vA_zuQ90OMnr2aw>
 <xme:fi2jZWgo3qhz33O9TxkQxezPlLWeCoHw23wfUcqlAspXUnbjLrQTWruU-VdVULA-U
 XdFTbYxqPF73yABQw>
X-ME-Received: <xmr:fi2jZXn8JObsGdaOcBE-UcGUYYjJWvFzFCZYcWKwkb-slSZWorQJCSWvnmkamVNFJFGjWDk9qLYLricuE-xcqrvgP7alvVIjqImuz4LGV4TZvBOjfw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeikedgvdehucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffogggtgfesthekre
 dtredtjeenucfhrhhomhepkfgrnhcugfhurhgvuceoihgrnhesrhgvthhrohhsphgvtgdr
 thhvqeenucggtffrrghtthgvrhhnpeejuefghefgffefteehvddtuddutefhvddtfeduhf
 dugfdvvdeulefgfefhhefhheenucffohhmrghinhepghhnuhdrohhrghenucevlhhushht
 vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehirghnsehrvghtrhhosh
 hpvggtrdhtvh
X-ME-Proxy: <xmx:fi2jZayhAyuzPmu5tesN0QEL8CaIrHL6XUtTJvO0QZWwTwFoNTGi8A>
 <xmx:fi2jZZQioAJ_1e6T1SaY13TCtCoymLjK4KBcZzS3HU3QH3ad8uPTsw>
 <xmx:fi2jZVZNlraUJNORhOtTORnI18QV2bp4nGfMiIacLPgi8OWMOtXzFg>
 <xmx:fi2jZa7PXXCEheeUm-N9lvwEtmMJQKjIeTYKazetYNHKt5heS_Ki6A>
Feedback-ID: id9014242:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat,
 13 Jan 2024 19:40:29 -0500 (EST)
From: Ian Eure <ian@HIDDEN>
To: 68309 <at> debbugs.gnu.org
Subject: [PATCH 1/2] gnu: Add powertop-service-type.
Date: Sat, 13 Jan 2024 16:40:17 -0800
Message-ID: <20240114004019.5019-1-ian@HIDDEN>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 68309
Cc: Ian Eure <ian@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

* gnu/services/pm.scm (powertop-shepherd-service): New variable.
* gnu/services/pm.scm (powertop-service-type): New variable.
* gnu/services/pm.scm (powertop-configuration): New variable.
* doc/guix.texi (Power Management Services): Document powertop-service-type.

Change-Id: I1c5ef855526458ad54f62ca6e755da82acce1c4a
---
 doc/guix.texi       | 24 ++++++++++++++++++++++++
 gnu/services/pm.scm | 43 ++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 66 insertions(+), 1 deletion(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 811edd0bf7..a48aa655ae 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -34798,6 +34798,30 @@ Ignore cpuid check for supported CPU models.
 @item @code{thermald} (default: @var{thermald})
 Package object of thermald.
 
+@cindex powertop
+@cindex Power tuning with PowerTOP
+@subsubheading PowerTOP
+
+The @code{(gnu services pm)} module provides a Guix service definition
+for PowerTOP.  When started, it tunes kernel settings to reduce power
+consumption.
+
+@defvar powertop-service-type
+The service type for PowerTOP.  No configuration is necessary.  When the
+service starts, it executes @code{powertop --auto-tune}.
+
+@lisp
+(service powertop-service-type)
+
+@end defvar
+
+Available @code{powertop-configuration} fields are:
+
+@deftypevr {@code{powertop-configuration} parameter} package powertop
+The PowerTOP package.  Defaults to @code{powertop}.
+
+@end deftypevr
+
 @end table
 @end deftp
 
diff --git a/gnu/services/pm.scm b/gnu/services/pm.scm
index 3daf484cc1..13a153ab1d 100644
--- a/gnu/services/pm.scm
+++ b/gnu/services/pm.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@HIDDEN>
+;;; Copyright © 2024 Ian Eure <ian@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -17,6 +18,8 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu services pm)
+  #:use-module (srfi srfi-1)
+  #:use-module (ice-9 match)
   #:use-module (guix gexp)
   #:use-module (guix packages)
   #:use-module (guix records)
@@ -31,7 +34,10 @@ (define-module (gnu services pm)
             tlp-configuration
 
             thermald-configuration
-            thermald-service-type))
+            thermald-service-type
+
+            powertop-configuration
+            powertop-service-type))
 
 (define (uglify-field-name field-name)
   (let ((str (symbol->string field-name)))
@@ -466,3 +472,38 @@ (define thermald-service-type
    (default-value (thermald-configuration))
    (description "Run thermald, a CPU frequency scaling service that helps
 prevent overheating.")))
+
+
+
+;;;
+;;; powertop
+;;;
+;;; Calls `powertop --auto-tune' to reduce energy consumption.
+
+
+
+(define-configuration powertop-configuration
+  (powertop (package powertop) "PowerTOP package to use."))
+
+(define powertop-shepherd-service
+  (match-lambda
+    (($ <powertop-configuration> powertop)
+     (shepherd-service
+      (documentation "Tune kernel power settings at boot.")
+      (provision '(powertop powertop-auto-tune))
+      (requirement '(user-processes))
+      (one-shot? #t)
+      (start #~(lambda _
+                 (zero? (system* #$(file-append powertop "/sbin/powertop")
+                                 "--auto-tune"))))))))
+
+(define powertop-service-type
+  (service-type
+   (name 'powertop)
+   (extensions
+    (list
+     (service-extension shepherd-root-service-type
+                        (compose list powertop-shepherd-service))))
+   (compose concatenate)
+   (default-value (powertop-configuration))
+   (description "Tune power-related kernel parameters to reduce energy consumption.")))
-- 
2.41.0





Information forwarded to guix-patches@HIDDEN:
bug#68309; Package guix-patches. Full text available.

Message received at 68309 <at> debbugs.gnu.org:


Received: (at 68309) by debbugs.gnu.org; 13 Jan 2024 21:25:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 13 16:25:15 2024
Received: from localhost ([127.0.0.1]:41236 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rOlVD-0002oM-E4
	for submit <at> debbugs.gnu.org; Sat, 13 Jan 2024 16:25:15 -0500
Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:57517)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ian@HIDDEN>) id 1rOlVB-0002o6-GQ
 for 68309 <at> debbugs.gnu.org; Sat, 13 Jan 2024 16:25:14 -0500
Received: from compute7.internal (compute7.nyi.internal [10.202.2.48])
 by mailout.west.internal (Postfix) with ESMTP id 0F21E3200AD6;
 Sat, 13 Jan 2024 16:25:07 -0500 (EST)
Received: from mailfrontend2 ([10.202.2.163])
 by compute7.internal (MEProxy); Sat, 13 Jan 2024 16:25:08 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=retrospec.tv; h=
 cc:cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to; s=fm1; t=1705181107;
 x=1705267507; bh=+x/cTiqdb30OX7CGM4rTxY//fVn9KP6izGbSDGPk5S4=; b=
 WCSEgFg2W9kSRfexXAvYMaO1ecCFJkkdVnIHdrZdt+E4P7unuOLaNsDaEaFsIZMH
 MLk9t3xFA/ypz+VgW9gqxhNmHegVNzpb20rhZi5ZqD7C/Rakh2mhdJJK7QGpJTqY
 nTT78jdr6/16pYFwL6prPCY/UaQeT9Ihwse5vUlsYUdXaZL5CaCzQUxJ58rC3QJc
 zd4KfhwSq4Hhk1XiLJF7h5lp5UtcU9vvUY+g0GjTvl0vCEQNNvsIoMiPlewPYFjO
 UPitg0MaIeCp9MxzES3orv4vP7Lvs/RWbLKe05irui5ynM4KShD0VFvwQRwQQkdS
 rKX2dWBOOwTklwqj0yIvUQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1705181107; x=
 1705267507; bh=+x/cTiqdb30OX7CGM4rTxY//fVn9KP6izGbSDGPk5S4=; b=F
 90G+JxVwDnwt4jX2uDcMJ7MOU1Zrvuk74ZYPyp+XK2ykhFj23DZug/mIoNk3dDpu
 P8/+SrwZ3+uJNM9HE5fU/7XW16YRUONBrRXrgDGJKL9RcK2g8mfj6q0bbzIHDYBz
 2TnCai38kYfctrC011fPCjKA/PU5+CUAwH5yT2GUcEmtkT8Jvv1tMcvgvch7XNE+
 eveBq4/W0oiCGHj8GTq094sjmMTjpzqOGIBJzxYR/1DOtBNESArYoysGr7r5/uk0
 s/gjGpvm/kttjg5QgCHPK+ogIcIq3Y3At8/7ICGGgDQN3Mjcr/0yaxx8yWLHioXK
 c07RG0M7NjO90sQg6EFzA==
X-ME-Sender: <xms:sv-iZa-Zuj3Ym_mrMTDPEWkzbkExcq4DEsN5p1hMkQc7EzG4eF05nA>
 <xme:sv-iZavF0KWdXFfEltUm4J6foc2ODtDPxKCSLMwUK-K4rOuR9CMie6JgoPSZV4K4f
 1U14pXtyr2jJU8lqg>
X-ME-Received: <xmr:sv-iZQAkgKZsuvu0nomhLh9I9BoHxys5xyGr1wMj-zSbeKuOjcgP12wsibOHZmFrkb9M_NYpQnBGJ2htLlpm65p9z6iNs7j3IKI>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeijedgudeglecutefuodetggdotefrod
 ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh
 necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd
 enucfjughrpehffgfhvfevufffjgfkgggtgfesthhqredttderjeenucfhrhhomhepkfgr
 nhcugfhurhgvuceoihgrnhesrhgvthhrohhsphgvtgdrthhvqeenucggtffrrghtthgvrh
 hnpeelhfeuudejieejgefhgfeuieeggeeitdejieevjeffteeutddvuedtgfehueevhfen
 ucffohhmrghinheptddurdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg
 hmpehmrghilhhfrhhomhepihgrnhesrhgvthhrohhsphgvtgdrthhv
X-ME-Proxy: <xmx:sv-iZSfAynkBg-UaIPhUWrSv43hSslbsMiQMTes6PCtdyY1Wz-n07A>
 <xmx:sv-iZfOeLjYkHF50TD27BZaoxxzutEtdA6pQZHXIqf78RqXbnGELBw>
 <xmx:sv-iZcmbkrd-8h6WVyzgLuYMVrJSrSpY-zcNPxuTtdGtTbTIq2pWJg>
 <xmx:s_-iZacQc1_Gd2BbhFk5peU040hxCN9EBvQFOgT0dQGMwTB2R1T8cg>
Feedback-ID: id9014242:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat,
 13 Jan 2024 16:25:05 -0500 (EST)
References: <20240107212122.21810-1-ian@HIDDEN> <87zfxg8a1s.fsf@HIDDEN>
User-agent: mu4e 1.10.8; emacs 29.1
From: Ian Eure <ian@HIDDEN>
To: Mathieu Othacehe <othacehe@HIDDEN>
Subject: Re: [bug#68309] [PATCH] gnu: Add powertop-service-type.
Date: Sat, 13 Jan 2024 13:23:56 -0800
In-reply-to: <87zfxg8a1s.fsf@HIDDEN>
Message-ID: <87y1ctorin.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 68309
Cc: Simon Tournier <zimon.toutoune@HIDDEN>,
 Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>,
 Tobias Geerinckx-Rice <me@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>,
 Raghav Gururajan <rg@HIDDEN>, 68309 <at> debbugs.gnu.org,
 jgart <jgart@HIDDEN>, Christopher Baines <guix@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


Mathieu Othacehe <othacehe@HIDDEN> writes:

> Hello,
>
> Looks good,
>
>> diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
>> index 0fe64bacf3..c53d8f82bd 100644
>> --- a/gnu/packages/linux.scm
>> +++ b/gnu/packages/linux.scm
>> @@ -3634,7 +3634,7 @@ (define-public powertop
>>      (inputs
>>       (list kmod libnl ncurses pciutils zlib))
>>      (home-page "https://01.org/powertop/")
>> -    (synopsis "Analyze power consumption on Intel-based=20
>> laptops")
>> +    (synopsis "Analyze power consumption on x86-based=20
>> laptops")
>
> This should be part of a separate commit.
>

Okay, I=E2=80=99ll send a patch series in a bit.  I was hoping it could be=
=20
one commit, because it=E2=80=99s related, and sending a patch series is=20
very annoying.


>> +                 (zero? (system* #$(file-append powertop=20
>> "/sbin/powertop")
>> +                                 "--auto-tune"))))))))
>
> If the laptop booted with power cord plugged, but then goes on=20
> battery,
> does this need to be run again?
>

No, the settings persist across power plug/unplug events.




Information forwarded to guix-patches@HIDDEN:
bug#68309; Package guix-patches. Full text available.

Message received at 68309 <at> debbugs.gnu.org:


Received: (at 68309) by debbugs.gnu.org; 8 Jan 2024 09:11:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 08 04:11:16 2024
Received: from localhost ([127.0.0.1]:35188 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rMlfA-0003Pw-Ax
	for submit <at> debbugs.gnu.org; Mon, 08 Jan 2024 04:11:16 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:40038)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <othacehe@HIDDEN>) id 1rMlf9-0003Pj-4Z
 for 68309 <at> debbugs.gnu.org; Mon, 08 Jan 2024 04:11:15 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <othacehe@HIDDEN>)
 id 1rMlet-00070L-DZ; Mon, 08 Jan 2024 04:11:02 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=5cbRmk45qgg7woOJF2QoCzUpOlzulvhzUtclsHIKxCs=; b=MSUsiGZzKMK00xpr7FmX
 zJ2ZRwZTTR77t+FAkYnJMdyph0kvNKPlCFv1utCPxxADhIcJqmeAmtWws1oskRvNNBKkC1ACK5cFk
 PsqOPsnmI9EdeVDTs910gzJDBktc+8izeRx3jSmaOnXluBv2Pw5GjJANpKQgVGOKNNa+cvjuuSQS4
 O6hJVIyV8KMXIsgBew6wCGQvyhEioSxxz0zJEDCUJknrUgvMD7b6YbNOotmHBRq2w3ncBkQfPQtE2
 0oLNaK/U/nGgW9aOPJ4Q4AyKqmaDivAeqRa+HzXuy2BgJQcnwf5c3QmeSS3ebz6wWlPvuH41h4m3u
 qvb/ACTCCyupNQ==;
From: Mathieu Othacehe <othacehe@HIDDEN>
To: Ian Eure <ian@HIDDEN>
Subject: Re: [bug#68309] [PATCH] gnu: Add powertop-service-type.
In-Reply-To: <20240107212122.21810-1-ian@HIDDEN> (Ian Eure's message of
 "Sun, 7 Jan 2024 13:21:21 -0800")
References: <20240107212122.21810-1-ian@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
Date: Mon, 08 Jan 2024 10:10:55 +0100
Message-ID: <87zfxg8a1s.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68309
Cc: Simon Tournier <zimon.toutoune@HIDDEN>,
 Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>,
 Tobias Geerinckx-Rice <me@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>,
 Raghav Gururajan <rg@HIDDEN>, 68309 <at> debbugs.gnu.org,
 jgart <jgart@HIDDEN>, Christopher Baines <guix@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)


Hello,

Looks good,

> diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
> index 0fe64bacf3..c53d8f82bd 100644
> --- a/gnu/packages/linux.scm
> +++ b/gnu/packages/linux.scm
> @@ -3634,7 +3634,7 @@ (define-public powertop
>      (inputs
>       (list kmod libnl ncurses pciutils zlib))
>      (home-page "https://01.org/powertop/")
> -    (synopsis "Analyze power consumption on Intel-based laptops")
> +    (synopsis "Analyze power consumption on x86-based laptops")

This should be part of a separate commit.

> +                 (zero? (system* #$(file-append powertop "/sbin/powertop")
> +                                 "--auto-tune"))))))))

If the laptop booted with power cord plugged, but then goes on battery,
does this need to be run again?

Thanks,

Mathieu




Information forwarded to guix-patches@HIDDEN:
bug#68309; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 7 Jan 2024 21:22:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 07 16:22:03 2024
Received: from localhost ([127.0.0.1]:34031 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rMaao-0004sL-VS
	for submit <at> debbugs.gnu.org; Sun, 07 Jan 2024 16:22:03 -0500
Received: from lists.gnu.org ([2001:470:142::17]:38210)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ian@HIDDEN>) id 1rMaan-0004rs-Bo
 for submit <at> debbugs.gnu.org; Sun, 07 Jan 2024 16:22:01 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ian@HIDDEN>) id 1rMaac-0002iV-9Z
 for guix-patches@HIDDEN; Sun, 07 Jan 2024 16:21:50 -0500
Received: from out1-smtp.messagingengine.com ([66.111.4.25])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ian@HIDDEN>) id 1rMaaa-0000Xh-25
 for guix-patches@HIDDEN; Sun, 07 Jan 2024 16:21:50 -0500
Received: from compute6.internal (compute6.nyi.internal [10.202.2.47])
 by mailout.nyi.internal (Postfix) with ESMTP id 38DF65C122F;
 Sun,  7 Jan 2024 16:21:45 -0500 (EST)
Received: from mailfrontend1 ([10.202.2.162])
 by compute6.internal (MEProxy); Sun, 07 Jan 2024 16:21:45 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=retrospec.tv; h=
 cc:cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:message-id:mime-version:reply-to
 :subject:subject:to:to; s=fm1; t=1704662505; x=1704748905; bh=Lk
 BAkNAoPU8qGkNgRcp5oABL3L3fpCu+Zc7z3MxBMrw=; b=SYg+tPkHKkAJ+FWOYE
 WPB+A3bWsOAUQMEQ6SksK0FN7qeRU8xCpakhaAPc8tfpqyt96hP2XXtc6pPFj1Sk
 yjsG5Yp1pG4W2eJfnJGgg3aBFW/irb19sKF7Y0t3LBUhst06x2iAssBLS/yOPplm
 1+Y8u5ZYFAuJbOBMgX6ivpFJDq0Kbosmc8OBNYXjPSt9egGJqyqHJkPtUs8AIL3+
 gSVm/CA0t/nGfQNMT4nybxTh/1/+HuwPMLZ1J0sFIjCEVbMkNMP6g1CPn1r8I/wU
 x3NsJuGYW3VCXtaFSVWIMKCBRWPxG0KIjbBfPVITzJmRKDChhQ+RsIUFOZe/Ql59
 jEUA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:message-id:mime-version:reply-to:subject
 :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
 :x-sasl-enc; s=fm2; t=1704662505; x=1704748905; bh=LkBAkNAoPU8qG
 kNgRcp5oABL3L3fpCu+Zc7z3MxBMrw=; b=xnKkGtsQnVkLeeBrdTgGMy6iBz67y
 PTqV65eF8SIej/THu+zgqHojkCiM0jIqbk3JfI8IrLdVPA17+nyeBOE+Xq1uY0y/
 Ku5+fRwdcuz/LY/Z2EkH2skWh2XLgqMiUHvpSV6ovpkpw1G3hW+abn1Ajy4p0O0X
 v29uUK5TnJiWHaFQ3bSZIEDliuk3trZ/gyV0wq7zNVbh0QIOtB+NlydjUMlcc04w
 /Z6Zm+PnRfqhgHmkQmKU4+7JaSL27mBRxk3fAv4fxPgQWIfS4N0MM/lVlBQ8QnC9
 HR6oLS/YWrBYpYNyuE1R3u3FpAGtDBRrdHV1XpRYO0sA4i4D59xaruH2A==
X-ME-Sender: <xms:6RWbZdOn-KyUEkPYE7gL3Z2zS1l5evXY_xuXscivFdDPtSr4F7wMMA>
 <xme:6RWbZf8iIQXmcXT8NqbslIS_zJxBmvdwLA4oWYJI8yMk2SXaYZOBfbipqnWikORC_
 C__i7C1so1nHjXsiQ>
X-ME-Received: <xmr:6RWbZcRYAVHpPyQ5xOkerfSXybLXNwW0Tj1RaMy-TldlpGd1T6zBBXBRtpBWefGTfmgXQx5ZuDKFum5zQok_8ieO-_0WGxuNInlS12l42A3g5tQ_nw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdehgedgkeejucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffogggtgfesthekre
 dtredtjeenucfhrhhomhepkfgrnhcugfhurhgvuceoihgrnhesrhgvthhrohhsphgvtgdr
 thhvqeenucggtffrrghtthgvrhhnpeelhffgteelveejjeelffekhfehgfehtdefgfduvd
 duieffjedugedvhfevjeetteenucffohhmrghinheptddurdhorhhgpdhgnhhurdhorhhg
 necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihgrnh
 esrhgvthhrohhsphgvtgdrthhv
X-ME-Proxy: <xmx:6RWbZZtP5sSWkAJVQ8bZOhtXLR0gwgxOWj0dqwUdbaP3PorWY4_N1Q>
 <xmx:6RWbZVfrvMrYvrbRcMcqasQ4J6FfjSWt5mCnV-ruhBrzf2YWTRqcCw>
 <xmx:6RWbZV36-vQGeAPSaCMN3_Zeo2xBJjl9dD19gxvTs_S50WHjMCqsYg>
 <xmx:6RWbZVlK7_9XPHaeZNVn4-l4AT14BMGZd7SdO5TybZMusXOVBoibGA>
Feedback-ID: id9014242:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun,
 7 Jan 2024 16:21:44 -0500 (EST)
From: Ian Eure <ian@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] gnu: Add powertop-service-type.
Date: Sun,  7 Jan 2024 13:21:21 -0800
Message-ID: <20240107212122.21810-1-ian@HIDDEN>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
X-Debbugs-Cc: ( <paren@HIDDEN>, Christopher Baines <guix@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Raghav Gururajan <rg@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, jgart <jgart@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=66.111.4.25; envelope-from=ian@HIDDEN;
 helo=out1-smtp.messagingengine.com
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01,
 SPF_HELO_PASS=-0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.6 (/)
X-Debbugs-Envelope-To: submit
Cc: Ian Eure <ian@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.4 (/)

* gnu/services/pm.scm (powertop-shepherd-service): New variable.
* gnu/services/pm.scm (powertop-service-type): New variable.
* gnu/services/pm.scm (powertop-configuration): New variable.
* gnu/packages/linux.scm (powertop): Correct package description.
* doc/guix.texi (Power Management Services): Document powertop-service-type.

Change-Id: I1c5ef855526458ad54f62ca6e755da82acce1c4a
---
 doc/guix.texi          | 24 +++++++++++++++++++++++
 gnu/packages/linux.scm |  2 +-
 gnu/services/pm.scm    | 43 +++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 67 insertions(+), 2 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index a648a106b3..e95ae140f2 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -34755,6 +34755,30 @@ Ignore cpuid check for supported CPU models.
 @item @code{thermald} (default: @var{thermald})
 Package object of thermald.
 
+@cindex powertop
+@cindex Power tuning with PowerTOP
+@subsubheading PowerTOP
+
+The @code{(gnu services pm)} module provides a Guix service definition
+for PowerTOP.  When started, it tunes kernel settings to reduce power
+consumption.
+
+@defvar powertop-service-type
+The service type for PowerTOP.  No configuration is necessary.  When the
+service starts, it executes @code{powertop --auto-tune}.
+
+@lisp
+(service powertop-service-type)
+
+@end defvar
+
+Available @code{powertop-configuration} fields are:
+
+@deftypevr {@code{powertop-configuration} parameter} package powertop
+The PowerTOP package.  Defaults to @code{powertop}.
+
+@end deftypevr
+
 @end table
 @end deftp
 
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 0fe64bacf3..c53d8f82bd 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -3634,7 +3634,7 @@ (define-public powertop
     (inputs
      (list kmod libnl ncurses pciutils zlib))
     (home-page "https://01.org/powertop/")
-    (synopsis "Analyze power consumption on Intel-based laptops")
+    (synopsis "Analyze power consumption on x86-based laptops")
     (description
      "PowerTOP is a Linux tool to diagnose issues with power consumption and
 power management.  In addition to being a diagnostic tool, PowerTOP also has
diff --git a/gnu/services/pm.scm b/gnu/services/pm.scm
index 3daf484cc1..13a153ab1d 100644
--- a/gnu/services/pm.scm
+++ b/gnu/services/pm.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@HIDDEN>
+;;; Copyright © 2024 Ian Eure <ian@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -17,6 +18,8 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu services pm)
+  #:use-module (srfi srfi-1)
+  #:use-module (ice-9 match)
   #:use-module (guix gexp)
   #:use-module (guix packages)
   #:use-module (guix records)
@@ -31,7 +34,10 @@ (define-module (gnu services pm)
             tlp-configuration
 
             thermald-configuration
-            thermald-service-type))
+            thermald-service-type
+
+            powertop-configuration
+            powertop-service-type))
 
 (define (uglify-field-name field-name)
   (let ((str (symbol->string field-name)))
@@ -466,3 +472,38 @@ (define thermald-service-type
    (default-value (thermald-configuration))
    (description "Run thermald, a CPU frequency scaling service that helps
 prevent overheating.")))
+
+
+
+;;;
+;;; powertop
+;;;
+;;; Calls `powertop --auto-tune' to reduce energy consumption.
+
+
+
+(define-configuration powertop-configuration
+  (powertop (package powertop) "PowerTOP package to use."))
+
+(define powertop-shepherd-service
+  (match-lambda
+    (($ <powertop-configuration> powertop)
+     (shepherd-service
+      (documentation "Tune kernel power settings at boot.")
+      (provision '(powertop powertop-auto-tune))
+      (requirement '(user-processes))
+      (one-shot? #t)
+      (start #~(lambda _
+                 (zero? (system* #$(file-append powertop "/sbin/powertop")
+                                 "--auto-tune"))))))))
+
+(define powertop-service-type
+  (service-type
+   (name 'powertop)
+   (extensions
+    (list
+     (service-extension shepherd-root-service-type
+                        (compose list powertop-shepherd-service))))
+   (compose concatenate)
+   (default-value (powertop-configuration))
+   (description "Tune power-related kernel parameters to reduce energy consumption.")))
-- 
2.41.0





Acknowledgement sent to Ian Eure <ian@HIDDEN>:
New bug report received and forwarded. Copy sent to , guix-patches@HIDDEN. Full text available.
Report forwarded to , guix-patches@HIDDEN:
bug#68309; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 20 Jan 2024 12:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.