summaryrefslogtreecommitdiffstats
path: root/src/manager-lib/systemreader.h
diff options
context:
space:
mode:
authorDaniel d'Andrada <daniel.dandrada@luxoft.com>2018-06-25 18:13:28 +0200
committerRobert Griebl <robert.griebl@pelagicore.com>2018-06-27 15:54:35 +0000
commit020c7e13009ec9c79944149f334b1ee90be30834 (patch)
treeea3cba26316b8b985abe9d1e838a21cd65b7a31d /src/manager-lib/systemreader.h
parent88f5b118c38af47dacb2c8e33c70b4831d8ce843 (diff)
Read used memory from the correct cgroup stat
Resident set size (RSS) is what we are looking for. Also made SystemMonitor take into consideration any imposed memory limit for its totalMemory property/param. Change-Id: I5c82cabc6220df3b58a55dffd8039486e05acadc Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
Diffstat (limited to 'src/manager-lib/systemreader.h')
-rw-r--r--src/manager-lib/systemreader.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/manager-lib/systemreader.h b/src/manager-lib/systemreader.h
index 21a0caf9..d1e01a10 100644
--- a/src/manager-lib/systemreader.h
+++ b/src/manager-lib/systemreader.h
@@ -187,5 +187,15 @@ private:
QScopedPointer<MemoryReader> m_reader;
};
+#if defined(Q_OS_LINUX)
+// Parses the file /proc/$PID/cgroup, returning a map groupName->path
+// eg: map["memory"] == "/user.slice"
+QMap<QByteArray, QByteArray> fetchCGroupProcessInfo(qint64 pid);
+
+// Where the filesystem root directory is located. This exists solely to enable testing.
+// In production it's naturally "/"
+extern QString g_systemRootDir;
+#endif
+
QT_END_NAMESPACE_AM
// We mean it. Dummy comment since syncqt needs this also for completely private Qt modules.