Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp319283lqs; Thu, 13 Jun 2024 10:52:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWYjmELOPRQOBUDhNQKL2eUa9uKi21yobSR+EwbNAOpXF8FdC6xOxKh1LK8f5896mn8Dyn/3/GRYZPmyAs3EHpZhKxotguocXx89Et+tA== X-Google-Smtp-Source: AGHT+IGj8zIyNukFSbm8F/yuDB1Du0ts8miy92hLdpwgBpcNyPvPOHyK3FSgCM5o6MvUt4Wcpchi X-Received: by 2002:a17:903:1246:b0:1f3:f5c:cd80 with SMTP id d9443c01a7336-1f8625ceeabmr4435145ad.5.1718301175512; Thu, 13 Jun 2024 10:52:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718301175; cv=pass; d=google.com; s=arc-20160816; b=SQB2M6zCEG7Z3dHibZGJt8UHMKLRwdCWXPoZbi7m3w1k4hJVVh2jOkCrhDhCBj1oee evO2/zkET1ZAie8O/NXAPCmEcTNS6VgSCF4LXs3MMszFuKFoW7TWGmxW3aZ34CBAnn3d kcEDWtHQxErPcM3QNCIqoRG4wDKnKjEo/4DIrluEfZlyxVcwD8FDPoKSqeJyp3iAYrhG 1buwoo8FCRqnfolzNhjonfEM5kji6kWj6DJOKoc9ARvuAet8zjpaN87LUswFYzoL5kIq fcB+EOfnXx8RqV3qe01+CdOai5aaStd7jspBfJKc4+8SjZoAVTxskplnP6TtSE+aGoA0 IdDg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:message-id:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:date :from:dkim-signature; bh=mg5kuhNg6apmOphycfBoA2Z8Kjn9MT4/U+x5+QgaktU=; fh=Wuc5Tb/iDdjwwKR0yToLDOoPY5ceD1ADfIXtLYKq9m8=; b=HVyLTvJGf2TAGf2YwyC2ag1oGiYiNWSYctWEGiG2aExcF5GlKssM4l5zPeLDNy9NWw YHzdrxFPPNU1WsxcHDunySZm6yHqkOGXBJMEvGYriTcXVIdEemSu9PwDGMxtzKh9FNat 8LVwD7Vr56HSV9N3wZEko5dFWNI+T3Z3w8WXrIkQDR14a4iGNz8S6/iRWdOR1+8YdJji 7yz9oNA+y/lQl7O5p66V6GaIGBq5qeS3ritE+L5tmtw2m4UT1XnHZH3Z0+Ofk18zpWjc 9CQCQo0PRJXDzlRBuTYQg8hM+OvIRWphssn8h7yPm02iVq1ErzkeYJTFdphjrmv/cmwE PzTA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=H5xNKWzj; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-213773-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213773-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f855ecac70si3810915ad.308.2024.06.13.10.52.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 10:52:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213773-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=H5xNKWzj; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-213773-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213773-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 1544F2836DC for ; Thu, 13 Jun 2024 17:52:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C9B6714A4EC; Thu, 13 Jun 2024 17:52:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="H5xNKWzj" Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2AD076F06A; Thu, 13 Jun 2024 17:52:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718301150; cv=none; b=IxjmTARYTrEzYavpFQ5MTOHhEf26kqs4H9qa+fd8OzUBdmgFN2XMVMpgtN9GF3/Vg86IsScAbzA3TcAoMNPOHkiShi4CRgBON/eJ1MsHB5Et4DUcs2yTwI+umkH/fT9xpbn+SoHhAnfvBOpN1lAbabQHauAvRXaIHLaTZnWDweM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718301150; c=relaxed/simple; bh=KOe894IYHoviRuHhq9DyO9T0+zIpKC3zQvcDURDDzTY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=YOiTu4bi+TVJTchAkd5RvHaaR6DHzh/rCi+0MTk5CMnGSHHWwneuCtd9//c+a4pkq6mdMzvApDbqT56nfcHR+Fm1jLkyuyRw5k761c++qh5BUSLC048HeT6J2dMgVAWgf1UV2JhotOwdS5uOnheG96obkdJAwcLs0gqQ6udD7JY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=H5xNKWzj; arc=none smtp.client-ip=209.85.218.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a68b41ef3f6so167035166b.1; Thu, 13 Jun 2024 10:52:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718301147; x=1718905947; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=mg5kuhNg6apmOphycfBoA2Z8Kjn9MT4/U+x5+QgaktU=; b=H5xNKWzjWXeWp7yjYp69rBNLPTHEJRPT4rbieKhLMJ3vLPNstZAK+DgQnVEG347XV+ lI5rfzKSxiOAgB8yDQkeFEBUvtGBne7YxKOvWjoKwYi+ODiyflknMMa1o1UUDLA3T9aI waFQM+fzyifZbO3iUZmgB3QK/CqWS9FGKtc4Dso1dwW/9xLpHo0rsA3J0TsgE0pQBQSt bTnyflVrjBlFv1I4PHxEuYYr1v3KbSE0ZpJossTw3Ojd4N+Gnzk1yxk5iMEh346B3aCY IVaZwjBDev6bIGrUca+Rdb49kqyfiyftDbtsXnV63QLTT4zMQBp8Fh5QMuejAekxWA3Q 0Zcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718301147; x=1718905947; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mg5kuhNg6apmOphycfBoA2Z8Kjn9MT4/U+x5+QgaktU=; b=Ysfd6xQsYUK++wW5T7GCymCHxERoKht6+QcNbNELrL8YTAKPRf5G9gqIMHC6o4m1sH c/6oQN1RMbdj7DtHBt8Vz5u7LlQUhQd28PGcrSU7dJRNnwLeTRLEEciBkeZyKx1KKD8P sSOyuEw000pExECzrvSY8tRTqZqgepgsGjqMoKpjPZjkrORlzlGKzYGO306b1jmO642Q ybz0+4DsMe0HT0r5xkBaJY/B1Zs1EgcTR8OguaN265lhhN699x2RgOkHuXQGRFJr4gwB QfGz62thtaX+9qUC+hrvrq877cpmGrgK8DcKxnd3SGqorI+CDfoDwA/2RtNbXyMudXDr 1f0Q== X-Forwarded-Encrypted: i=1; AJvYcCU8k7YAZNEVWHPFKeR08ioLweeJnYXvCsl27NNF1d30bCNLGCdKnF7uzBRQDshTSKyFPsCuXrr7YLAiRGcKpBOEZVT9H8qHGh8X5s4l X-Gm-Message-State: AOJu0YztxD1OEZaJ1jt09bgaozx3N9WeWAA7J+LY/VlTV1BmVb3q0pb2 Q8HTSZSxclrHoKtC83XyESFz2vf7TOXtLGG2FhTV3QQt0XD1/ZkF X-Received: by 2002:a17:906:2c02:b0:a6f:24fe:f2a7 with SMTP id a640c23a62f3a-a6f60cf1dcbmr36668966b.10.1718301147252; Thu, 13 Jun 2024 10:52:27 -0700 (PDT) Received: from [127.0.1.1] (31-179-0-202.dynamic.chello.pl. [31.179.0.202]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f56db6201sm93956566b.80.2024.06.13.10.52.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 10:52:26 -0700 (PDT) From: Roman Storozhenko Date: Thu, 13 Jun 2024 19:52:10 +0200 Subject: [PATCH] Improve cpupower utility build process description Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240613-fix-cpupower-doc-v1-1-9dcdee263af1@gmail.com> X-B4-Tracking: v=1; b=H4sIAMkxa2YC/x2MywqAIBAAfyX23IJWCvYr0SF0rb2oKD0g/Pek4 8DMvFAoMxWYuxcyXVw4hgay78AeW9gJ2TWGQQyT0HJEzw/adKZ4U0YXLRpvRq2cVFZqaFnK1Jx /uay1fjv1JEhiAAAA To: Thomas Renninger , Shuah Khan , Javier Carrasco Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Roman Storozhenko X-Mailer: b4 0.13.0 Describe more precisely build and install 'make' processes for the default and the user defined directories. Show how to run the utility from the custom installation directory. Signed-off-by: Roman Storozhenko --- Enhance cpupower build process description with the information on building and installing the utility to the user defined directories as well as with the information on the way of running the utility from the custom defined installation directory. This description is based on my experiments with building the utility and each newly described step has been tested. --- tools/power/cpupower/README | 133 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 123 insertions(+), 10 deletions(-) diff --git a/tools/power/cpupower/README b/tools/power/cpupower/README index 1c68f47663b2..ec0d5551ae96 100644 --- a/tools/power/cpupower/README +++ b/tools/power/cpupower/README @@ -22,16 +22,129 @@ interfaces [depending on configuration, see below]. compilation and installation ---------------------------- -make -su -make install - -should suffice on most systems. It builds libcpupower to put in -/usr/lib; cpupower, cpufreq-bench_plot.sh to put in /usr/bin; and -cpufreq-bench to put in /usr/sbin. If you want to set up the paths -differently and/or want to configure the package to your specific -needs, you need to open "Makefile" with an editor of your choice and -edit the block marked CONFIGURATION. +There are 2 output directories - one for the build output and another for +the installation of the build results, that is the utility, library, man pages, +etc... + +default directory +----------------- + +In the case of default directory, build and install process requires no +additional parameters: + +build +----- + +The output directory for the 'make' command is the current directory and its +subdirs in the kernel tree: +tools/power/cpupower + +$ make + +install +------- + +'make install' command puts targets to default system dirs: +libcpupower to /usr/lib +cpupower, cpufreq-bench_plot.sh to /usr/bin +cpufreq-bench to /usr/sbin +man pages to /usr/man + +$ sudo make install + +To put it in other words it makes build results available system-wide, enabling +any user to simply start using it without any additional steps + +custom directory +---------------- + +There are 2 make's command-line variables 'O' and 'DESTDIR' that setup +appropriate dirs: +'O' - build directory +'DESTDIR' - installation directory. This variable could also be setup in +the 'CONFIGURATION' block of the "Makefile" + +build +----- + +$ make O= + +Example: +$ make O=/home/hedin/prj/cpupower/build + +install +------- + +$ make O= DESTDIR= + +Example: +$ make O=/home/hedin/prj/cpupower/build DESTDIR=/home/hedin/prj/cpupower install + +Notice that both variables 'O' and 'DESTDIR' have been provided. The reason is +that the build results are saved in the custom output dir defined by 'O' +variable. So, this dir is the source for the installation step. If only 'DESTDIR' +were provided then the 'install' target would assume that the build directory is +the current one, build everything there and install from the current dir. + + +clean and uninstall (default directory) +--------------------------------------- + +'clean' target is intended for cleanup the build catalog from build results +'uninstall' target is intended for removing installed files from the installation +catalog + +default directory +----------------- + +This case is a straightforward one: +$ make clean +$ make uninstall + +custom directory +---------------- + +Use 'O' command line variable to remove previously built files from the build +dir: + +$ make O= clean + +Example: +$ make O=/home/hedin/prj/cpupower/build clean + +Use 'DESTDIR' command line variable to uninstall previously installed files from +the given dir: + +$ make DESTDIR= + +Example: +make DESTDIR=/home/hedin/prj/cpupower uninstall + + +running the tool +---------------- + +default directory +----------------- + +$ sudo cpupower + +custom directory +---------------- + +When it comes to run the utility from the custom build catalog things become a +little bit complicated as 'just run' approach doesn't work. +Assuming that the current dir is '/usr', issuing +the following command: + +$ sudo ./bin/cpupower +will produce the following error output: +./bin/cpupower: error while loading shared libraries: libcpupower.so.1: cannot +open shared object file: No such file or directory + +The issue is that binary cannot find the 'libcpupower' library. So, we shall +point to the lib dir: +sudo LD_LIBRARY_PATH=lib64/ ./bin/cpupower THANKS --- base-commit: 6906a84c482f098d31486df8dc98cead21cce2d0 change-id: 20240613-fix-cpupower-doc-9f9365d15c16 Best regards, -- Roman Storozhenko