diff mbox series

[v2,5/5] kernel-shark: Better formatting of the error messages from "Record"

Message ID 20190826155811.32021-6-y.karadz@gmail.com (mailing list archive)
State Superseded
Headers show
Series Handle the case when KernelShark is started as Root | expand

Commit Message

Yordan Karadzhov Aug. 26, 2019, 3:58 p.m. UTC
Make the message easier to read and understand by separating the
QProcess's error and the Standard error.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 kernel-shark/src/KsMainWindow.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Steven Rostedt Aug. 27, 2019, 11:03 p.m. UTC | #1
On Mon, 26 Aug 2019 18:58:11 +0300
"Yordan Karadzhov (VMware)" <y.karadz@gmail.com> wrote:

> Make the message easier to read and understand by separating the
> QProcess's error and the Standard error.
> 
> Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
> ---
>  kernel-shark/src/KsMainWindow.cpp | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp
> index 651cf59..a3b5ce7 100644
> --- a/kernel-shark/src/KsMainWindow.cpp
> +++ b/kernel-shark/src/KsMainWindow.cpp
> @@ -1211,9 +1211,10 @@ void KsMainWindow::_captureError(QProcess::ProcessError error)
>  
>  void KsMainWindow::_captureErrorMessage(QProcess *capture)
>  {
> -	QString message = "Capture process failed:<br>";
> +	QString message = "Capture process failed: ";
>  
>  	message += capture->errorString();
> +	message += "<br>Standard Error :";

I changed the above to: "<br>Standard Error: ", as I added:

 echo "this is an error" >&2
 exit 1

to kshark-su-record and the current patch produces:

  ERROR:  Capture process failed: Unknown error
  Standard Error :this is an error

Where I think the below looks better:

  ERROR:  Capture process failed: Unknown error
  Standard Error: this is an error

-- Steve


>  	message += capture->readAllStandardError();
>  	_error(message, "captureFinishedErr", false, false);
>  }
diff mbox series

Patch

diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp
index 651cf59..a3b5ce7 100644
--- a/kernel-shark/src/KsMainWindow.cpp
+++ b/kernel-shark/src/KsMainWindow.cpp
@@ -1211,9 +1211,10 @@  void KsMainWindow::_captureError(QProcess::ProcessError error)
 
 void KsMainWindow::_captureErrorMessage(QProcess *capture)
 {
-	QString message = "Capture process failed:<br>";
+	QString message = "Capture process failed: ";
 
 	message += capture->errorString();
+	message += "<br>Standard Error :";
 	message += capture->readAllStandardError();
 	_error(message, "captureFinishedErr", false, false);
 }