summaryrefslogtreecommitdiff
path: root/kde-plasma/ksystemstats
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-06-30 19:43:35 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-06-30 19:43:35 +0100
commitb7efdd771aad99c9a6509a5f85a80a1f7cfd55f3 (patch)
tree02f9d01894c5e75c1d01e1c85038384cb6d1da64 /kde-plasma/ksystemstats
parente2e7cc7d880b593b2bc94bf648dff853c97225f2 (diff)
gentoo auto-resync : 30:06:2023 - 19:43:35
Diffstat (limited to 'kde-plasma/ksystemstats')
-rw-r--r--kde-plasma/ksystemstats/Manifest3
-rw-r--r--kde-plasma/ksystemstats/files/ksystemstats-5.27.6-nvidia-data-fields.patch131
-rw-r--r--kde-plasma/ksystemstats/ksystemstats-5.27.6-r1.ebuild (renamed from kde-plasma/ksystemstats/ksystemstats-5.27.6.ebuild)5
3 files changed, 137 insertions, 2 deletions
diff --git a/kde-plasma/ksystemstats/Manifest b/kde-plasma/ksystemstats/Manifest
index b2839948c350..46550901a899 100644
--- a/kde-plasma/ksystemstats/Manifest
+++ b/kde-plasma/ksystemstats/Manifest
@@ -1,5 +1,6 @@
+AUX ksystemstats-5.27.6-nvidia-data-fields.patch 5633 BLAKE2B 2196a5d272c19c8a0d7ef1bb4841c6e1145d227520d98e27c173142ea7d10b5a5ee2a4e9387b8ca136b8cc83c6dca97b5d13442caa3d7dc2524edaeac2cdb588 SHA512 33d4802e51bacc28347d502a18c006c3850419d4b770af580ed95d3826131d34229438d3b30e0f76173bb5519029e51680d1946e8bb5da9d35f721d482419ca4
DIST ksystemstats-5.27.5.tar.xz 115160 BLAKE2B 3e5d205f444cd6fe0ed9a2d9f7fc2215018e37e560e2793faa943ecb97d3f1964b955efdd0d364c055c88d2f5f2c85cc578f1ef663c30f372b713d5d76484d9c SHA512 0db1df8fd0264c6d5b5091b92ae892e74367e6a88b48d909bd79813638df5f9510eae42cb626c46d99f5b7ed66aed8636745aef4e66d49a9e0fa411c6140693e
DIST ksystemstats-5.27.6.tar.xz 116232 BLAKE2B 1b9ef600ac13b9e925d12a9c936fbf06b106c5e203ea1c17da511a9611171a833135d62eedfa2c279c5af25ba920a7b3ca480038d0ebe69b78008de701bf5216 SHA512 1ecaffa1642d8761993606be938efd183dc0de39f8d15cb19fc96871fe6d5de03628e0bf5cffe59bdb32283f66890a7783de04ebc7da4960e3f90104f15bd5ba
EBUILD ksystemstats-5.27.5.ebuild 1060 BLAKE2B a5df67257e58a85155f0d30275fc7b42c5df43142790ca5465cf93cf71e670780429745af332d87772664761b6dca64cf86f269366baefdf6825d6c9ba37c6f9 SHA512 cd399385ea095091f484edc5ec3306401bb5a5ae76a8f8c7c352c31b9d8e1306c7cf6db8b72ef9384597591ad54a7f18a787a4d7e0de7c2d0bce243d3cdc2860
-EBUILD ksystemstats-5.27.6.ebuild 1038 BLAKE2B 96dbe29c14117096eae977dbf64aa8a72cc32b65b4d0c32858220361dfebcea6b0d5acd07d898addc5648cf6fd4d8049ab10ef51f4df72ecb6856d2f7b7a29c1 SHA512 d76d39983785a851ffe1e2808afa71501e456b1ad0983138ef18434aa9257d21982e0f3d1b4c10dfcacc6908c065f0e0b6ae5e0e3a28098ff207088cd6d53847
+EBUILD ksystemstats-5.27.6-r1.ebuild 1172 BLAKE2B 3538d2790d94a84585a8e3707c861a8b02eb29e8c4101f2111de5adc7bc3c1e9a2985c98ab918408dce1ad4caaab4ec1a71dc850c15653c05dc9df226358e0a4 SHA512 4db4ef4e1e31864b835fed6feaa76271e7bdc11e9af2eb9d80cf6ed2d580872007b4504e7ca8fd7db514a2bbb242c32f03a0f67c5e78dd3886e4bd5d5ad0ed3d
MISC metadata.xml 467 BLAKE2B 61ac6047a4cb3d54d26f963b75c94022a501fd1b1b9ee227cce16023fb40b101ba40c6ff99e02c5913137b191bd9c516249387b0310f6558c9800b10f52e780a SHA512 0ad261d9d2e7a45d01b06a15270346bf169a3a8d827b409616e3801e4357910fe196813dd87ff4bea34e61cce3931443d9b617ef532230448f54048d1ed84f4a
diff --git a/kde-plasma/ksystemstats/files/ksystemstats-5.27.6-nvidia-data-fields.patch b/kde-plasma/ksystemstats/files/ksystemstats-5.27.6-nvidia-data-fields.patch
new file mode 100644
index 000000000000..718bbd8c64e2
--- /dev/null
+++ b/kde-plasma/ksystemstats/files/ksystemstats-5.27.6-nvidia-data-fields.patch
@@ -0,0 +1,131 @@
+From 4f7213e6e742b993feeaf300181a67923e60c0f4 Mon Sep 17 00:00:00 2001
+From: David Redondo <kde@david-redondo.de>
+Date: Wed, 10 May 2023 02:26:29 +0000
+Subject: [PATCH] gpu/nvidia: Discover data fields based on headers
+
+This guards us against the appearance of new fields or if they
+ever appear in a different order.
+BUG:470474
+FIXED-IN:5.27.7
+
+(cherry picked from commit 7f9ead6bddfdf6f13a1ea48791f8f5d5c80c6980)
+Because in Qt5 QVector<T>::indexOf only takes T's we have to provide
+our own indexOf here.
+---
+ plugins/gpu/NvidiaSmiProcess.cpp | 56 ++++++++++++++++++++++----------
+ plugins/gpu/NvidiaSmiProcess.h | 14 ++++++++
+ 2 files changed, 53 insertions(+), 17 deletions(-)
+
+diff --git a/plugins/gpu/NvidiaSmiProcess.cpp b/plugins/gpu/NvidiaSmiProcess.cpp
+index 7f8dd62..d92b396 100644
+--- a/plugins/gpu/NvidiaSmiProcess.cpp
++++ b/plugins/gpu/NvidiaSmiProcess.cpp
+@@ -155,19 +155,37 @@ void NvidiaSmiProcess::unref()
+ void NvidiaSmiProcess::readStatisticsData()
+ {
+ while (m_process->canReadLine()) {
+- const QString line = m_process->readLine();
+- if (line.startsWith(QLatin1Char('#'))) {
+- continue;
+- }
++ QString line = m_process->readLine();
+ #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+- const QVector<QStringRef> parts = QStringRef(&line).trimmed().split(QLatin1Char(' '), Qt::SkipEmptyParts);
++ QVector<QStringRef> parts = QStringRef(&line).trimmed().split(QLatin1Char(' '), Qt::SkipEmptyParts);
+ #else
+- const QVector<QStringView> parts = QStringView(line).trimmed().split(QLatin1Char(' '), Qt::SkipEmptyParts);
++ QVector<QStringView> parts = QStringView(line).trimmed().split(QLatin1Char(' '), Qt::SkipEmptyParts);
+ #endif
+-
+- // format at time of writing is
+- // # gpu pwr gtemp mtemp sm mem enc dec mclk pclk fb bar1
+- if (parts.count() != 12) {
++ // Because in Qt5 indexOf of QVector<T> only takes T's, write our own indexOf taking arbitrary types
++ auto indexOf = [](const auto &stack, const auto& needle) {
++ auto it = std::find(stack.cbegin(), stack.cend(), needle);
++ return it != stack.cend() ? std::distance(stack.cbegin(), it) : -1;
++ };
++
++ // discover index of fields in the header format is something like
++ //# gpu pwr gtemp mtemp sm mem enc dec mclk pclk fb bar1
++ // # Idx W C C % % % % MHz MHz MB MB
++ // 0 25 29 - 1 1 0 0 4006 1506 891 22
++ if (line.startsWith(QLatin1Char('#'))) {
++ if (m_dmonIndices.gpu == -1) {
++ // Remove First part because of leading '# ';
++ parts.removeFirst();
++ m_dmonIndices.gpu = indexOf(parts, QLatin1String("gpu"));
++ m_dmonIndices.power = indexOf(parts, QLatin1String("pwr"));
++ m_dmonIndices.gtemp = indexOf(parts, QLatin1String("gtemp"));
++ m_dmonIndices.sm = indexOf(parts, QLatin1String("sm"));
++ m_dmonIndices.enc = indexOf(parts, QLatin1String("enc"));
++ m_dmonIndices.dec = indexOf(parts, QLatin1String("dec"));
++ m_dmonIndices.fb = indexOf(parts, QLatin1String("fb"));
++ m_dmonIndices.bar1 = indexOf(parts, QLatin1String("bar1"));
++ m_dmonIndices.mclk = indexOf(parts, QLatin1String("mclk"));
++ m_dmonIndices.pclk = indexOf(parts, QLatin1String("pclk"));
++ }
+ continue;
+ }
+
+@@ -177,19 +195,23 @@ void NvidiaSmiProcess::readStatisticsData()
+ continue;
+ }
+
++ auto readDataIfFound = [&parts, this] (int index) {
++ return index > 0 ? parts[index].toUInt() : 0;
++ };
++
+ GpuData data;
+- data.index = index;
+- data.power = parts[1].toUInt();
+- data.temperature = parts[2].toUInt();
++ data.index = readDataIfFound(m_dmonIndices.gpu);
++ data.power = readDataIfFound(m_dmonIndices.power);
++ data.temperature = readDataIfFound(m_dmonIndices.gtemp);
+
+ // GPU usage equals "SM" usage + "ENC" usage + "DEC" usage
+- data.usage = parts[4].toUInt() + parts[6].toUInt() + parts[7].toUInt();
++ data.usage = readDataIfFound(m_dmonIndices.sm) + readDataIfFound(m_dmonIndices.enc) + readDataIfFound(m_dmonIndices.dec);
+
+ // Total memory used equals "FB" usage + "BAR1" usage
+- data.memoryUsed = parts[10].toUInt() + parts[11].toUInt();
++ data.memoryUsed = readDataIfFound(m_dmonIndices.fb) + readDataIfFound(m_dmonIndices.bar1);
+
+- data.memoryFrequency = parts[8].toUInt();
+- data.coreFrequency = parts[9].toUInt();
++ data.memoryFrequency = readDataIfFound(m_dmonIndices.mclk);
++ data.coreFrequency = readDataIfFound(m_dmonIndices.pclk);
+
+ Q_EMIT dataReceived(data);
+ }
+diff --git a/plugins/gpu/NvidiaSmiProcess.h b/plugins/gpu/NvidiaSmiProcess.h
+index f39cc9d..2cd8504 100644
+--- a/plugins/gpu/NvidiaSmiProcess.h
++++ b/plugins/gpu/NvidiaSmiProcess.h
+@@ -49,8 +49,22 @@ public:
+ private:
+ void readStatisticsData();
+
++ struct dmonIndices {
++ int gpu = -1;
++ int gtemp = -1;
++ int power = -1;
++ int sm = -1;
++ int enc = -1;
++ int dec = -1;
++ int fb = -1;
++ int bar1 = -1;
++ int mclk = -1;
++ int pclk = -1;
++ };
++
+ QString m_smiPath;
+ std::vector<GpuQueryResult> m_queryResult;
+ std::unique_ptr<QProcess> m_process = nullptr;
+ int m_references = 0;
++ dmonIndices m_dmonIndices;
+ };
+--
+GitLab
+
diff --git a/kde-plasma/ksystemstats/ksystemstats-5.27.6.ebuild b/kde-plasma/ksystemstats/ksystemstats-5.27.6-r1.ebuild
index fb89b8ef5e81..0ac89d486c4a 100644
--- a/kde-plasma/ksystemstats/ksystemstats-5.27.6.ebuild
+++ b/kde-plasma/ksystemstats/ksystemstats-5.27.6-r1.ebuild
@@ -8,7 +8,8 @@ ECM_TEST="forceoptional"
KFMIN=5.106.0
PVCUT=$(ver_cut 1-3)
QTMIN=5.15.9
-inherit ecm plasma.kde.org
+VIRTUALX_REQUIRED="test" # bug 909312 (test fails)
+inherit ecm plasma.kde.org virtualx
DESCRIPTION="Plugin-based system monitoring daemon"
@@ -37,6 +38,8 @@ RDEPEND="${DEPEND}
!<kde-plasma/ksysguard-5.21.90:5
"
+PATCHES=( "${FILESDIR}/${P}-nvidia-data-fields.patch" ) # KDE-bug 470474
+
src_configure() {
local mycmakeargs=(
$(cmake_use_find_package networkmanager KF5NetworkManagerQt)