linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-trace-devel@vger.kernel.org
Cc: Yordan Karadzhov <y.karadz@gmail.com>
Subject: [PATCH 1/4] revert: "kernel-shark: Remove a duplicate error message"
Date: Wed, 10 Jul 2019 09:46:37 -0400	[thread overview]
Message-ID: <20190710134725.144595473@goodmis.org> (raw)
In-Reply-To: 20190710134636.116362181@goodmis.org

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

It turns out that if the kshark-record dialog does not show up for some
reason, then without this "duplicate" message, the user gets no message at
all to why the dialog did not appear.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 kernel-shark/src/KsMainWindow.cpp | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp
index 8826cf5cf8b2..198b410480a1 100644
--- a/kernel-shark/src/KsMainWindow.cpp
+++ b/kernel-shark/src/KsMainWindow.cpp
@@ -1154,9 +1154,35 @@ void KsMainWindow::_captureStarted()
 	_captureLocalServer.listen("KSCapture");
 }
 
+/**
+ * If the authorization could not be obtained because the user dismissed
+ * the authentication dialog (clicked Cancel), pkexec exits with a return
+ * value of 126.
+ */
+#define PKEXEC_DISMISS_RET	126
+
 void KsMainWindow::_captureFinished(int ret, QProcess::ExitStatus st)
 {
+	QProcess *capture = (QProcess *)sender();
+
 	_captureLocalServer.close();
+
+	if (ret == PKEXEC_DISMISS_RET) {
+		/*
+		 * Authorization could not be obtained because the user
+		 * dismissed the authentication dialog.
+		 */
+		return;
+	}
+
+	if (ret != 0 || st != QProcess::NormalExit) {
+		QString message = "Capture process failed:<br>";
+
+		message += capture->errorString();
+		message += "<br>Try doing:<br> sudo make install";
+
+		_error(message, "captureFinishedErr", false, false);
+	}
 }
 
 void KsMainWindow::_captureError(QProcess::ProcessError error)
-- 
2.20.1



  reply	other threads:[~2019-07-10 13:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-10 13:46 [PATCH 0/4] kernel-shark: The road to 1.0 Steven Rostedt
2019-07-10 13:46 ` Steven Rostedt [this message]
2019-07-10 13:46 ` [PATCH 2/4] kernel-shark: Remove the "make install" suggestion for capture errors Steven Rostedt
2019-07-10 13:46 ` [PATCH 3/4] kernel-shark: Show the standard error of kshark-record Steven Rostedt
2019-07-10 13:46 ` [PATCH 4/4] kernel-shark: Use <br> for dialog and \n for console error messages Steven Rostedt
2019-07-17  6:55   ` Yordan Karadzhov (VMware)
2019-07-17  0:24 ` [PATCH 0/4] kernel-shark: The road to 1.0 Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190710134725.144595473@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=y.karadz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).