From patchwork Wed Sep 4 22:02:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 825796 Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) (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 78AD913A869 for ; Wed, 4 Sep 2024 22:02:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725487330; cv=none; b=cw7yIpukLG2tu+FMw6L9ZY/bXeTXrE0W2+gviI/Uv97QTaOs6I8Y4jQhqSs2G9EiSxoBLyWjzHmq/sxEs3BfzLqTnILWiJNzlBBE5ZcCQ0/kegfT99vEUXMX3VK7aOoBKyFxMhqtlUrtWgJhEyLOyAr5V3y2ndN6WkLZjZ1mM7Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725487330; c=relaxed/simple; bh=mfP2MugdJrOVES2m26Q+kF/3uOuj6ILICQIOU4++hZA=; h=Content-Type:Message-ID:Date:MIME-Version:To:Cc:From:Subject; b=Qvel5OMhhoZDysxtCR6DXdJYrD6Oab5LOcXEIqZS+mn+Nlp8u/ON0W2muw4AVTOeixbWYYTaMGJop7seL85LH+mO2SW5uAqE9Jke1ez+GSyKncHV40k7bPeptliWcwRhWo+NTuAercJMtWC55YUcoomhkWf0gNG2fd0w+zhtIPo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ATDnluL3; arc=none smtp.client-ip=209.85.166.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ATDnluL3" Received: by mail-io1-f53.google.com with SMTP id ca18e2360f4ac-82a205810ccso2030039f.2 for ; Wed, 04 Sep 2024 15:02:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1725487327; x=1726092127; darn=vger.kernel.org; h=subject:from:cc:to:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=A7fWh6Nr535svbXE8LjWgX0vFySt81kemsy1ZoWE5KQ=; b=ATDnluL3w8jg7PV7V4agqmU+XAe3fkwG+66BryH/V2xBtlsKEykhx+4WvGViuHTtvA W7ert9lOd802k7k6orgmRta9hmw0f6z5K3W4avPv2ulXKiBPAOWrA3Tj2NCqiXRPBpMV jxQIxX4rwhwA+HBAW3UYvpjG+IRmP00obRVTc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725487327; x=1726092127; h=subject:from:cc:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=A7fWh6Nr535svbXE8LjWgX0vFySt81kemsy1ZoWE5KQ=; b=DyKIPJglW/Gbd796m22JGt9sgnipMFcprJ/1FphHX86XgbWF1n7ze9wSo/kwbxDnY1 wn8f+bGruBcPGRmIXe3zP94jKVEp2k1Z8my32XiXcxgYcenZLJlpEDnrRQM+3tG7b1Nm 2l7ct9gQ7yaF4vdzcLQPqHVpayo/cOhEQil8Ag1Cefgz7/Vy+zifBrOAi+Lq4EKkInJz g0pOXb8phYqiqUYBkFIi+mTnFFqCHhUirub9eYHAbsXusx+7IR0cm6OoFpUOdcoIrjUg htVCTvyCxx7Jk36N/VhyK6F11KuOqgfSyLbr5f1iCZzBp7Rhg7Va7N89IDBuVpg2onH7 wczA== X-Forwarded-Encrypted: i=1; AJvYcCVui4xkM8c2m9XgOgo68kFH/NW4DDxj085OuB6/9G4bK4zF20OLdJaZqBaAl8wFbguqwkOKdsVhSA==@vger.kernel.org X-Gm-Message-State: AOJu0Yyi/ssPcBTrbWnl6pl85z5EEOyqtyn1irMmnXsu+Vrlb/0MJNhF yhotY4UDAGfJWOunCs2GoutM1fChIxPZSECk+w/GJ9zfZfizmc0TemQu2iK02o4= X-Google-Smtp-Source: AGHT+IExA2/nC/kqatN5O9Jm1D0CL+IoUAf1shwfQkUHmNXOLmUB9Waz4VdhSGlmlSlaN8UhNkTFWg== X-Received: by 2002:a05:6602:6410:b0:82a:2053:e715 with SMTP id ca18e2360f4ac-82a36f448c5mr1755806339f.14.1725487327445; Wed, 04 Sep 2024 15:02:07 -0700 (PDT) Received: from [192.168.1.128] ([38.175.170.29]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ced2e17177sm3269449173.78.2024.09.04.15.02.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Sep 2024 15:02:07 -0700 (PDT) Message-ID: Date: Wed, 4 Sep 2024 16:02:06 -0600 Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: "Rafael J. Wysocki" Cc: shuah , Shuah Khan , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Renninger , Thomas Renninger From: Shuah Khan Subject: [GIT PULL] cpupower update for Linux 6.12-rc1 Hi Rafael, Please pull the following cpupower update for Linux 6.12-rc1. This cpupower update for Linux 6.12-rc1 consists of an enhancement to cpuidle tool to display the residency value of cpuidle states. This addition provides a clearer and more detailed view of idle state information when using cpuidle-info. diff is attached. thanks, -- Shuah ---------------------------------------------------------------- The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b: Linux 6.11-rc1 (2024-07-28 14:19:55 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux tags/linux-cpupower-6.12-rc1 for you to fetch changes up to 76fb981ad6774b82f06703c896b492c8659b543b: tools/cpupower: display residency value in idle-info (2024-08-09 10:32:33 -0600) ---------------------------------------------------------------- linux-cpupower-6.12-rc1 This cpupower update for Linux 6.12-rc1 consists of an enhancement to cpuidle tool to display the residency value of cpuidle states. This addition provides a clearer and more detailed view of idle state information when using cpuidle-info. ---------------------------------------------------------------- Aboorva Devarajan (1): tools/cpupower: display residency value in idle-info tools/power/cpupower/lib/cpuidle.c | 8 ++++++++ tools/power/cpupower/lib/cpuidle.h | 2 ++ tools/power/cpupower/utils/cpuidle-info.c | 4 ++++ 3 files changed, 14 insertions(+) ---------------------------------------------------------------- diff --git a/tools/power/cpupower/lib/cpuidle.c b/tools/power/cpupower/lib/cpuidle.c index 479c5971aa6d..0ecac009273c 100644 --- a/tools/power/cpupower/lib/cpuidle.c +++ b/tools/power/cpupower/lib/cpuidle.c @@ -116,6 +116,7 @@ enum idlestate_value { IDLESTATE_USAGE, IDLESTATE_POWER, IDLESTATE_LATENCY, + IDLESTATE_RESIDENCY, IDLESTATE_TIME, IDLESTATE_DISABLE, MAX_IDLESTATE_VALUE_FILES @@ -125,6 +126,7 @@ static const char *idlestate_value_files[MAX_IDLESTATE_VALUE_FILES] = { [IDLESTATE_USAGE] = "usage", [IDLESTATE_POWER] = "power", [IDLESTATE_LATENCY] = "latency", + [IDLESTATE_RESIDENCY] = "residency", [IDLESTATE_TIME] = "time", [IDLESTATE_DISABLE] = "disable", }; @@ -254,6 +256,12 @@ unsigned long cpuidle_state_latency(unsigned int cpu, return cpuidle_state_get_one_value(cpu, idlestate, IDLESTATE_LATENCY); } +unsigned long cpuidle_state_residency(unsigned int cpu, + unsigned int idlestate) +{ + return cpuidle_state_get_one_value(cpu, idlestate, IDLESTATE_RESIDENCY); +} + unsigned long cpuidle_state_usage(unsigned int cpu, unsigned int idlestate) { diff --git a/tools/power/cpupower/lib/cpuidle.h b/tools/power/cpupower/lib/cpuidle.h index 2e10fead2e1e..2ab404d40259 100644 --- a/tools/power/cpupower/lib/cpuidle.h +++ b/tools/power/cpupower/lib/cpuidle.h @@ -8,6 +8,8 @@ int cpuidle_state_disable(unsigned int cpu, unsigned int idlestate, unsigned int disable); unsigned long cpuidle_state_latency(unsigned int cpu, unsigned int idlestate); +unsigned long cpuidle_state_residency(unsigned int cpu, + unsigned int idlestate); unsigned long cpuidle_state_usage(unsigned int cpu, unsigned int idlestate); unsigned long long cpuidle_state_time(unsigned int cpu, diff --git a/tools/power/cpupower/utils/cpuidle-info.c b/tools/power/cpupower/utils/cpuidle-info.c index 44126a87fa7a..e0d17f0de3fe 100644 --- a/tools/power/cpupower/utils/cpuidle-info.c +++ b/tools/power/cpupower/utils/cpuidle-info.c @@ -64,6 +64,8 @@ static void cpuidle_cpu_output(unsigned int cpu, int verbose) printf(_("Latency: %lu\n"), cpuidle_state_latency(cpu, idlestate)); + printf(_("Residency: %lu\n"), + cpuidle_state_residency(cpu, idlestate)); printf(_("Usage: %lu\n"), cpuidle_state_usage(cpu, idlestate)); printf(_("Duration: %llu\n"), @@ -115,6 +117,8 @@ static void proc_cpuidle_cpu_output(unsigned int cpu) printf(_("promotion[--] demotion[--] ")); printf(_("latency[%03lu] "), cpuidle_state_latency(cpu, cstate)); + printf(_("residency[%05lu] "), + cpuidle_state_residency(cpu, cstate)); printf(_("usage[%08lu] "), cpuidle_state_usage(cpu, cstate)); printf(_("duration[%020Lu] \n"),