linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org
Subject: [PATCH 3/5] KernelShark: Fix combo plot plugin crash in case of multiple streams
Date: Mon, 27 Jul 2020 10:18:21 +0300	[thread overview]
Message-ID: <20200727071823.169962-4-tz.stoyanov@gmail.com> (raw)
In-Reply-To: <20200727071823.169962-1-tz.stoyanov@gmail.com>

From: Tzvetomir (VMware)  Stoyanov <tz.stoyanov@gmail.com>

Added a check if there is a host-guest mapping in the loaded
multiple streams. If there is no such mapping, print an error and
exit the KsComboPlotDialog::update() function.

Signed-off-by: Tzvetomir (VMware)  Stoyanov <tz.stoyanov@gmail.com>
---
 src/plugins/KVMCombo.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/plugins/KVMCombo.cpp b/src/plugins/KVMCombo.cpp
index ceb1f47..3ec36b6 100644
--- a/src/plugins/KVMCombo.cpp
+++ b/src/plugins/KVMCombo.cpp
@@ -246,7 +246,12 @@ void KsComboPlotDialog::update()
 	_guestMap = nullptr;
 	_guestMapCount = 0;
 	ret = kshark_tracecmd_get_hostguest_mapping(&_guestMap);
-	if (ret > 0)
+	if (ret <= 0) {
+		QString err("Cannot find host / guest tracing into the loaded streams");
+		QMessageBox msgBox;
+		msgBox.critical(nullptr, "Error", err);
+		return;
+	} else
 		_guestMapCount = ret;
 
 	KsUtils::setElidedText(&_hostFileLabel,
-- 
2.26.2


  parent reply	other threads:[~2020-07-27  7:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-27  7:18 [PATCH 0/5] Add support for opening trace.dat files with multuiple buffers Tzvetomir Stoyanov (VMware)
2020-07-27  7:18 ` [PATCH 1/5] KernelShark: Add stream name Tzvetomir Stoyanov (VMware)
2020-07-28 13:21   ` Steven Rostedt
2020-07-27  7:18 ` [PATCH 2/5] KernelShark: Fix compilation issues on Fedora 32 Tzvetomir Stoyanov (VMware)
2020-07-28 13:23   ` Steven Rostedt
2020-07-27  7:18 ` Tzvetomir Stoyanov (VMware) [this message]
2020-07-28 13:26   ` [PATCH 3/5] KernelShark: Fix combo plot plugin crash in case of multiple streams Steven Rostedt
2020-07-27  7:18 ` [PATCH 4/5] KernelShark: Load trace.dat file with ftrace sub-buffers Tzvetomir Stoyanov (VMware)
2020-07-27  7:18 ` [PATCH 5/5] KernelShark: New libkshark API for loading all entries from given file Tzvetomir Stoyanov (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=20200727071823.169962-4-tz.stoyanov@gmail.com \
    --to=tz.stoyanov@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).