From: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org,
"Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
Subject: [PATCH v3 4/5] kernel-shark: Optimize the error messages when "Record" fails to start
Date: Fri, 20 Sep 2019 13:28:51 +0300 [thread overview]
Message-ID: <20190920102852.22769-5-y.karadz@gmail.com> (raw)
In-Reply-To: <20190920102852.22769-1-y.karadz@gmail.com>
Removing duplicate code.
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
kernel-shark/src/KsMainWindow.cpp | 14 +++++++-------
kernel-shark/src/KsMainWindow.hpp | 2 ++
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp
index e24b0f5..311aa87 100644
--- a/kernel-shark/src/KsMainWindow.cpp
+++ b/kernel-shark/src/KsMainWindow.cpp
@@ -1199,18 +1199,18 @@ void KsMainWindow::_captureFinished(int ret, QProcess::ExitStatus st)
return;
}
- if (ret != 0 && st == QProcess::NormalExit) {
- QString message = "Capture process failed:<br>";
-
- message += capture->errorString();
- message += capture->readAllStandardError();
- _error(message, "captureFinishedErr", false, false);
- }
+ if (ret != 0 && st == QProcess::NormalExit)
+ _captureErrorMessage(capture);
}
void KsMainWindow::_captureError(QProcess::ProcessError error)
{
QProcess *capture = (QProcess *)sender();
+ _captureErrorMessage(capture);
+}
+
+void KsMainWindow::_captureErrorMessage(QProcess *capture)
+{
QString message = "Capture process failed:<br>";
message += capture->errorString();
diff --git a/kernel-shark/src/KsMainWindow.hpp b/kernel-shark/src/KsMainWindow.hpp
index 4a7b8ab..eef4f96 100644
--- a/kernel-shark/src/KsMainWindow.hpp
+++ b/kernel-shark/src/KsMainWindow.hpp
@@ -215,6 +215,8 @@ private:
void _captureError(QProcess::ProcessError error);
+ void _captureErrorMessage(QProcess *capture);
+
void _readSocket();
void _splitterMoved(int pos, int index);
--
2.20.1
next prev parent reply other threads:[~2019-09-20 10:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-20 10:28 [PATCH v3 0/5] Handle the case when KernelShark is started as Root Yordan Karadzhov (VMware)
2019-09-20 10:28 ` [PATCH v3 1/5] kernel-shark: Show warning message when running " Yordan Karadzhov (VMware)
2019-09-20 10:28 ` [PATCH v3 2/5] kernel-shark: Don't use pkexec " Yordan Karadzhov (VMware)
2019-09-20 10:28 ` [PATCH v3 3/5] kernel-shark: Use standart error message in KsMainWindow::_record() Yordan Karadzhov (VMware)
2019-09-20 10:28 ` Yordan Karadzhov (VMware) [this message]
2019-09-20 10:28 ` [PATCH v3 5/5] kernel-shark: Better formatting of the error messages from "Record" Yordan Karadzhov (VMware)
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=20190920102852.22769-5-y.karadz@gmail.com \
--to=y.karadz@gmail.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/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).