linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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>,
	Julia Lawall <julia.lawall@inria.fr>
Subject: [PATCH v3 3/3] kernel-shark: Set a maximum number of plots to be shown by default
Date: Fri,  8 May 2020 18:23:02 +0300	[thread overview]
Message-ID: <20200508152302.27843-4-y.karadz@gmail.com> (raw)
In-Reply-To: <20200508152302.27843-1-y.karadz@gmail.com>

Set a maximum number of CPU plots to be shown by default. No more than
16 CPU plots will be shown if no command line options, per-selecting
the plots, are provided. This will be useful when opening trace file
containing hundreds of CPU cores.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Suggested-by: Julia Lawall  <julia.lawall@inria.fr>
---
 kernel-shark/src/KsGLWidget.cpp | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/kernel-shark/src/KsGLWidget.cpp b/kernel-shark/src/KsGLWidget.cpp
index e930006..78ded33 100644
--- a/kernel-shark/src/KsGLWidget.cpp
+++ b/kernel-shark/src/KsGLWidget.cpp
@@ -340,6 +340,11 @@ void KsGLWidget::keyReleaseEvent(QKeyEvent *event)
 	return;
 }
 
+/**
+ * The maximum number of CPU plots to be shown by default when the GUI starts.
+ */
+#define KS_MAX_START_PLOTS 16
+
 /**
  * @brief Load and show trace data.
  *
@@ -358,7 +363,6 @@ void KsGLWidget::loadData(KsDataStore *data)
 	 * One bin will correspond to one pixel.
 	 */
 	nBins = width() - _hMargin * 2;
-	nCPUs = tep_get_cpus(_data->tep());
 
 	_model.reset();
 
@@ -368,8 +372,13 @@ void KsGLWidget::loadData(KsDataStore *data)
 	ksmodel_set_bining(_model.histo(), nBins, tMin, tMax);
 	_model.fill(_data->rows(), _data->size());
 
-	/* Make a default CPU list. All CPUs will be plotted. */
+	/* Make a default CPU list. All CPUs (or the first N_max) will be plotted. */
 	_cpuList = {};
+
+	nCPUs = tep_get_cpus(_data->tep());
+	if (nCPUs > KS_MAX_START_PLOTS)
+		nCPUs = KS_MAX_START_PLOTS;
+
 	for (int i = 0; i < nCPUs; ++i)
 		_cpuList.append(i);
 
-- 
2.20.1


      parent reply	other threads:[~2020-05-08 15:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-08 15:22 [PATCH v3 0/3] Yordan Karadzhov (VMware)
2020-05-08 15:23 ` [PATCH v3 1/3] kernel-shark: Add methods for selecting the plots to be shown Yordan Karadzhov (VMware)
2020-05-08 15:23 ` [PATCH v3 2/3] kernel-shark: Add command line options for selecting " Yordan Karadzhov (VMware)
2020-05-08 15:23 ` Yordan Karadzhov (VMware) [this message]

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=20200508152302.27843-4-y.karadz@gmail.com \
    --to=y.karadz@gmail.com \
    --cc=julia.lawall@inria.fr \
    --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).