Changeset View
Changeset View
Standalone View
Standalone View
plugins/process/nvidia/nvidia.cpp
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | 75 | if (line != QLatin1String("# gpu pid type sm mem enc dec command\n") && | |||
---|---|---|---|---|---|
78 | m_process->terminate(); | 78 | m_process->terminate(); | ||
79 | } | 79 | } | ||
80 | continue; | 80 | continue; | ||
81 | } | 81 | } | ||
82 | const auto parts = line.splitRef(QLatin1Char(' '), QString::SkipEmptyParts); | 82 | const auto parts = line.splitRef(QLatin1Char(' '), QString::SkipEmptyParts); | ||
83 | 83 | | |||
84 | // format at time of writing is | 84 | // format at time of writing is | ||
85 | // # gpu pid type sm mem enc dec command | 85 | // # gpu pid type sm mem enc dec command | ||
86 | if (parts.count() != 9) { | 86 | if (parts.count() < 5) { // we only access up to the 5th element | ||
87 | continue; | 87 | continue; | ||
88 | } | 88 | } | ||
89 | 89 | | |||
90 | long pid = parts[1].toUInt(); | 90 | long pid = parts[1].toUInt(); | ||
91 | int sm = parts[3].toUInt(); | 91 | int sm = parts[3].toUInt(); | ||
92 | int mem = parts[4].toUInt(); | 92 | int mem = parts[4].toUInt(); | ||
93 | 93 | | |||
94 | KSysGuard::Process *process = getProcess(pid); | 94 | KSysGuard::Process *process = getProcess(pid); | ||
Show All 12 Lines |