diff mbox series

[2/3] kernel-shark: Better error message for the constructor of KsCaptureControl

Message ID 20190723125204.22799-3-y.karadz@gmail.com (mailing list archive)
State Accepted
Headers show
Series Fixes needed befor KS 1.0 | expand

Commit Message

Yordan Karadzhov July 23, 2019, 12:52 p.m. UTC
The error message includes the case when the tracing directory cannot be
found or mounted.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 kernel-shark/src/KsCaptureDialog.cpp | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
diff mbox series

Patch

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 @@  KsCaptureControl::KsCaptureControl(QWidget *parent)
 		_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;}");