kernel-shark: Better error message for the constructor of KsCaptureControl
The error message includes the case when the tracing directory cannot be
found or mounted.
Link: http://lore.kernel.org/linux-trace-devel/20190723125204.22799-3-y.karadz@gmail.com
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
diff --git a/kernel-shark/src/KsCaptureDialog.cpp b/kernel-shark/src/KsCaptureDialog.cpp
index 0a29518..2e6e8f9 100644
--- a/kernel-shark/src/KsCaptureDialog.cpp
+++ b/kernel-shark/src/KsCaptureDialog.cpp
@@ -55,13 +55,19 @@
_topLayout.addWidget(line);
};
- if (pluginList.count() == 0) {
+ if (pluginList.count() == 0 || !_localTEP) {
/*
- * No plugins have been found. Most likely this is because
- * the process has no Root privileges.
+ * No plugins or events have been found. Most likely this is
+ * because the process has no Root privileges or because
+ * tracefs cannot be mounted.
*/
QString message("Error: No events or plugins found.\n");
- message += "Root privileges are required.";
+
+ if (!_localTEP)
+ message += "Cannot find or mount tracing directory.\n";
+ if (!pluginList.count())
+ message += "Root privileges are required.\n";
+
QLabel *errorLabel = new QLabel(message);
errorLabel->setStyleSheet("QLabel {color : red;}");