From patchwork Sun Jan 14 17:16:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519211 Received: from smtpout3.mo529.mail-out.ovh.net (smtpout3.mo529.mail-out.ovh.net [46.105.54.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 05DCD5384 for ; Sun, 14 Jan 2024 17:17:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.109.139.23]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id 3558F20441; Sun, 14 Jan 2024 17:17:34 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:33 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S002f8cfaec9-fb2e-4d36-88e1-2c5c4b85a805, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 01/34] kernelshark: Fix modelReset() signaling, rename update to updateGeom Date: Sun, 14 Jan 2024 18:16:50 +0100 Message-ID: <20240114171723.14092-2-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: ae0541cc-0cea-443b-bed9-52230a8210fc X-Ovh-Tracer-Id: 1669991037385662362 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpeefkeeuieevvddtveehudektedvjeevjeegieffkefgheeludegudevueelleeftdenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecukfhppeduvdejrddtrddtrddupdefjedrheelrddugedvrddutdekpdelvddrudeiuddruddviedrgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeihrdhkrghrrgguiiesghhmrghilhdrtghomhdplhhinhhugidqthhrrggtvgdquggvvhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhohedvledpmhhouggvpehsmhhtphhouhht Fix segfault introduced by the migration to Qt6. There was a public update() function in KsGLWidget class which overrides QWidget::update(). The QAbstractTableModel::modelReset signal was connected to the QWidget::update slot using "old" connect syntax. This was working since QWidget::update was declared as a slot, and registered in QWidget meta information. When migrating to Qt6, the new connect syntax was used, which accidentally connect the KsGLWidget::update function instead of QWidget::update. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=218350 Signed-off-by: Benjamin ROBIN --- src/KsGLWidget.cpp | 4 ++-- src/KsGLWidget.hpp | 2 +- src/KsTraceGraph.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/KsGLWidget.cpp b/src/KsGLWidget.cpp index 023d1c8..9e3dac3 100644 --- a/src/KsGLWidget.cpp +++ b/src/KsGLWidget.cpp @@ -53,7 +53,7 @@ KsGLWidget::KsGLWidget(QWidget *parent) setMouseTracking(true); connect(&_model, &QAbstractTableModel::modelReset, - this, &KsGLWidget::update); + this, qOverload<>(&KsGLWidget::update)); } void KsGLWidget::_freeGraphs() @@ -89,7 +89,7 @@ void KsGLWidget::initializeGL() ksplot_init_font(&_font, 15, TT_FONT_FILE); _labelSize = _getMaxLabelSize() + FONT_WIDTH * 2; - update(); + updateGeom(); } /** diff --git a/src/KsGLWidget.hpp b/src/KsGLWidget.hpp index 03bd5eb..1c6253f 100644 --- a/src/KsGLWidget.hpp +++ b/src/KsGLWidget.hpp @@ -86,7 +86,7 @@ public: void reset(); /** Reprocess all graphs. */ - void update() {resizeGL(width(), height());} + void updateGeom() {resizeGL(width(), height());} void mousePressEvent(QMouseEvent *event); diff --git a/src/KsTraceGraph.cpp b/src/KsTraceGraph.cpp index 65e5a79..f80477d 100644 --- a/src/KsTraceGraph.cpp +++ b/src/KsTraceGraph.cpp @@ -614,7 +614,7 @@ void KsTraceGraph::updateGeom() * widget is extended to maximum. */ - _glWindow.update(); + _glWindow.updateGeom(); } /** From patchwork Sun Jan 14 17:16:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519209 Received: from smtpout3.mo529.mail-out.ovh.net (smtpout3.mo529.mail-out.ovh.net [46.105.54.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7F78538B for ; Sun, 14 Jan 2024 17:17:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.109.139.23]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id 9AA9620448; Sun, 14 Jan 2024 17:17:34 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:33 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S0027eac622a-0ad5-41b9-892e-b1c5eebe442a, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 02/34] kernelshark: Add .gitignore Date: Sun, 14 Jan 2024 18:16:51 +0100 Message-ID: <20240114171723.14092-3-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: 0eadc427-a6fc-4787-a112-6b7a28eadd8a X-Ovh-Tracer-Id: 1670272512414932890 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeouggvvhessggvnhhjrghrohgsihhnrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohephidrkhgrrhgrugiisehgmhgrihhlrdgtohhmpdhlihhnuhigqdhtrhgrtggvqdguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehvdelpdhmohguvgepshhmthhpohhuth Signed-off-by: Benjamin ROBIN --- .gitignore | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..87a23cc --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ + +# Ignore everything in bin directory except kshark-su-record +/bin/* +!/bin/kshark-su-record + +# Ignore generated files +CMakeLists.txt.user +/libkshark.pc +/org.freedesktop.kshark-record.policy +/kernelshark.desktop +/src/KsCmakeDef.hpp +/lib/* +/tests/*.so +/tests/kshark-tests +/tests/kshark-gui-tests From patchwork Sun Jan 14 17:16:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519242 Received: from smtpout2.mo529.mail-out.ovh.net (smtpout2.mo529.mail-out.ovh.net [79.137.123.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 40687D27F for ; Sun, 14 Jan 2024 17:25:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.109.139.23]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id 00C9420429; Sun, 14 Jan 2024 17:17:35 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:34 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S0029477b5af-68f4-428a-8fab-c155652c6e19, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 03/34] kernelshark: Remove function param when not used, whenever possible Date: Sun, 14 Jan 2024 18:16:52 +0100 Message-ID: <20240114171723.14092-4-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: a25efa11-4697-43e9-94e6-f8c9916dcffb X-Ovh-Tracer-Id: 1670272512652697498 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeouggvvhessggvnhhjrghrohgsihhnrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohephidrkhgrrhgrugiisehgmhgrihhlrdgtohhmpdhlihhnuhigqdhtrhgrtggvqdguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehvdelpdhmohguvgepshhmthhpohhuth Signed-off-by: Benjamin ROBIN --- src/KsAdvFilteringDialog.cpp | 4 ++-- src/KsAdvFilteringDialog.hpp | 2 +- src/KsMainWindow.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/KsAdvFilteringDialog.cpp b/src/KsAdvFilteringDialog.cpp index b934db6..4683c3d 100644 --- a/src/KsAdvFilteringDialog.cpp +++ b/src/KsAdvFilteringDialog.cpp @@ -80,7 +80,7 @@ KsAdvFilteringDialog::KsAdvFilteringDialog(QWidget *parent) _getFilters(kshark_ctx); if (_filters.count()) { - _makeFilterTable(kshark_ctx); + _makeFilterTable(); lamAddLine(); } @@ -264,7 +264,7 @@ void KsAdvFilteringDialog::_getFilters(kshark_context *kshark_ctx) } } -void KsAdvFilteringDialog::_makeFilterTable(struct kshark_context *kshark_ctx) +void KsAdvFilteringDialog::_makeFilterTable() { QMapIterator f(_filters); QTableWidgetItem *i1, *i2, *i3; diff --git a/src/KsAdvFilteringDialog.hpp b/src/KsAdvFilteringDialog.hpp index a23e8d9..30bbadc 100644 --- a/src/KsAdvFilteringDialog.hpp +++ b/src/KsAdvFilteringDialog.hpp @@ -80,7 +80,7 @@ private: void _getFilters(kshark_context *kshark_ctx); - void _makeFilterTable(kshark_context *kshark_ctx); + void _makeFilterTable(); QStringList _getEventFields(int eventId); diff --git a/src/KsMainWindow.cpp b/src/KsMainWindow.cpp index ef15b20..68853d6 100644 --- a/src/KsMainWindow.cpp +++ b/src/KsMainWindow.cpp @@ -1434,12 +1434,12 @@ void KsMainWindow::loadSession(const QString &fileName) _session.loadUserPlugins(kshark_ctx, &_plugins); pb.setValue(20); - auto lamLoadJob = [&] (KsDataStore *d) { + auto lamLoadJob = [&] () { _session.loadDataStreams(kshark_ctx, &_data); loadDone = true; }; - std::thread job = std::thread(lamLoadJob, &_data); + std::thread job = std::thread(lamLoadJob); for (int i = 0; i < 150; ++i) { /* From patchwork Sun Jan 14 17:16:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519238 Received: from smtpout2.mo529.mail-out.ovh.net (smtpout2.mo529.mail-out.ovh.net [79.137.123.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7BFDDD285 for ; Sun, 14 Jan 2024 17:25:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.109.139.23]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id 59E50203BF; Sun, 14 Jan 2024 17:17:35 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:34 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S002eddd2468-b321-42cd-84c3-5498fb8e2498, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 04/34] kernelshark: Do not create a temporary container for looping over QMap Date: Sun, 14 Jan 2024 18:16:53 +0100 Message-ID: <20240114171723.14092-5-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: 79955601-d5b6-420a-b170-69061dd169e5 X-Ovh-Tracer-Id: 1670553986790285210 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeouggvvhessggvnhhjrghrohgsihhnrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohephidrkhgrrhgrugiisehgmhgrihhlrdgtohhmpdhlihhnuhigqdhtrhgrtggvqdguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehvdelpdhmohguvgepshhmthhpohhuth Use const_iterator instead. Fix container-anti-pattern Clazy warning Signed-off-by: Benjamin ROBIN --- src/KsAdvFilteringDialog.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/KsAdvFilteringDialog.cpp b/src/KsAdvFilteringDialog.cpp index 4683c3d..247f912 100644 --- a/src/KsAdvFilteringDialog.cpp +++ b/src/KsAdvFilteringDialog.cpp @@ -276,8 +276,8 @@ void KsAdvFilteringDialog::_makeFilterTable() headers << "Delete" << "Stream" << "Event" << " Id" << "Filter"; _table->init(headers, _filters.count()); - for(auto f : _filters.keys()) { - QStringList thisFilter = _filters.value(f).split(":"); + for (auto it = _filters.cbegin(), end = _filters.cend(); it != end; ++it) { + QStringList thisFilter = it.value().split(":"); i1 = new QTableWidgetItem(thisFilter[0]); _table->setItem(count, 1, i1); @@ -285,7 +285,7 @@ void KsAdvFilteringDialog::_makeFilterTable() i1 = new QTableWidgetItem(thisFilter[1]); _table->setItem(count, 2, i1); - i2 = new QTableWidgetItem(tr("%1").arg(f)); + i2 = new QTableWidgetItem(tr("%1").arg(it.key())); _table->setItem(count, 3, i2); i3 = new QTableWidgetItem(thisFilter[2]); From patchwork Sun Jan 14 17:16:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519214 Received: from smtpout3.mo529.mail-out.ovh.net (smtpout3.mo529.mail-out.ovh.net [46.105.54.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 237115396 for ; Sun, 14 Jan 2024 17:17:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.109.139.23]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id C0F2020447; Sun, 14 Jan 2024 17:17:35 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:35 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S002ae047cc6-7b8d-49dc-83c0-17caf7244724, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 05/34] kernelshark: Prevent potential detach of QMap container Date: Sun, 14 Jan 2024 18:16:54 +0100 Message-ID: <20240114171723.14092-6-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: a0a5bfa1-caa2-439d-9ba5-123a1cf5b73c X-Ovh-Tracer-Id: 1670553989434204058 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeouggvvhessggvnhhjrghrohgsihhnrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohephidrkhgrrhgrugiisehgmhgrihhlrdgtohhmpdhlihhnuhigqdhtrhgrtggvqdguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehvdelpdhmohguvgepshhmthhpohhuth Use const_iterator instead. Fix range-loop-detach Clazy warning Signed-off-by: Benjamin ROBIN --- src/KsGLWidget.cpp | 5 +++-- src/plugins/KVMComboDialog.cpp | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/KsGLWidget.cpp b/src/KsGLWidget.cpp index 9e3dac3..0a44e77 100644 --- a/src/KsGLWidget.cpp +++ b/src/KsGLWidget.cpp @@ -137,9 +137,10 @@ void KsGLWidget::paintGL() /* Draw the time axis. */ _drawAxisX(size); - for (auto const &stream: _graphs) - for (auto const &g: stream) + for (auto it = _graphs.cbegin(), end = _graphs.cend(); it != end; ++it) { + for (auto const &g: it.value()) g->draw(size); + } for (auto const &s: _shapes) { if (!s) diff --git a/src/plugins/KVMComboDialog.cpp b/src/plugins/KVMComboDialog.cpp index 2b95a53..6be68d4 100644 --- a/src/plugins/KVMComboDialog.cpp +++ b/src/plugins/KVMComboDialog.cpp @@ -308,13 +308,15 @@ void KsComboPlotDialog::_applyPress() int nPlots(0); _plotMap[guestId] = _streamCombos(guestId); - for (auto const &stream: _plotMap) - for (auto const &combo: stream) { + + for (auto it = _plotMap.cbegin(), end = _plotMap.cend(); it != end; ++it) { + for (auto const &combo: it.value()) { allCombosVec.append(2); combo[0] >> allCombosVec; combo[1] >> allCombosVec; ++nPlots; } + } emit apply(nPlots, allCombosVec); } From patchwork Sun Jan 14 17:16:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519212 Received: from smtpout3.mo529.mail-out.ovh.net (smtpout3.mo529.mail-out.ovh.net [46.105.54.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 236E55392 for ; Sun, 14 Jan 2024 17:17:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.109.139.23]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id 25DE520449; Sun, 14 Jan 2024 17:17:36 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:35 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S002fad01e1e-dd38-4906-af60-197e77d5f9e1, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 06/34] kernelshark: Fix used after free of QByteArray raw data Date: Sun, 14 Jan 2024 18:16:55 +0100 Message-ID: <20240114171723.14092-7-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: 75ffd58e-003d-4993-bc2d-e87c00d3aab1 X-Ovh-Tracer-Id: 1670553987669778330 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeouggvvhessggvnhhjrghrohgsihhnrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohephidrkhgrrhgrugiisehgmhgrihhlrdgtohhmpdhlihhnuhigqdhtrhgrtggvqdguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehvdelpdhmohguvgepshhmthhpohhuth In KsAdvFilteringDialog::_applyPress(), QByteArray raw data, obtained from _filterEdit, is accessed after being freed. Also prevent any unnecessary copy. Signed-off-by: Benjamin ROBIN --- src/KsAdvFilteringDialog.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/KsAdvFilteringDialog.cpp b/src/KsAdvFilteringDialog.cpp index 247f912..c0d6d48 100644 --- a/src/KsAdvFilteringDialog.cpp +++ b/src/KsAdvFilteringDialog.cpp @@ -443,8 +443,6 @@ void KsAdvFilteringDialog::_applyPress() QMapIterator f(_filters); kshark_context *kshark_ctx(NULL); kshark_data_stream *stream; - const char *text; - char *filter; int i(0); if (!kshark_instance(&kshark_ctx)) @@ -476,18 +474,12 @@ void KsAdvFilteringDialog::_applyPress() emit dataReload(); }; - text = _filterEdit.text().toLocal8Bit().data(); - if (strlen(text) == 0) { + QByteArray filter = _filterEdit.text().toLocal8Bit(); + if (filter.isEmpty()) { job_done(); return; } - filter = (char*) malloc(strlen(text) + 1); - strcpy(filter, text); - - kshark_tep_add_filter_str(stream, filter); - - free(filter); - + kshark_tep_add_filter_str(stream, filter.constData()); job_done(); } From patchwork Sun Jan 14 17:16:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519216 Received: from smtpout3.mo529.mail-out.ovh.net (smtpout3.mo529.mail-out.ovh.net [46.105.54.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 234DE538D for ; Sun, 14 Jan 2024 17:17:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.109.139.23]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id 88AE32044C; Sun, 14 Jan 2024 17:17:36 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:35 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S0028b7ceb55-890a-4d3b-a2e6-d918ba3e564f, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 07/34] kernelshark: Fix potential memory leak in KsGLWidget Date: Sun, 14 Jan 2024 18:16:56 +0100 Message-ID: <20240114171723.14092-8-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: 1674ac05-a141-461f-86be-d3efde018a96 X-Ovh-Tracer-Id: 1670835463949279130 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeouggvvhessggvnhhjrghrohgsihhnrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohephidrkhgrrhgrugiisehgmhgrihhlrdgtohhmpdhlihhnuhigqdhtrhgrtggvqdguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehvdelpdhmohguvgepshhmthhpohhuth In KsGLWidget::_newCPUGraph() and in KsGLWidget::_newTaskGraph() allocate KsPlot::Graph after getting data stream successfully. Also remove unused "name" local variable in both functions. Signed-off-by: Benjamin ROBIN --- src/KsGLWidget.cpp | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/KsGLWidget.cpp b/src/KsGLWidget.cpp index 0a44e77..23485d2 100644 --- a/src/KsGLWidget.cpp +++ b/src/KsGLWidget.cpp @@ -794,13 +794,8 @@ void KsGLWidget::_makePluginShapes() KsPlot::Graph *KsGLWidget::_newCPUGraph(int sd, int cpu) { - QString name; - /* The CPU graph needs to know only the colors of the tasks. */ - KsPlot::Graph *graph = new KsPlot::Graph(_model.histo(), - &_pidColors, - &_pidColors); - - kshark_context *kshark_ctx(nullptr); + KsPlot::Graph *graph = nullptr; + kshark_context *kshark_ctx = nullptr; kshark_data_stream *stream; kshark_entry_collection *col; @@ -811,6 +806,8 @@ KsPlot::Graph *KsGLWidget::_newCPUGraph(int sd, int cpu) if (!stream) return nullptr; + /* The CPU graph needs to know only the colors of the tasks. */ + graph = new KsPlot::Graph(_model.histo(), &_pidColors, &_pidColors); graph->setIdleSuppressed(true, stream->idle_pid); graph->setHeight(KS_GRAPH_HEIGHT); graph->setLabelText(KsUtils::cpuPlotName(cpu).toStdString()); @@ -827,15 +824,8 @@ KsPlot::Graph *KsGLWidget::_newCPUGraph(int sd, int cpu) KsPlot::Graph *KsGLWidget::_newTaskGraph(int sd, int pid) { - QString name; - /* - * The Task graph needs to know the colors of the tasks and the colors - * of the CPUs. - */ - KsPlot::Graph *graph = new KsPlot::Graph(_model.histo(), - &_pidColors, - &_cpuColors); - kshark_context *kshark_ctx(nullptr); + KsPlot::Graph *graph = nullptr; + kshark_context *kshark_ctx = nullptr; kshark_entry_collection *col; kshark_data_stream *stream; @@ -846,6 +836,9 @@ KsPlot::Graph *KsGLWidget::_newTaskGraph(int sd, int pid) if (!stream) return nullptr; + /* The Task graph needs to know the colors of the tasks and the colors + * of the CPUs */ + graph = new KsPlot::Graph(_model.histo(), &_pidColors, &_cpuColors); graph->setHeight(KS_GRAPH_HEIGHT); graph->setLabelText(KsUtils::taskPlotName(sd, pid).toStdString()); From patchwork Sun Jan 14 17:16:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519240 Received: from smtpout2.mo529.mail-out.ovh.net (smtpout2.mo529.mail-out.ovh.net [79.137.123.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A4A8D277 for ; Sun, 14 Jan 2024 17:25:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.109.139.23]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id E7FFE2044E; Sun, 14 Jan 2024 17:17:36 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:36 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S00258b352b3-a278-4cf8-9d71-13b871bab29f, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 08/34] kernelshark: Use lambda parameter instead of captured local variable Date: Sun, 14 Jan 2024 18:16:57 +0100 Message-ID: <20240114171723.14092-9-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: 2baba7a7-68e4-4460-ba6b-e0c6881e42fc X-Ovh-Tracer-Id: 1670835464359665562 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeouggvvhessggvnhhjrghrohgsihhnrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohephidrkhgrrhgrugiisehgmhgrihhlrdgtohhmpdhlihhnuhigqdhtrhgrtggvqdguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehvdelpdhmohguvgepshhmthhpohhuth In KsGLWidget::_find(), fix lamFindEntryByCPU() and lamFindEntryByPid() which had a parameter "b": use it instead of using captured "bin" local variable. Signed-off-by: Benjamin ROBIN --- src/KsGLWidget.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/KsGLWidget.cpp b/src/KsGLWidget.cpp index 23485d2..dd9f41a 100644 --- a/src/KsGLWidget.cpp +++ b/src/KsGLWidget.cpp @@ -986,15 +986,15 @@ bool KsGLWidget::_find(int bin, int sd, int cpu, int pid, * The click is over the CPU graphs. First try the exact * match. */ - if (lamGetEntryByCPU(bin)) + if (lamGetEntryByCPU(b)) return true; /* Now look for a match, nearby the position of the click. */ for (int i = 1; i < variance; ++i) { - if (bin + i <= hSize && lamGetEntryByCPU(bin + i)) + if (b + i <= hSize && lamGetEntryByCPU(b + i)) return true; - if (bin - i >= 0 && lamGetEntryByCPU(bin - i)) + if (b - i >= 0 && lamGetEntryByCPU(b - i)) return true; } @@ -1007,15 +1007,15 @@ bool KsGLWidget::_find(int bin, int sd, int cpu, int pid, * The click is over the Task graphs. First try the exact * match. */ - if (lamGetEntryByPid(bin)) + if (lamGetEntryByPid(b)) return true; /* Now look for a match, nearby the position of the click. */ for (int i = 1; i < variance; ++i) { - if ((bin + i <= hSize) && lamGetEntryByPid(bin + i)) + if ((b + i <= hSize) && lamGetEntryByPid(b + i)) return true; - if ((bin - i >= 0) && lamGetEntryByPid(bin - i)) + if ((b - i >= 0) && lamGetEntryByPid(b - i)) return true; } From patchwork Sun Jan 14 17:16:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519218 Received: from smtpout3.mo529.mail-out.ovh.net (smtpout3.mo529.mail-out.ovh.net [46.105.54.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C45E53AC for ; Sun, 14 Jan 2024 17:17:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.109.139.23]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id 76CB620452; Sun, 14 Jan 2024 17:17:37 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:36 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S002979fcb5f-cccb-493a-bd42-04d5b4bb21c2, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 09/34] kernelshark: Keep overridden method protected instead of public Date: Sun, 14 Jan 2024 18:16:58 +0100 Message-ID: <20240114171723.14092-10-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: 9cc5d8b1-128b-4b67-be8e-4b96f7c8f05d X-Ovh-Tracer-Id: 1670835463560388506 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeouggvvhessggvnhhjrghrohgsihhnrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohephidrkhgrrhgrugiisehgmhgrihhlrdgtohhmpdhlihhnuhigqdhtrhgrtggvqdguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehvdelpdhmohguvgepshhmthhpohhuth Also add "override" keyword when missing. Signed-off-by: Benjamin ROBIN --- src/KsGLWidget.hpp | 41 +++++++++++++++++++++-------------------- src/KsModels.hpp | 9 +++++---- src/KsPlotTools.hpp | 2 +- src/KsTraceViewer.hpp | 9 +++++---- src/KsWidgetsLib.hpp | 9 +++++---- 5 files changed, 37 insertions(+), 33 deletions(-) diff --git a/src/KsGLWidget.hpp b/src/KsGLWidget.hpp index 1c6253f..cafc70b 100644 --- a/src/KsGLWidget.hpp +++ b/src/KsGLWidget.hpp @@ -75,12 +75,6 @@ public: ~KsGLWidget(); - void initializeGL() override; - - void resizeGL(int w, int h) override; - - void paintGL() override; - void render(); void reset(); @@ -88,20 +82,6 @@ public: /** Reprocess all graphs. */ void updateGeom() {resizeGL(width(), height());} - void mousePressEvent(QMouseEvent *event); - - void mouseMoveEvent(QMouseEvent *event); - - void mouseReleaseEvent(QMouseEvent *event); - - void mouseDoubleClickEvent(QMouseEvent *event); - - void wheelEvent(QWheelEvent * event); - - void keyPressEvent(QKeyEvent *event); - - void keyReleaseEvent(QKeyEvent *event); - void loadData(KsDataStore *data, bool resetPlots); void loadColors(); @@ -214,6 +194,27 @@ public: /** Free the list of plugin-defined shapes. */ void freePluginShapes(); +protected: + void initializeGL() override; + + void resizeGL(int w, int h) override; + + void paintGL() override; + + void mousePressEvent(QMouseEvent *event) override; + + void mouseMoveEvent(QMouseEvent *event) override; + + void mouseReleaseEvent(QMouseEvent *event) override; + + void mouseDoubleClickEvent(QMouseEvent *event) override; + + void wheelEvent(QWheelEvent * event) override; + + void keyPressEvent(QKeyEvent *event) override; + + void keyReleaseEvent(QKeyEvent *event) override; + signals: /** * This signal is emitted when the mouse moves over a visible diff --git a/src/KsModels.hpp b/src/KsModels.hpp index 2883ce3..e113cf5 100644 --- a/src/KsModels.hpp +++ b/src/KsModels.hpp @@ -172,9 +172,6 @@ class KsFilterProxyModel : public QSortFilterProxyModel public: explicit KsFilterProxyModel(QObject *parent = nullptr); - bool filterAcceptsRow(int sourceRow, - const QModelIndex &sourceParent) const override; - void fill(KsDataStore *data); void setSource(KsViewModel *s); @@ -224,9 +221,13 @@ public: /** A mutex used by the condition variable. */ std::mutex _mutex; - /** A flag used to stop the serch for all threads. */ + /** A flag used to stop the search for all threads. */ bool _searchStop; +protected: + bool filterAcceptsRow(int sourceRow, + const QModelIndex &sourceParent) const override; + private: int _searchProgress; diff --git a/src/KsPlotTools.hpp b/src/KsPlotTools.hpp index 68bd6f7..8f53077 100644 --- a/src/KsPlotTools.hpp +++ b/src/KsPlotTools.hpp @@ -662,7 +662,7 @@ private: /** The vertical size (height) of the graphical element. */ int _height; - void _draw(const Color &col, float size) const; + void _draw(const Color &col, float size) const override; }; }; // KsPlot diff --git a/src/KsTraceViewer.hpp b/src/KsTraceViewer.hpp index 99e4d38..7cc5751 100644 --- a/src/KsTraceViewer.hpp +++ b/src/KsTraceViewer.hpp @@ -79,10 +79,6 @@ public: void setTopRow(size_t r); - void resizeEvent(QResizeEvent* event) override; - - void keyReleaseEvent(QKeyEvent *event); - void markSwitch(); void showRow(size_t r, bool mark); @@ -101,6 +97,11 @@ public: _model.loadColors(); } +protected: + void resizeEvent(QResizeEvent* event) override; + + void keyReleaseEvent(QKeyEvent *event) override; + signals: /** Signal emitted when new row is selected. */ void select(size_t); diff --git a/src/KsWidgetsLib.hpp b/src/KsWidgetsLib.hpp index cc2dc99..e21441d 100644 --- a/src/KsWidgetsLib.hpp +++ b/src/KsWidgetsLib.hpp @@ -261,20 +261,21 @@ public: */ int sd() const {return _sd;} + /** The user provided an input. The widget has been modified. */ + bool _userInput; + +protected: /** * Reimplemented event handler used to update the geometry of the widget on * resize events. */ - void resizeEvent(QResizeEvent* event) + void resizeEvent(QResizeEvent* event) override { KsUtils::setElidedText(&_streamLabel, _streamName, Qt::ElideLeft, width()); QApplication::processEvents(); } - /** The user provided an input. The widget has been modified. */ - bool _userInput; - protected: QToolBar _tb; From patchwork Sun Jan 14 17:16:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519219 Received: from smtpout3.mo529.mail-out.ovh.net (smtpout3.mo529.mail-out.ovh.net [46.105.54.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C48053AE for ; Sun, 14 Jan 2024 17:17:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.109.139.82]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id E11D32044F; Sun, 14 Jan 2024 17:17:37 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:36 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S0026e5b45bc-153e-4188-b817-4ca8d7bbb4b9, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 10/34] kernelshark: Use sliced() or first() instead of mid/right/left() Date: Sun, 14 Jan 2024 18:16:59 +0100 Message-ID: <20240114171723.14092-11-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: a6f81f6c-764c-4e66-b7c7-0ce3aa4796e6 X-Ovh-Tracer-Id: 1671116940802482074 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeouggvvhessggvnhhjrghrohgsihhnrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohephidrkhgrrhgrugiisehgmhgrihhlrdgtohhmpdhlihhnuhigqdhtrhgrtggvqdguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehvdelpdhmohguvgepshhmthhpohhuth Fix Clazy warning and it is faster. Signed-off-by: Benjamin ROBIN --- src/KsMainWindow.cpp | 2 +- src/KsUtils.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/KsMainWindow.cpp b/src/KsMainWindow.cpp index 68853d6..72ad371 100644 --- a/src/KsMainWindow.cpp +++ b/src/KsMainWindow.cpp @@ -1275,7 +1275,7 @@ void KsMainWindow::_load(const QString& fileName, bool append) pbLabel += fileName; } else { pbLabel += "..."; - pbLabel += fileName.mid(fileName.size() - 37, 37); + pbLabel += fileName.sliced(fileName.size() - 37); } setWindowTitle("Kernel Shark"); diff --git a/src/KsUtils.cpp b/src/KsUtils.cpp index a68e4c1..b84add4 100644 --- a/src/KsUtils.cpp +++ b/src/KsUtils.cpp @@ -534,8 +534,8 @@ QVector parseIdList(QString v_str) int i = item.indexOf('-'); if (i > 0) { /* This item is an interval. */ - int to = item.right(item.size() - i - 1).toInt(); - int from = item.left(i).toInt(); + int to = item.sliced(i + 1).toInt(); + int from = item.first(i).toInt(); int s = v.size(); v.resize(s + to - from + 1); From patchwork Sun Jan 14 17:17:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519243 Received: from smtpout2.mo529.mail-out.ovh.net (smtpout2.mo529.mail-out.ovh.net [79.137.123.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 25479D313 for ; Sun, 14 Jan 2024 17:25:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.109.139.82]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id 4E86220454; Sun, 14 Jan 2024 17:17:38 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:37 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S002126686b2-6824-4f8d-a664-6e313a433c7a, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 11/34] kernelshark: Prevent potential divide by zero in Shape::center() Date: Sun, 14 Jan 2024 18:17:00 +0100 Message-ID: <20240114171723.14092-12-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: 70ddaff6-5730-4ae6-a8e5-43873e05f87a X-Ovh-Tracer-Id: 1671116938216431514 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeouggvvhessggvnhhjrghrohgsihhnrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohephidrkhgrrhgrugiisehgmhgrihhlrdgtohhmpdhlihhnuhigqdhtrhgrtggvqdguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehvdelpdhmohguvgepshhmthhpohhuth Signed-off-by: Benjamin ROBIN --- src/KsPlotTools.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/KsPlotTools.cpp b/src/KsPlotTools.cpp index 1d63a9b..8011329 100644 --- a/src/KsPlotTools.cpp +++ b/src/KsPlotTools.cpp @@ -318,13 +318,15 @@ ksplot_point Shape::center() const { ksplot_point c = {0, 0}; - for (size_t i = 0; i < _nPoints; ++i) { - c.x += _points[i].x; - c.y += _points[i].y; - } + if (_nPoints > 0) { + for (size_t i = 0; i < _nPoints; ++i) { + c.x += _points[i].x; + c.y += _points[i].y; + } - c.x /= _nPoints; - c.y /= _nPoints; + c.x /= _nPoints; + c.y /= _nPoints; + } return c; } From patchwork Sun Jan 14 17:17:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519220 Received: from smtpout3.mo529.mail-out.ovh.net (smtpout3.mo529.mail-out.ovh.net [46.105.54.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8F1B53B9 for ; Sun, 14 Jan 2024 17:17:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.109.139.82]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id B454C20450; Sun, 14 Jan 2024 17:17:38 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:37 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S002bb2574f8-0b79-40a2-abbc-44a3059400e9, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 12/34] kernelshark: Fix potential access to uninitialized variable Date: Sun, 14 Jan 2024 18:17:01 +0100 Message-ID: <20240114171723.14092-13-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: d4e2a2e5-4f28-4d3a-9251-3817a9953219 X-Ovh-Tracer-Id: 1671398413905649562 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeouggvvhessggvnhhjrghrohgsihhnrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohephidrkhgrrhgrugiisehgmhgrihhlrdgtohhmpdhlihhnuhigqdhtrhgrtggvqdguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehvdelpdhmohguvgepshhmthhpohhuth If "nStreams" is zero, jstream may be accessed while uninitialized in KsSession::_savePlots() and in KsSession::_getPlots() Signed-off-by: Benjamin ROBIN --- src/KsSession.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/KsSession.cpp b/src/KsSession.cpp index b9edb3a..af86281 100644 --- a/src/KsSession.cpp +++ b/src/KsSession.cpp @@ -348,7 +348,7 @@ void KsSession::loadGraphs(kshark_context *kshark_ctx, void KsSession::_savePlots(int sd, KsGLWidget *glw, bool cpu) { kshark_config_doc *streamsConf = kshark_config_alloc(KS_CONFIG_JSON); - json_object *jallStreams, *jstream, *jstreamId, *jplots; + json_object *jallStreams, *jstream = nullptr, *jstreamId, *jplots; QVector plotIds; int nStreams; @@ -438,7 +438,7 @@ void KsSession::_saveComboPlots(KsGLWidget *glw) QVector KsSession::_getPlots(int sd, bool cpu) { kshark_config_doc *streamsConf = kshark_config_alloc(KS_CONFIG_JSON); - json_object *jallStreams, *jstream, *jstreamId, *jplots; + json_object *jallStreams, *jstream = nullptr, *jstreamId, *jplots; int nStreams, nPlots, id; const char *plotKey; QVector plots; From patchwork Sun Jan 14 17:17:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519224 Received: from smtpout3.mo529.mail-out.ovh.net (smtpout3.mo529.mail-out.ovh.net [46.105.54.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8EE55397 for ; Sun, 14 Jan 2024 17:17:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.109.139.82]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id 0CBE12044A; Sun, 14 Jan 2024 17:17:39 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:38 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S002f08b9de7-4b0e-4fe2-bdab-99c9f525f6bb, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 13/34] kernelshark: Remove unused locals variables Date: Sun, 14 Jan 2024 18:17:02 +0100 Message-ID: <20240114171723.14092-14-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: d51ea551-61f6-495f-aebf-96cc3ef9f2d0 X-Ovh-Tracer-Id: 1671398411719171994 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeouggvvhessggvnhhjrghrohgsihhnrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohephidrkhgrrhgrugiisehgmhgrihhlrdgtohhmpdhlihhnuhigqdhtrhgrtggvqdguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehvdelpdhmohguvgepshhmthhpohhuth Signed-off-by: Benjamin ROBIN --- src/KsTraceGraph.cpp | 1 - src/KsUtils.cpp | 1 - src/plugins/KVMComboDialog.cpp | 1 - 3 files changed, 3 deletions(-) diff --git a/src/KsTraceGraph.cpp b/src/KsTraceGraph.cpp index f80477d..bc910c8 100644 --- a/src/KsTraceGraph.cpp +++ b/src/KsTraceGraph.cpp @@ -331,7 +331,6 @@ void KsTraceGraph::_setPointerInfo(size_t i) QString aux(lanMakeString(kshark_get_aux_info(e))); QString info(lanMakeString(kshark_get_info(e))); QString comm(lanMakeString(kshark_get_task(e))); - QString elidedText; int labelWidth; uint64_t sec, usec; char *pointer; diff --git a/src/KsUtils.cpp b/src/KsUtils.cpp index b84add4..fc1fc52 100644 --- a/src/KsUtils.cpp +++ b/src/KsUtils.cpp @@ -1414,7 +1414,6 @@ void KsPluginManager::updatePlugins(int sd, QVector pluginStates) kshark_context *kshark_ctx(nullptr); kshark_data_stream *stream; kshark_dpi_list *plugin; - QVector vec; int i(0); if (!kshark_instance(&kshark_ctx)) diff --git a/src/plugins/KVMComboDialog.cpp b/src/plugins/KVMComboDialog.cpp index 6be68d4..99113ed 100644 --- a/src/plugins/KVMComboDialog.cpp +++ b/src/plugins/KVMComboDialog.cpp @@ -342,7 +342,6 @@ void KsComboPlotDialog::_guestStreamChanged(int) return; int newGuestId = _guestStreamComboBox.currentData().toInt(); - QVector vcpuCBs(_guestMapCount, 0); _plotMap[_currentGuestStream] = _streamCombos(_currentGuestStream); From patchwork Sun Jan 14 17:17:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519221 Received: from smtpout3.mo529.mail-out.ovh.net (smtpout3.mo529.mail-out.ovh.net [46.105.54.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C1DD5255 for ; Sun, 14 Jan 2024 17:17:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.109.139.82]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id 56DF120456; Sun, 14 Jan 2024 17:17:39 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:38 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S002727f8e6b-df22-400a-8879-157adbb62b00, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 14/34] kernelshark: Fix range-loop-reference Clazy warning Date: Sun, 14 Jan 2024 18:17:03 +0100 Message-ID: <20240114171723.14092-15-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: 7a3cc0ac-f7f4-4b34-9fd4-34de6f301b77 X-Ovh-Tracer-Id: 1671398413440147354 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeouggvvhessggvnhhjrghrohgsihhnrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohephidrkhgrrhgrugiisehgmhgrihhlrdgtohhmpdhlihhnuhigqdhtrhgrtggvqdguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehvdelpdhmohguvgepshhmthhpohhuth Signed-off-by: Benjamin ROBIN --- src/KsUtils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KsUtils.cpp b/src/KsUtils.cpp index fc1fc52..83f8f2e 100644 --- a/src/KsUtils.cpp +++ b/src/KsUtils.cpp @@ -530,7 +530,7 @@ QVector parseIdList(QString v_str) QStringList list = v_str.split(",", KS_SPLIT_SkipEmptyParts); QVector v; - for (auto item: list) { + for (const auto &item: list) { int i = item.indexOf('-'); if (i > 0) { /* This item is an interval. */ From patchwork Sun Jan 14 17:17:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519235 Received: from smtpout3.mo529.mail-out.ovh.net (smtpout3.mo529.mail-out.ovh.net [46.105.54.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8A40CA42 for ; Sun, 14 Jan 2024 17:25:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.109.139.82]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id 9E91720459; Sun, 14 Jan 2024 17:17:39 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:38 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S0021ddf4046-7fdf-49a7-929c-c7272719cabc, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 15/34] kernelshark: Fix moving a temp object prevents copy elision warning Date: Sun, 14 Jan 2024 18:17:04 +0100 Message-ID: <20240114171723.14092-16-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: 58406836-36c4-4ce8-847f-de5f7a050120 X-Ovh-Tracer-Id: 1671679890814885786 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeouggvvhessggvnhhjrghrohgsihhnrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohephidrkhgrrhgrugiisehgmhgrihhlrdgtohhmpdhlihhnuhigqdhtrhgrtggvqdguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehvdelpdhmohguvgepshhmthhpohhuth Signed-off-by: Benjamin ROBIN --- src/KsTraceViewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KsTraceViewer.cpp b/src/KsTraceViewer.cpp index d4c9dd9..5eec312 100644 --- a/src/KsTraceViewer.cpp +++ b/src/KsTraceViewer.cpp @@ -855,7 +855,7 @@ void KsTraceViewer::_searchItemsMT() QVector> res; for (auto &m: maps) - res.append(std::move(m.get())); + res.append(m.get()); lamSearchMerge(_matchList, res); } From patchwork Sun Jan 14 17:17:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519236 Received: from smtpout1.mo529.mail-out.ovh.net (smtpout1.mo529.mail-out.ovh.net [178.32.125.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21719CA71 for ; Sun, 14 Jan 2024 17:25:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.109.139.82]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id DA63020380; Sun, 14 Jan 2024 17:17:39 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:39 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S002ca9b1147-45c3-4dc3-8c70-e777ba93bede, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 16/34] kernelshark: Add receiver object to connect() call Date: Sun, 14 Jan 2024 18:17:05 +0100 Message-ID: <20240114171723.14092-17-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: 69a60af2-e2ba-4a45-a4ac-bd83075e4c22 X-Ovh-Tracer-Id: 1671679888791592858 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeouggvvhessggvnhhjrghrohgsihhnrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohephidrkhgrrhgrugiisehgmhgrihhlrdgtohhmpdhlihhnuhigqdhtrhgrtggvqdguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehvdelpdhmohguvgepshhmthhpohhuth When calling a lambda, this is recommended to pass the receiver object Signed-off-by: Benjamin ROBIN --- src/KsTraceViewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KsTraceViewer.cpp b/src/KsTraceViewer.cpp index 5eec312..5e8e63f 100644 --- a/src/KsTraceViewer.cpp +++ b/src/KsTraceViewer.cpp @@ -139,7 +139,7 @@ KsTraceViewer::KsTraceViewer(QWidget *parent) } }; connect(&_selectionModel, &QItemSelectionModel::selectionChanged, - lamSelectionChanged); + this, lamSelectionChanged); _searchFSM.placeInToolBar(&_toolbar); From patchwork Sun Jan 14 17:17:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519239 Received: from smtpout3.mo529.mail-out.ovh.net (smtpout3.mo529.mail-out.ovh.net [46.105.54.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD47FD30E for ; Sun, 14 Jan 2024 17:25:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.109.139.82]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id 390012045E; Sun, 14 Jan 2024 17:17:40 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:39 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S0029081479a-de7b-483c-81ba-cf070f184330, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 17/34] kernelshark: Return by reference the list of header in KsModels Date: Sun, 14 Jan 2024 18:17:06 +0100 Message-ID: <20240114171723.14092-18-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: 65f01ba9-5df2-4257-a4d9-1af284215310 X-Ovh-Tracer-Id: 1671679889031782298 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeouggvvhessggvnhhjrghrohgsihhnrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohephidrkhgrrhgrugiisehgmhgrihhlrdgtohhmpdhlihhnuhigqdhtrhgrtggvqdguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehvdelpdhmohguvgepshhmthhpohhuth Signed-off-by: Benjamin ROBIN --- src/KsModels.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KsModels.hpp b/src/KsModels.hpp index e113cf5..b95c6c1 100644 --- a/src/KsModels.hpp +++ b/src/KsModels.hpp @@ -81,7 +81,7 @@ public: void update(KsDataStore *data); /** Get the list of column's headers. */ - QStringList header() const {return _header;} + const QStringList& header() const {return _header;} QString getValueStr(int column, int row) const; From patchwork Sun Jan 14 17:17:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519210 Received: from smtpout1.mo529.mail-out.ovh.net (smtpout1.mo529.mail-out.ovh.net [178.32.125.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 271915398 for ; Sun, 14 Jan 2024 17:17:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.108.17.201]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id 9DBE72045C; Sun, 14 Jan 2024 17:17:40 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:39 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S0025dfc7a5d-5fa9-4e20-9766-f0dcaa465842, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 18/34] kernelshark: Fix detaching-temporary Clazy warning Date: Sun, 14 Jan 2024 18:17:07 +0100 Message-ID: <20240114171723.14092-19-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: eb165f13-b5c8-478d-a617-f559a82a66ad X-Ovh-Tracer-Id: 1671961365748146074 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpeelheegledvvdelheduvdegfeeftdeuvdefveffgedvtdevtdfgieffueektdelgeenucffohhmrghinhephhgvrgguvghrrdgrthenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeouggvvhessggvnhhjrghrohgsihhnrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohephidrkhgrrhgrugiisehgmhgrihhlrdgtohhmpdhlihhnuhigqdhtrhgrtggvqdguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehvdelpdhmohguvgepshhmthhpohhuth Use QList::at() instead of QList::operator[]() Signed-off-by: Benjamin ROBIN --- src/KsTraceViewer.cpp | 4 ++-- src/KsUtils.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/KsTraceViewer.cpp b/src/KsTraceViewer.cpp index 5e8e63f..86e9185 100644 --- a/src/KsTraceViewer.cpp +++ b/src/KsTraceViewer.cpp @@ -624,11 +624,11 @@ void KsTraceViewer::_resizeToContents() * column by hand. */ col = KsViewModel::TRACE_VIEW_COL_STREAM; - columnSize = STRING_WIDTH(_model.header()[col]) + FONT_WIDTH; + columnSize = STRING_WIDTH(_model.header().at(col)) + FONT_WIDTH; _view.setColumnWidth(col, columnSize); col = KsViewModel::TRACE_VIEW_COL_CPU; - columnSize = STRING_WIDTH(_model.header()[col]) + FONT_WIDTH * 2; + columnSize = STRING_WIDTH(_model.header().at(col)) + FONT_WIDTH * 2; _view.setColumnWidth(col, columnSize); col = KsViewModel::TRACE_VIEW_COL_INDEX; diff --git a/src/KsUtils.hpp b/src/KsUtils.hpp index 85f81c3..67af99a 100644 --- a/src/KsUtils.hpp +++ b/src/KsUtils.hpp @@ -25,10 +25,10 @@ #include "KsPlotTools.hpp" /** Macro providing the height of the screen in pixels. */ -#define SCREEN_HEIGHT QGuiApplication::screens()[0]->geometry().height() +#define SCREEN_HEIGHT QGuiApplication::screens().at(0)->geometry().height() /** Macro providing the width of the screen in pixels. */ -#define SCREEN_WIDTH QGuiApplication::screens()[0]->geometry().width() +#define SCREEN_WIDTH QGuiApplication::screens().at(0)->geometry().width() //! @cond Doxygen_Suppress From patchwork Sun Jan 14 17:17:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519237 Received: from smtpout1.mo529.mail-out.ovh.net (smtpout1.mo529.mail-out.ovh.net [178.32.125.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED7FECA69 for ; Sun, 14 Jan 2024 17:25:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.108.17.201]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id 0BA2A20455; Sun, 14 Jan 2024 17:17:41 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:40 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S0020980d522-e95e-4f6e-b7f6-1735def6f390, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 19/34] kernelshark: Fix qfileinfo-exists Clazy warning Date: Sun, 14 Jan 2024 18:17:08 +0100 Message-ID: <20240114171723.14092-20-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: 4ea60e09-1aaf-476d-9ae4-4757adb6b5d2 X-Ovh-Tracer-Id: 1671961365053333402 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgepfeefnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeihrdhkrghrrgguiiesghhmrghilhdrtghomhdplhhinhhugidqthhrrggtvgdquggvvhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhohedvledpmhhouggvpehsmhhtphhouhht Use static QFileInfo::exists() instead Signed-off-by: Benjamin ROBIN --- src/KsUtils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KsUtils.cpp b/src/KsUtils.cpp index 83f8f2e..792678d 100644 --- a/src/KsUtils.cpp +++ b/src/KsUtils.cpp @@ -471,7 +471,7 @@ QString getSaveFile(QWidget *parent, if (!fileName.isEmpty() && !fileName.endsWith(extension)) { fileName += extension; - if (QFileInfo(fileName).exists()) { + if (QFileInfo::exists(fileName)) { if (!KsWidgetsLib::fileExistsDialog(fileName)) fileName.clear(); } From patchwork Sun Jan 14 17:17:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519215 Received: from smtpout1.mo529.mail-out.ovh.net (smtpout1.mo529.mail-out.ovh.net [178.32.125.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 271675397 for ; Sun, 14 Jan 2024 17:17:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.108.17.201]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id 5FDDC20465; Sun, 14 Jan 2024 17:17:41 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:40 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S002c619219f-2ce2-4631-9106-44e180301dd7, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 20/34] kernelshark: Fix potential memory leaks in libkshark-configio Date: Sun, 14 Jan 2024 18:17:09 +0100 Message-ID: <20240114171723.14092-21-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: e1855602-598b-4a92-8427-dccade22d7ec X-Ovh-Tracer-Id: 1672242839095566234 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgepfeefnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeihrdhkrghrrgguiiesghhmrghilhdrtghomhdplhhinhhugidqthhrrggtvgdquggvvhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhohedvledpmhhouggvpehsmhhtphhouhht Allocate a new kshark_config_doc only if the format is supported. Signed-off-by: Benjamin ROBIN --- src/libkshark-configio.c | 74 ++++++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 33 deletions(-) diff --git a/src/libkshark-configio.c b/src/libkshark-configio.c index 9a1ba60..853e056 100644 --- a/src/libkshark-configio.c +++ b/src/libkshark-configio.c @@ -675,23 +675,25 @@ struct kshark_config_doc * kshark_export_plugin_file(struct kshark_plugin_list *plugin, enum kshark_config_formats format) { - /* Create a new Configuration document. */ - struct kshark_config_doc *conf = - kshark_config_new("kshark.config.library", format); - - if (!conf) - return NULL; + struct kshark_config_doc *conf; switch (format) { case KS_CONFIG_JSON: - kshark_plugin_to_json(plugin, conf->conf_doc); - return conf; + break; default: fprintf(stderr, "Document format %d not supported\n", - conf->format); + format); return NULL; } + + /* Create a new Configuration document. */ + conf = kshark_config_new("kshark.config.library", format); + if (!conf) + return NULL; + + kshark_plugin_to_json(plugin, conf->conf_doc); + return conf; } static bool kshark_all_plugins_to_json(struct kshark_context *kshark_ctx, @@ -739,22 +741,24 @@ struct kshark_config_doc * kshark_export_all_plugins(struct kshark_context *kshark_ctx, enum kshark_config_formats format) { - struct kshark_config_doc *conf = - kshark_config_new("kshark.config.plugins", KS_CONFIG_JSON); - - if (!conf) - return NULL; + struct kshark_config_doc *conf; switch (format) { case KS_CONFIG_JSON: - kshark_all_plugins_to_json(kshark_ctx, conf->conf_doc); - return conf; + break; default: fprintf(stderr, "Document format %d not supported\n", - conf->format); + format); return NULL; } + + conf = kshark_config_new("kshark.config.plugins", format); + if (!conf) + return NULL; + + kshark_all_plugins_to_json(kshark_ctx, conf->conf_doc); + return conf; } static bool kshark_plugin_from_json(struct kshark_context *kshark_ctx, @@ -867,22 +871,24 @@ struct kshark_config_doc * kshark_export_stream_plugins(struct kshark_data_stream *stream, enum kshark_config_formats format) { - struct kshark_config_doc *conf = - kshark_config_new("kshark.config.plugins", KS_CONFIG_JSON); - - if (!conf) - return NULL; + struct kshark_config_doc *conf; switch (format) { case KS_CONFIG_JSON: - kshark_stream_plugins_to_json(stream, conf->conf_doc); - return conf; + break; default: fprintf(stderr, "Document format %d not supported\n", - conf->format); + format); return NULL; } + + conf = kshark_config_new("kshark.config.plugins", KS_CONFIG_JSON); + if (!conf) + return NULL; + + kshark_stream_plugins_to_json(stream, conf->conf_doc); + return conf; } static bool kshark_stream_plugins_from_json(struct kshark_context *kshark_ctx, @@ -1019,23 +1025,25 @@ struct kshark_config_doc * kshark_export_model(struct kshark_trace_histo *histo, enum kshark_config_formats format) { - /* Create a new Configuration document. */ - struct kshark_config_doc *conf = - kshark_config_new("kshark.config.model", format); - - if (!conf) - return NULL; + struct kshark_config_doc *conf; switch (format) { case KS_CONFIG_JSON: - kshark_model_to_json(histo, conf->conf_doc); - return conf; + break; default: fprintf(stderr, "Document format %d not supported\n", format); return NULL; } + + /* Create a new Configuration document. */ + conf = kshark_config_new("kshark.config.model", format); + if (!conf) + return NULL; + + kshark_model_to_json(histo, conf->conf_doc); + return conf; } static bool kshark_model_from_json(struct kshark_trace_histo *histo, From patchwork Sun Jan 14 17:17:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519213 Received: from smtpout1.mo529.mail-out.ovh.net (smtpout1.mo529.mail-out.ovh.net [178.32.125.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E276B5399 for ; Sun, 14 Jan 2024 17:17:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.108.17.201]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id ABFAA2046A; Sun, 14 Jan 2024 17:17:41 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:41 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S002837e4b56-ac09-456f-b2c1-556e405f59c3, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 21/34] kernelshark: Fix potential access to uninitialized variable Date: Sun, 14 Jan 2024 18:17:10 +0100 Message-ID: <20240114171723.14092-22-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: dca7f67a-ab4a-4778-a3c3-b6b56b09d07b X-Ovh-Tracer-Id: 1672242840919105434 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgepfeefnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeihrdhkrghrrgguiiesghhmrghilhdrtghomhdplhhinhhugidqthhrrggtvgdquggvvhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhohedvledpmhhouggvpehsmhhtphhouhht Always call json_object_put() with a valid "jlist" pointer. Signed-off-by: Benjamin ROBIN --- src/libkshark-configio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libkshark-configio.c b/src/libkshark-configio.c index 853e056..49f957b 100644 --- a/src/libkshark-configio.c +++ b/src/libkshark-configio.c @@ -777,7 +777,7 @@ static bool kshark_plugin_from_json(struct kshark_context *kshark_ctx, static bool kshark_all_plugins_from_json(struct kshark_context *kshark_ctx, struct json_object *jobj) { - struct json_object *jlist, *jfile; + struct json_object *jlist = NULL, *jfile = NULL; int i, n_plugins; if (!kshark_ctx || !jobj) @@ -902,7 +902,7 @@ static bool kshark_stream_plugins_from_json(struct kshark_context *kshark_ctx, int i, n_plugins; bool active; - jplg = jname = jstatus = NULL; + jlist = jplg = jname = jstatus = NULL; if (!kshark_ctx || !stream || !jobj) return false; From patchwork Sun Jan 14 17:17:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519226 Received: from 3.mo552.mail-out.ovh.net (3.mo552.mail-out.ovh.net [178.33.254.192]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7119B569F for ; Sun, 14 Jan 2024 17:17:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.109.140.245]) by mo552.mail-out.ovh.net (Postfix) with ESMTPS id 0D3652A20E; Sun, 14 Jan 2024 17:17:42 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:41 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S002ad225f34-48aa-4942-a5bb-5d72537b1652, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 22/34] kernelshark: Fix potential double free of histo->map, histo->bin_count Date: Sun, 14 Jan 2024 18:17:11 +0100 Message-ID: <20240114171723.14092-23-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: 31e71fcd-4109-4b2d-aeb3-17582277a2fc X-Ovh-Tracer-Id: 1672242837577293722 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeouggvvhessggvnhhjrghrohgsihhnrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohephidrkhgrrhgrugiisehgmhgrihhlrdgtohhmpdhlihhnuhigqdhtrhgrtggvqdguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehhedvpdhmohguvgepshhmthhpohhuth Signed-off-by: Benjamin ROBIN --- src/libkshark-model.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libkshark-model.c b/src/libkshark-model.c index 44f829d..4cd9f6a 100644 --- a/src/libkshark-model.c +++ b/src/libkshark-model.c @@ -104,7 +104,8 @@ static void ksmodel_set_in_range_bining(struct kshark_trace_histo *histo, free(histo->bin_count); free(histo->map); - + histo->map = NULL; + histo->bin_count = NULL; return; } From patchwork Sun Jan 14 17:17:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519227 Received: from 3.mo552.mail-out.ovh.net (3.mo552.mail-out.ovh.net [178.33.254.192]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8159E5CB5 for ; Sun, 14 Jan 2024 17:17:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.109.140.245]) by mo552.mail-out.ovh.net (Postfix) with ESMTPS id 829AB29D99; Sun, 14 Jan 2024 17:17:42 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:41 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S0028acce6ab-4b34-4ade-b892-476d5ae529bd, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 23/34] kernelshark: Fix 'const' type qualifier on return type has no effect Date: Sun, 14 Jan 2024 18:17:12 +0100 Message-ID: <20240114171723.14092-24-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: be436c96-3e5f-4a39-850b-cfd545df8e1a X-Ovh-Tracer-Id: 1672524314129293210 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeouggvvhessggvnhhjrghrohgsihhnrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohephidrkhgrrhgrugiisehgmhgrihhlrdgtohhmpdhlihhnuhigqdhtrhgrtggvqdguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehhedvpdhmohguvgepshhmthhpohhuth Also fix clang build, which allow to execute Clang-Tidy and Clazy Signed-off-by: Benjamin ROBIN --- src/libkshark-tepdata.c | 12 ++++++------ src/libkshark.h | 20 ++++++++++---------- tests/test-input.c | 4 ++-- tests/test-input_ctrl.c | 4 ++-- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/libkshark-tepdata.c b/src/libkshark-tepdata.c index b780957..2d0fcb0 100644 --- a/src/libkshark-tepdata.c +++ b/src/libkshark-tepdata.c @@ -634,8 +634,8 @@ ssize_t kshark_load_tep_records(struct kshark_context *kshark_ctx, int sd, return -ENOMEM; } -static const int tepdata_get_event_id(struct kshark_data_stream *stream, - const struct kshark_entry *entry) +static int tepdata_get_event_id(struct kshark_data_stream *stream, + const struct kshark_entry *entry) { int event_id = KS_EMPTY_BIN; struct tep_record *record; @@ -727,8 +727,8 @@ static char *tepdata_get_event_name(struct kshark_data_stream *stream, return buffer; } -static const int tepdata_get_pid(struct kshark_data_stream *stream, - const struct kshark_entry *entry) +static int tepdata_get_pid(struct kshark_data_stream *stream, + const struct kshark_entry *entry) { struct tep_record *record; int pid = KS_EMPTY_BIN; @@ -1054,8 +1054,8 @@ static char *tepdata_dump_entry(struct kshark_data_stream *stream, return entry_str; } -static const int tepdata_find_event_id(struct kshark_data_stream *stream, - const char *event_name) +static int tepdata_find_event_id(struct kshark_data_stream *stream, + const char *event_name) { struct tep_event *event; char *buffer, *system, *name; diff --git a/src/libkshark.h b/src/libkshark.h index 1514f33..97d3227 100644 --- a/src/libkshark.h +++ b/src/libkshark.h @@ -142,8 +142,8 @@ typedef char *(*stream_get_str_func) (struct kshark_data_stream *, const struct kshark_entry *); /** A function type to be used by the method interface of the data stream. */ -typedef const int (*stream_get_int_func) (struct kshark_data_stream *, - const struct kshark_entry *); +typedef int (*stream_get_int_func) (struct kshark_data_stream *, + const struct kshark_entry *); /** A function type to be used by the method interface of the data stream. */ typedef int (*stream_find_id_func) (struct kshark_data_stream *, @@ -176,16 +176,16 @@ typedef kshark_event_field_format const char *); /** A function type to be used by the method interface of the data stream. */ -typedef const int (*stream_read_event_field) (struct kshark_data_stream *, - const struct kshark_entry *, - const char *, - int64_t *); +typedef int (*stream_read_event_field) (struct kshark_data_stream *, + const struct kshark_entry *, + const char *, + int64_t *); /** A function type to be used by the method interface of the data stream. */ -typedef const int (*stream_read_record_field) (struct kshark_data_stream *, - void *, - const char *, - int64_t *); +typedef int (*stream_read_record_field) (struct kshark_data_stream *, + void *, + const char *, + int64_t *); struct kshark_context; diff --git a/tests/test-input.c b/tests/test-input.c index 31620b9..c6a5fa2 100644 --- a/tests/test-input.c +++ b/tests/test-input.c @@ -69,8 +69,8 @@ bool KSHARK_INPUT_CHECK(const char *file, char **format) return false; } -static const int get_pid(struct kshark_data_stream *stream, - const struct kshark_entry *entry) +static int get_pid(struct kshark_data_stream *stream, + const struct kshark_entry *entry) { return entry->pid; } diff --git a/tests/test-input_ctrl.c b/tests/test-input_ctrl.c index 3dcc92e..77abab1 100644 --- a/tests/test-input_ctrl.c +++ b/tests/test-input_ctrl.c @@ -71,8 +71,8 @@ bool KSHARK_INPUT_CHECK(const char *file, char **format) return false; } -static const int get_pid(struct kshark_data_stream *stream, - const struct kshark_entry *entry) +static int get_pid(struct kshark_data_stream *stream, + const struct kshark_entry *entry) { return entry->pid; } From patchwork Sun Jan 14 17:17:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519228 Received: from 7.mo552.mail-out.ovh.net (7.mo552.mail-out.ovh.net [188.165.59.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C92FA5251 for ; Sun, 14 Jan 2024 17:17:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.109.140.245]) by mo552.mail-out.ovh.net (Postfix) with ESMTPS id D7D0B29EAE; Sun, 14 Jan 2024 17:17:42 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:42 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S002269d7859-3cad-4d88-8f90-67f7b8c7acdd, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 24/34] kernelshark: Fix potential memory leaks in libkshark-tepdata Date: Sun, 14 Jan 2024 18:17:13 +0100 Message-ID: <20240114171723.14092-25-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: 04f7ab3d-a3cf-48d4-b239-23f1f1ccd309 X-Ovh-Tracer-Id: 1672524314568384410 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeouggvvhessggvnhhjrghrohgsihhnrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohephidrkhgrrhgrugiisehgmhgrihhlrdgtohhmpdhlihhnuhigqdhtrhgrtggvqdguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehhedvpdhmohguvgepshhmthhpohhuth - In tepdata_get_field_names(), buffer was never free on error - In kshark_tep_open_buffer(), names were never free if kshark_get_data_stream() failed - In kshark_tep_open_buffer(), prevent any double free error with "name" and "file" fields of buffer_stream - In kshark_tep_init_all_buffers(), return failure code if failed to copy "name" and "file" fields of buffer_stream Signed-off-by: Benjamin ROBIN --- src/libkshark-tepdata.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/libkshark-tepdata.c b/src/libkshark-tepdata.c index 2d0fcb0..d15c155 100644 --- a/src/libkshark-tepdata.c +++ b/src/libkshark-tepdata.c @@ -949,6 +949,7 @@ static int tepdata_get_field_names(struct kshark_data_stream *stream, for (i = 0; i < nr_fields; ++i) free(buffer[i]); + free(buffer); return -EFAULT; } @@ -1424,8 +1425,10 @@ int kshark_tep_open_buffer(struct kshark_context *kshark_ctx, int sd, sd_buffer = kshark_add_stream(kshark_ctx); buffer_stream = kshark_get_data_stream(kshark_ctx, sd_buffer); - if (!buffer_stream) - return -EFAULT; + if (!buffer_stream) { + ret = -EFAULT; + goto fail; + } for (i = 0; i < n_buffers; ++i) { if (strcmp(buffer_name, names[i]) == 0) { @@ -1438,7 +1441,8 @@ int kshark_tep_open_buffer(struct kshark_context *kshark_ctx, int sd, if (!buffer_stream->name || !buffer_stream->file) { free(buffer_stream->name); free(buffer_stream->file); - + buffer_stream->name = NULL; + buffer_stream->file = NULL; ret = -ENOMEM; break; } @@ -1449,6 +1453,7 @@ int kshark_tep_open_buffer(struct kshark_context *kshark_ctx, int sd, } } +fail: for (i = 0; i < n_buffers; ++i) free(names[i]); free(names); @@ -1500,8 +1505,9 @@ int kshark_tep_init_all_buffers(struct kshark_context *kshark_ctx, if (!buffer_stream->name || !buffer_stream->file) { free(buffer_stream->name); free(buffer_stream->file); - ret = -ENOMEM; - break; + buffer_stream->name = NULL; + buffer_stream->file = NULL; + return -ENOMEM; } ret = kshark_tep_stream_init(buffer_stream, buffer_input); From patchwork Sun Jan 14 17:17:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519217 Received: from 5.mo552.mail-out.ovh.net (5.mo552.mail-out.ovh.net [188.165.45.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 314B75255 for ; Sun, 14 Jan 2024 17:17:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.109.140.245]) by mo552.mail-out.ovh.net (Postfix) with ESMTPS id 366842A21C; Sun, 14 Jan 2024 17:17:43 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:42 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S0022ed9e234-4f00-43e8-8130-d8b95d27f905, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 25/34] kernelshark: Fix typo in comment of KsGLWidget::resizeGL() Date: Sun, 14 Jan 2024 18:17:14 +0100 Message-ID: <20240114171723.14092-26-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: 0c9239eb-2b3a-41f1-83d4-1f5cb34e2a9a X-Ovh-Tracer-Id: 1672524315224924058 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeouggvvhessggvnhhjrghrohgsihhnrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohephidrkhgrrhgrugiisehgmhgrihhlrdgtohhmpdhlihhnuhigqdhtrhgrtggvqdguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehhedvpdhmohguvgepshhmthhpohhuth Signed-off-by: Benjamin ROBIN --- src/KsGLWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KsGLWidget.cpp b/src/KsGLWidget.cpp index dd9f41a..9311d98 100644 --- a/src/KsGLWidget.cpp +++ b/src/KsGLWidget.cpp @@ -93,7 +93,7 @@ void KsGLWidget::initializeGL() } /** - * Reimplemented function used to reprocess all graphs whene the widget has + * Reimplemented function used to reprocess all graphs when the widget has * been resized. */ void KsGLWidget::resizeGL(int w, int h) From patchwork Sun Jan 14 17:17:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519229 Received: from 1.mo552.mail-out.ovh.net (1.mo552.mail-out.ovh.net [178.32.96.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C8C3569F for ; Sun, 14 Jan 2024 17:17:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.109.148.134]) by mo552.mail-out.ovh.net (Postfix) with ESMTPS id 9E72A2A2C7; Sun, 14 Jan 2024 17:17:43 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:42 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S0029777e80d-5933-4f5a-81d7-e21dccda07ec, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 26/34] kernelshark: Remove unused KsDataWidget::wipPtr() and broken function Date: Sun, 14 Jan 2024 18:17:15 +0100 Message-ID: <20240114171723.14092-27-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: 76901da4-5465-4722-9698-6f6a9940dd57 X-Ovh-Tracer-Id: 1672805787614470042 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeouggvvhessggvnhhjrghrohgsihhnrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohephidrkhgrrhgrugiisehgmhgrihhlrdgtohhmpdhlihhnuhigqdhtrhgrtggvqdguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehhedvpdhmohguvgepshhmthhpohhuth Signed-off-by: Benjamin ROBIN --- src/KsWidgetsLib.hpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/KsWidgetsLib.hpp b/src/KsWidgetsLib.hpp index e21441d..48108cd 100644 --- a/src/KsWidgetsLib.hpp +++ b/src/KsWidgetsLib.hpp @@ -123,12 +123,6 @@ public: explicit KsDataWidget(QWidget *parent = nullptr) : QWidget(parent), _workInProgress(nullptr) {} - /** Set a pointer to the KsWorkInProgress widget. */ - const KsWorkInProgress *wipPtr(KsWorkInProgress *wip) const - { - return _workInProgress; - } - /** Set the pointer to the KsWorkInProgress widget. */ void setWipPtr(KsWorkInProgress *wip) { From patchwork Sun Jan 14 17:17:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519230 Received: from 9.mo552.mail-out.ovh.net (9.mo552.mail-out.ovh.net [87.98.180.222]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 683976118 for ; Sun, 14 Jan 2024 17:17:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.109.148.134]) by mo552.mail-out.ovh.net (Postfix) with ESMTPS id 11FE32A37F; Sun, 14 Jan 2024 17:17:44 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:43 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S0020a5cec83-aaa0-401f-88de-4fd84d4570e9, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 27/34] kernelshark: In KsTimeOffsetDialog() constructor use parent param Date: Sun, 14 Jan 2024 18:17:16 +0100 Message-ID: <20240114171723.14092-28-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: a16aae19-592c-45b2-801b-feb74746cf3f X-Ovh-Tracer-Id: 1672805790629322650 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgepuddunecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeihrdhkrghrrgguiiesghhmrghilhdrtghomhdplhhinhhugidqthhrrggtvgdquggvvhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheehvddpmhhouggvpehsmhhtphhouhht Pass parent parameter to QDialog() constructor Signed-off-by: Benjamin ROBIN --- src/KsWidgetsLib.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KsWidgetsLib.cpp b/src/KsWidgetsLib.cpp index 3ad93fa..5191c9f 100644 --- a/src/KsWidgetsLib.cpp +++ b/src/KsWidgetsLib.cpp @@ -209,7 +209,7 @@ bool fileExistsDialog(QString fileName) } /** Create KsTimeOffsetDialog. */ -KsTimeOffsetDialog::KsTimeOffsetDialog(QWidget *parent) +KsTimeOffsetDialog::KsTimeOffsetDialog(QWidget *parent) : QDialog(parent) { kshark_context *kshark_ctx(nullptr); QVector streamIds; From patchwork Sun Jan 14 17:17:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519223 Received: from 8.mo552.mail-out.ovh.net (8.mo552.mail-out.ovh.net [46.105.37.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2864A538D for ; Sun, 14 Jan 2024 17:17:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.109.148.134]) by mo552.mail-out.ovh.net (Postfix) with ESMTPS id 5A5662A28F; Sun, 14 Jan 2024 17:17:44 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:43 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S0021a475f12-1f84-4e08-b09a-60b3543db6a7, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 28/34] kernelshark: Fixed loop counter incremented suspiciously twice Date: Sun, 14 Jan 2024 18:17:17 +0100 Message-ID: <20240114171723.14092-29-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: f0d5b978-e5a6-44b8-86b5-bfd440253f01 X-Ovh-Tracer-Id: 1673087264126492570 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgepuddunecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeihrdhkrghrrgguiiesghhmrghilhdrtghomhdplhhinhhugidqthhrrggtvgdquggvvhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheehvddpmhhouggvpehsmhhtphhouhht Signed-off-by: Benjamin ROBIN --- examples/datafilter.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/examples/datafilter.c b/examples/datafilter.c index 38afab8..8e86d9c 100644 --- a/examples/datafilter.c +++ b/examples/datafilter.c @@ -69,7 +69,6 @@ int main(int argc, char **argv) /* Print to the screen the first 10 visible entries. */ count = 0; - i = 0; for (i = 0; i < n_rows; ++i) { if (data[i]->visible & KS_TEXT_VIEW_FILTER_MASK) { entry_str = kshark_dump_entry(data[i]); @@ -79,8 +78,6 @@ int main(int argc, char **argv) if (++count > 10) break; } - - ++i; } puts("\n\n"); @@ -102,7 +99,6 @@ int main(int argc, char **argv) /* Print to the screen the first 10 visible entries. */ count = 0; - i = 0; for (i = 0; i < n_rows; ++i) { if (data[i]->visible & KS_TEXT_VIEW_FILTER_MASK) { entry_str = kshark_dump_entry(data[i]); @@ -112,8 +108,6 @@ int main(int argc, char **argv) if (++count > 10) break; } - - ++i; } puts("\n\n"); From patchwork Sun Jan 14 17:17:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519231 Received: from 1.mo552.mail-out.ovh.net (1.mo552.mail-out.ovh.net [178.32.96.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72E75539E for ; Sun, 14 Jan 2024 17:17:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.108.9.159]) by mo552.mail-out.ovh.net (Postfix) with ESMTPS id BC6AE2A3EB; Sun, 14 Jan 2024 17:17:44 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:44 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S002e9cbf00c-244c-464c-8a1f-571ac5c27b29, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 29/34] kernelshark: Fix tepdata_dump_entry() for event_id = KS_EVENT_OVERFLOW Date: Sun, 14 Jan 2024 18:17:18 +0100 Message-ID: <20240114171723.14092-30-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: f20dbfc4-150a-496d-89a9-108651be5b92 X-Ovh-Tracer-Id: 1673087265044127642 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgepuddunecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeihrdhkrghrrgguiiesghhmrghilhdrtghomhdplhhinhhugidqthhrrggtvgdquggvvhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheehvddpmhhouggvpehsmhhtphhouhht Generated string was dropped, and did generate a memory leak, because of the missing break. Signed-off-by: Benjamin ROBIN --- src/libkshark-tepdata.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libkshark-tepdata.c b/src/libkshark-tepdata.c index d15c155..a178de6 100644 --- a/src/libkshark-tepdata.c +++ b/src/libkshark-tepdata.c @@ -1047,6 +1047,7 @@ static char *tepdata_dump_entry(struct kshark_data_stream *stream, case KS_EVENT_OVERFLOW: entry_str = tepdata_dump_custom_entry(stream, entry, missed_events_dump); + break; default: return NULL; } From patchwork Sun Jan 14 17:17:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519222 Received: from 5.mo552.mail-out.ovh.net (5.mo552.mail-out.ovh.net [188.165.45.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E83F25662 for ; Sun, 14 Jan 2024 17:17:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.108.9.159]) by mo552.mail-out.ovh.net (Postfix) with ESMTPS id 2C5072A37D; Sun, 14 Jan 2024 17:17:45 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:44 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S00227d44d02-349d-447d-bb0a-4cdfbd4ffd30, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 30/34] kernelshark: Use static_cast instead of C cast in KsMainWindow Date: Sun, 14 Jan 2024 18:17:19 +0100 Message-ID: <20240114171723.14092-31-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: da22d8d0-60fc-4492-a762-0858a7f38937 X-Ovh-Tracer-Id: 1673087264019013530 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgepuddunecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeihrdhkrghrrgguiiesghhmrghilhdrtghomhdplhhinhhugidqthhrrggtvgdquggvvhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheehvddpmhhouggvpehsmhhtphhouhht Signed-off-by: Benjamin ROBIN --- src/KsMainWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KsMainWindow.cpp b/src/KsMainWindow.cpp index 72ad371..72f4280 100644 --- a/src/KsMainWindow.cpp +++ b/src/KsMainWindow.cpp @@ -1546,7 +1546,7 @@ void KsMainWindow::_captureFinished(int ret, QProcess::ExitStatus st) void KsMainWindow::_captureError(QProcess::ProcessError error) { - QProcess *capture = (QProcess *)sender(); + QProcess *capture = static_cast(sender()); _captureErrorMessage(capture); } From patchwork Sun Jan 14 17:17:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519234 Received: from 3.mo552.mail-out.ovh.net (3.mo552.mail-out.ovh.net [178.33.254.192]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3D90D277 for ; Sun, 14 Jan 2024 17:23:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.108.9.223]) by mo552.mail-out.ovh.net (Postfix) with ESMTPS id AB6152A347; Sun, 14 Jan 2024 17:17:45 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:44 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S002165f2216-6439-4f02-ae3e-a9980ec345f7, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 31/34] kernelshark: Fix comparison of integers of different signs warnings Date: Sun, 14 Jan 2024 18:17:20 +0100 Message-ID: <20240114171723.14092-32-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: 9703c709-72e6-4c9d-a242-57f11a2e52d2 X-Ovh-Tracer-Id: 1673368739922993050 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgepuddunecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeihrdhkrghrrgguiiesghhmrghilhdrtghomhdplhhinhhugidqthhrrggtvgdquggvvhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheehvddpmhhouggvpehsmhhtphhouhht Most of them have been fixed, but a few still remain. Signed-off-by: Benjamin ROBIN --- examples/configio.c | 3 ++- examples/datafilter.c | 9 ++++++--- examples/datahisto.c | 2 +- src/libkshark-collection.c | 14 ++++++++------ src/libkshark-configio.c | 6 ++++-- src/libkshark-hash.c | 5 +++-- src/libkshark-model.c | 16 +++++++++------- src/libkshark-tepdata.c | 2 +- src/libkshark.c | 17 +++++++++-------- src/plugins/sched_events.c | 2 +- 10 files changed, 44 insertions(+), 32 deletions(-) diff --git a/examples/configio.c b/examples/configio.c index 9710d53..575211d 100644 --- a/examples/configio.c +++ b/examples/configio.c @@ -8,7 +8,8 @@ int main(int argc, char **argv) struct kshark_config_doc *conf, *filter, *hello; struct kshark_context *kshark_ctx; struct kshark_data_stream *stream; - int sd, *ids = NULL, i; + int sd, *ids = NULL; + size_t i; /* Create a new kshark session. */ kshark_ctx = NULL; diff --git a/examples/datafilter.c b/examples/datafilter.c index 8e86d9c..21a38fe 100644 --- a/examples/datafilter.c +++ b/examples/datafilter.c @@ -23,6 +23,7 @@ int main(int argc, char **argv) struct kshark_entry **data = NULL; int *pids, *evt_ids; char *entry_str; + int rt; /* Create a new kshark session. */ kshark_ctx = NULL; @@ -31,15 +32,17 @@ int main(int argc, char **argv) /* Open a trace data file produced by trace-cmd. */ if (argc > 1) - sd = kshark_open(kshark_ctx, argv[1]); + rt = kshark_open(kshark_ctx, argv[1]); else - sd = kshark_open(kshark_ctx, default_file); + rt = kshark_open(kshark_ctx, default_file); - if (sd < 0) { + if (rt < 0) { kshark_free(kshark_ctx); return 1; } + sd = (size_t)rt; + /* Load the content of the file into an array of entries. */ n_rows = kshark_load_entries(kshark_ctx, sd, &data); diff --git a/examples/datahisto.c b/examples/datahisto.c index 568072d..b54b9e9 100644 --- a/examples/datahisto.c +++ b/examples/datahisto.c @@ -70,7 +70,7 @@ void dump_bin(struct kshark_trace_histo *histo, int bin, int sd, void dump_histo(struct kshark_trace_histo *histo, int sd, const char *type, int val) { - size_t bin; + int bin; for (bin = 0; bin < histo->n_bins; ++bin) dump_bin(histo, bin, sd, type, val); diff --git a/src/libkshark-collection.c b/src/libkshark-collection.c index 915983b..2ce113f 100644 --- a/src/libkshark-collection.c +++ b/src/libkshark-collection.c @@ -518,14 +518,16 @@ static int map_collection_front_request(const struct kshark_entry_collection *col, struct kshark_entry_request *req) { - size_t req_first, req_end; - ssize_t col_index; + size_t req_first, req_end, col_index; + ssize_t r; int req_count; - col_index = map_collection_request_init(col, req, true, &req_end); - if (col_index == KS_EMPTY_BIN) + r = map_collection_request_init(col, req, true, &req_end); + if (r == KS_EMPTY_BIN) return 0; + col_index = (size_t)r; + /* * Now loop over the intervals of the collection going forwards till * the end of the inputted request and create a separate request for @@ -746,7 +748,7 @@ kshark_find_data_collection(struct kshark_entry_collection *col, while (col) { if (col->cond == cond && col->stream_id == sd && - col->n_val == n_val && + (size_t)col->n_val == n_val && val_compare(col->values, values, n_val)) return col; @@ -899,7 +901,7 @@ void kshark_unregister_data_collection(struct kshark_entry_collection **col, for (list = *col; list; list = list->next) { if (list->cond == cond && list->stream_id == sd && - list->n_val == n_val && + (size_t)list->n_val == n_val && val_compare(list->values, values, n_val)) { *last = list->next; kshark_free_data_collection(list); diff --git a/src/libkshark-configio.c b/src/libkshark-configio.c index 49f957b..0694e19 100644 --- a/src/libkshark-configio.c +++ b/src/libkshark-configio.c @@ -1117,7 +1117,8 @@ static bool kshark_event_filter_to_json(struct kshark_data_stream *stream, json_object *jfilter_data, *jname; struct kshark_hash_id *filter; char *name_str; - int i, *ids; + int *ids; + size_t i; filter = kshark_get_filter(stream, filter_type); if (!filter) @@ -1286,7 +1287,8 @@ static bool kshark_filter_array_to_json(struct kshark_hash_id *filter, struct json_object *jobj) { json_object *jfilter_data, *jpid = NULL; - int i, *ids; + int *ids; + size_t i; /* * If this Json document already contains a description of the filter, diff --git a/src/libkshark-hash.c b/src/libkshark-hash.c index 89c021b..d4f0a31 100644 --- a/src/libkshark-hash.c +++ b/src/libkshark-hash.c @@ -169,7 +169,7 @@ void kshark_hash_id_clear(struct kshark_hash_id *hash) { struct kshark_hash_id_item *item, *next; size_t size; - int i; + size_t i; if (!hash || ! hash->hash) return; @@ -212,7 +212,8 @@ int *kshark_hash_ids(struct kshark_hash_id *hash) { struct kshark_hash_id_item *item; size_t size = hash_size(hash); - int count = 0, i; + size_t i; + int count = 0; int *ids; if (!hash->count) diff --git a/src/libkshark-model.c b/src/libkshark-model.c index 4cd9f6a..2918567 100644 --- a/src/libkshark-model.c +++ b/src/libkshark-model.c @@ -97,6 +97,8 @@ static void ksmodel_set_in_range_bining(struct kshark_trace_histo *histo, int64_t corrected_range, delta_range, range = max - min; struct kshark_entry *last; + assert(min <= max); + if (n <= 0) { histo->n_bins = histo->bin_size = 0; histo->min = min; @@ -110,7 +112,7 @@ static void ksmodel_set_in_range_bining(struct kshark_trace_histo *histo, } /* The size of the bin must be >= 1, hence the range must be >= n. */ - if (range < n) { + if ((size_t)range < n) { range = n; max = min + n; } @@ -119,7 +121,7 @@ static void ksmodel_set_in_range_bining(struct kshark_trace_histo *histo, * If the number of bins changes, allocate memory for the descriptor of * the model. */ - if (n != histo->n_bins) { + if (n != (size_t)histo->n_bins) { if (!ksmodel_histo_alloc(histo, n)) { ksmodel_clear(histo); return; @@ -282,7 +284,7 @@ static void ksmodel_set_next_bin_edge(struct kshark_trace_histo *histo, * case we have to increase the size of the very last bin in order to * make sure that the last entry of the dataset will fall into it. */ - if (next_bin == histo->n_bins - 1) + if (next_bin == (size_t)(histo->n_bins - 1)) ++time_max; /* @@ -544,7 +546,7 @@ void ksmodel_shift_forward(struct kshark_trace_histo *histo, size_t n) void ksmodel_shift_backward(struct kshark_trace_histo *histo, size_t n) { size_t last_row = 0; - int bin; + size_t bin; if (!histo->data_size) return; @@ -561,7 +563,7 @@ void ksmodel_shift_backward(struct kshark_trace_histo *histo, size_t n) histo->min -= n * histo->bin_size; histo->max -= n * histo->bin_size; - if (n >= histo->n_bins) { + if (n >= (size_t)histo->n_bins) { /* * No overlap between the new and the old range. Recalculate * all bins from scratch. First calculate the new range. @@ -649,7 +651,7 @@ void ksmodel_jump_to(struct kshark_trace_histo *histo, int64_t ts) static void ksmodel_zoom(struct kshark_trace_histo *histo, double r, int mark, bool zoom_in) { - size_t range, min, max, delta_min; + int64_t range, min, max, delta_min; double delta_tot; if (!histo->data_size) @@ -668,7 +670,7 @@ static void ksmodel_zoom(struct kshark_trace_histo *histo, * Avoid overzooming. If needed, adjust the Scale factor to a the value * which provides bin_size >= 5. */ - if (zoom_in && (size_t) (range * (1. - r)) < histo->n_bins * 5) + if (zoom_in && (int)(range * (1. - r)) < (histo->n_bins * 5)) r = 1. - (histo->n_bins * 5.) / range; /* diff --git a/src/libkshark-tepdata.c b/src/libkshark-tepdata.c index a178de6..4171fab 100644 --- a/src/libkshark-tepdata.c +++ b/src/libkshark-tepdata.c @@ -239,7 +239,7 @@ static int get_next_pid(struct kshark_data_stream *stream, ret = tep_read_number_field(get_sched_next(stream), record->data, &val); - return ret ? : val; + return ret ? : (int)val; } static void register_command(struct kshark_data_stream *stream, diff --git a/src/libkshark.c b/src/libkshark.c index 44e553f..698b8d6 100644 --- a/src/libkshark.c +++ b/src/libkshark.c @@ -1371,9 +1371,10 @@ void kshark_clear_all_filters(struct kshark_context *kshark_ctx, { struct kshark_data_stream *stream; int *stream_ids, i; + size_t j; - for (i = 0; i < n_entries; ++i) - set_all_visible(&data[i]->visible); + for (j = 0; j < n_entries; ++j) + set_all_visible(&data[j]->visible); stream_ids = kshark_all_streams(kshark_ctx); for (i = 0; i < kshark_ctx->n_streams; i++) { @@ -1942,7 +1943,7 @@ kshark_merge_data_entries(struct kshark_entry_data_set *buffers, int n_buffers) return NULL; } - for (i = 0; i < n_buffers; ++i) { + for (i = 0; i < (size_t)n_buffers; ++i) { count[i] = 0; if (buffers[i].n_rows > 0) tot += buffers[i].n_rows; @@ -2111,7 +2112,7 @@ kshark_merge_data_matrices(struct kshark_matrix_data_set *buffers, int n_buffers { struct kshark_matrix_data_set merged_data; size_t i, tot = 0, count[n_buffers]; - int i_first; + int i_first, j; bool status; merged_data.n_rows = -1; @@ -2121,10 +2122,10 @@ kshark_merge_data_matrices(struct kshark_matrix_data_set *buffers, int n_buffers goto end; } - for (i = 0; i < n_buffers; ++i) { - count[i] = 0; - if (buffers[i].n_rows > 0) - tot += buffers[i].n_rows; + for (j = 0; j < n_buffers; ++j) { + count[j] = 0; + if (buffers[j].n_rows > 0) + tot += buffers[j].n_rows; } status = kshark_data_matrix_alloc(tot, &merged_data.event_array, diff --git a/src/plugins/sched_events.c b/src/plugins/sched_events.c index c3a4f47..a605fca 100644 --- a/src/plugins/sched_events.c +++ b/src/plugins/sched_events.c @@ -115,7 +115,7 @@ static void plugin_sched_swith_action(struct kshark_data_stream *stream, ret = tep_read_number_field(plugin_ctx->sched_switch_next_field, record->data, &next_pid); - if (ret == 0 && next_pid >= 0) { + if (ret == 0) { plugin_sched_set_pid(&ks_field, entry->pid); ret = tep_read_number_field(plugin_ctx->sched_switch_prev_state_field, From patchwork Sun Jan 14 17:17:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519232 Received: from 9.mo552.mail-out.ovh.net (9.mo552.mail-out.ovh.net [87.98.180.222]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B1618569F for ; Sun, 14 Jan 2024 17:17:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.108.9.223]) by mo552.mail-out.ovh.net (Postfix) with ESMTPS id 10E362A413; Sun, 14 Jan 2024 17:17:46 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:45 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S002b2d0a137-1930-426a-8ee2-68f42c9d8f03, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 32/34] kernelshark: Fix KsTableView columns width, and KsTraceViewer size Date: Sun, 14 Jan 2024 18:17:21 +0100 Message-ID: <20240114171723.14092-33-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: 80127158-60d5-4190-9a2c-af5a30e1883a X-Ovh-Tracer-Id: 1673368740826144666 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpeetgfdvtdeiudekffethfejiefggeevhfefveekheelhfduteeujeekiedtgfdtueenucffohhmrghinhepkhgvrhhnvghlrdhorhhgpdhhvggruggvrhdrrghtnecukfhppeduvdejrddtrddtrddupdefjedrheelrddugedvrddutdekpdelvddrudeiuddruddviedrgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeihrdhkrghrrgguiiesghhmrghilhdrtghomhdplhhinhhugidqthhrrggtvgdquggvvhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheehvddpmhhouggvpehsmhhtphhouhht - Use QSizePolicy::Expanding for KsTraceViewer object to use full height - Do not use StyleSheet for KsTableView. When the StyleSheet is updated Qt6 redraw the whole table but with default column width without querying items sizeHint(). So instead use QPalette::Highlight. - Simplify _resizeToContents() since the columns have a proper width with Qt6 Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=218351 Signed-off-by: Benjamin ROBIN --- src/KsTraceViewer.cpp | 67 ++++++++++++------------------------------- src/KsTraceViewer.hpp | 2 ++ 2 files changed, 20 insertions(+), 49 deletions(-) diff --git a/src/KsTraceViewer.cpp b/src/KsTraceViewer.cpp index 86e9185..93535a4 100644 --- a/src/KsTraceViewer.cpp +++ b/src/KsTraceViewer.cpp @@ -83,7 +83,7 @@ KsTraceViewer::KsTraceViewer(QWidget *parent) _mState(nullptr), _data(nullptr) { - this->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); + this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); /* Make a search toolbar. */ _toolbar.setOrientation(Qt::Horizontal); @@ -125,6 +125,7 @@ KsTraceViewer::KsTraceViewer(QWidget *parent) int defaultRowHeight = FONT_HEIGHT * 1.25; auto lamSelectionChanged = [this, defaultRowHeight] (const QItemSelection &selected, const QItemSelection &deselected) { + if (deselected.count()) { _view.verticalHeader()->resizeSection(deselected.indexes().first().row(), defaultRowHeight); @@ -208,33 +209,13 @@ void KsTraceViewer::loadData(KsDataStore *data) /** Connect the QTableView widget and the State machine of the Dual marker. */ void KsTraceViewer::setMarkerSM(KsDualMarkerSM *m) { - QString styleSheetA, styleSheetB; - _mState = m; _model.setMarkerColors(_mState->markerA()._color, _mState->markerB()._color); - /* - * Assign a property to State A of the Dual marker state machine. When - * the marker is in State A the background color of the selected row - * will be the same as the color of Marker A. - */ - styleSheetA = "selection-background-color : " + - _mState->markerA()._color.name() + ";"; - - _mState->stateAPtr()->assignProperty(&_view, "styleSheet", - styleSheetA); - - /* - * Assign a property to State B. When the marker is in State B the - * background color of the selected row will be the same as the color - * of Marker B. - */ - styleSheetB = "selection-background-color : " + - _mState->markerB()._color.name() + ";"; - - _mState->stateBPtr()->assignProperty(&_view, "styleSheet", - styleSheetB); + _viewPalette = _view.palette(); + _viewPalette.setColor(QPalette::Highlight, _mState->activeMarker()._color); + _view.setPalette(_viewPalette); } /** Reset (empty) the table. */ @@ -502,35 +483,38 @@ void KsTraceViewer::markSwitch() ssize_t row; /* The state of the Dual marker has changed. Get the new active marker. */ - DualMarkerState state = _mState->getState(); + DualMarkerState actState = _mState->getState(); + DualMarkerState pasState = !actState; /* First deal with the passive marker. */ - if (_mState->getMarker(!state)._isSet) { + KsGraphMark &pasMark = _mState->getMarker(pasState); + if (pasMark._isSet) { /* * The passive marker is set. Use the model to color the row of * the passive marker. */ - _model.selectRow(!state, _mState->getMarker(!state)._pos); + _model.selectRow(pasState, pasMark._pos); } else { /* * The passive marker is not set. * Make sure that the model colors nothing. */ - _model.selectRow(!state, KS_NO_ROW_SELECTED); + _model.selectRow(pasState, KS_NO_ROW_SELECTED); } /* * Now deal with the active marker. This has to be done after dealing * with the model, because changing the model clears the selection. */ - if (_mState->getMarker(state)._isSet) { + KsGraphMark &actMark = _mState->getMarker(actState); + if (actMark._isSet) { /* * The active marker is set. Use QTableView to select its row. * The index in the source model is used to retrieve the value * of the row number in the proxy model. */ - row =_mState->getMarker(state)._pos; + row = actMark._pos; QModelIndex index = _proxyModel.mapFromSource(_model.index(row, 0)); @@ -552,6 +536,9 @@ void KsTraceViewer::markSwitch() _view.clearSelection(); } + _viewPalette.setColor(QPalette::Highlight, actMark._color); + _view.setPalette(_viewPalette); + row = selectedRow(); if (row >= 0) { _setSearchIterator(row); @@ -604,7 +591,7 @@ void KsTraceViewer::keyReleaseEvent(QKeyEvent *event) void KsTraceViewer::_resizeToContents() { - int col, rows, columnSize, markRow = selectedRow(); + int markRow = selectedRow(); _view.setVisible(false); _view.resizeColumnsToContents(); @@ -617,24 +604,6 @@ void KsTraceViewer::_resizeToContents() */ if (markRow == KS_NO_ROW_SELECTED) _view.clearSelection(); - - /* - * Because of some unknown reason some of the columns doesn't get - * resized properly by the code above. We will resize this - * column by hand. - */ - col = KsViewModel::TRACE_VIEW_COL_STREAM; - columnSize = STRING_WIDTH(_model.header().at(col)) + FONT_WIDTH; - _view.setColumnWidth(col, columnSize); - - col = KsViewModel::TRACE_VIEW_COL_CPU; - columnSize = STRING_WIDTH(_model.header().at(col)) + FONT_WIDTH * 2; - _view.setColumnWidth(col, columnSize); - - col = KsViewModel::TRACE_VIEW_COL_INDEX; - rows = _model.rowCount({}); - columnSize = STRING_WIDTH(QString("%1").arg(rows)) + FONT_WIDTH; - _view.setColumnWidth(col, columnSize); } //! @cond Doxygen_Suppress diff --git a/src/KsTraceViewer.hpp b/src/KsTraceViewer.hpp index 7cc5751..9815787 100644 --- a/src/KsTraceViewer.hpp +++ b/src/KsTraceViewer.hpp @@ -123,6 +123,8 @@ private: KsTableView _view; + QPalette _viewPalette; + KsViewModel _model; KsFilterProxyModel _proxyModel; From patchwork Sun Jan 14 17:17:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519225 Received: from 8.mo552.mail-out.ovh.net (8.mo552.mail-out.ovh.net [46.105.37.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 45188568C for ; Sun, 14 Jan 2024 17:17:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.108.9.223]) by mo552.mail-out.ovh.net (Postfix) with ESMTPS id 6BB2A2A39F; Sun, 14 Jan 2024 17:17:46 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:45 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S00266303df0-95bb-406d-85fd-f132a868acd8, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 33/34] kernelshark: Allow to reduce a bit more the graph height Date: Sun, 14 Jan 2024 18:17:22 +0100 Message-ID: <20240114171723.14092-34-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: 92cd0f5d-2133-4375-b3b9-2283227f9647 X-Ovh-Tracer-Id: 1673650212025556890 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpefhueelfeduleffvedtjeduteeffeevieduueevueetkedugeffteejleegtdduffenucffohhmrghinheptghonhhtvghnthhsmhgrrhhgihhnshdrthhophenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeouggvvhessggvnhhjrghrohgsihhnrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohephidrkhgrrhgrugiisehgmhgrihhlrdgtohhmpdhlihhnuhigqdhtrhgrtggvqdguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehhedvpdhmohguvgepshhmthhpohhuth With this configuration, at least one core on the graph can be seen --- src/KsTraceGraph.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/KsTraceGraph.cpp b/src/KsTraceGraph.cpp index bc910c8..4599a12 100644 --- a/src/KsTraceGraph.cpp +++ b/src/KsTraceGraph.cpp @@ -593,8 +593,8 @@ void KsTraceGraph::updateGeom() _layout.contentsMargins().top() + _layout.contentsMargins().bottom(); - if (hMin > KS_GRAPH_HEIGHT * 8) - hMin = KS_GRAPH_HEIGHT * 8; + if (hMin > KS_GRAPH_HEIGHT * 6) + hMin = KS_GRAPH_HEIGHT * 6; setMinimumHeight(hMin); From patchwork Sun Jan 14 17:17:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin ROBIN X-Patchwork-Id: 13519233 Received: from 7.mo552.mail-out.ovh.net (7.mo552.mail-out.ovh.net [188.165.59.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2AE9E5399 for ; Sun, 14 Jan 2024 17:17:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benjarobin.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benjarobin.fr Received: from mxplan5.mail.ovh.net (unknown [10.108.9.223]) by mo552.mail-out.ovh.net (Postfix) with ESMTPS id BFC3D2A3ED; Sun, 14 Jan 2024 17:17:46 +0000 (UTC) Received: from benjarobin.fr (37.59.142.108) by DAG6EX2.mxp5.local (172.16.2.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 14 Jan 2024 18:17:46 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-108S0028589d1dd-f8d6-4613-b168-6c9e635a8b78, 5BE38D5D59959AD767059B58A5CDE138DFC9D9F8) smtp.auth=dev@benjarobin.fr X-OVh-ClientIp: 92.161.126.4 From: Benjamin ROBIN To: CC: , Benjamin ROBIN Subject: [PATCH 34/34] kernelshark: Cleanup of KsDualMarker methods Date: Sun, 14 Jan 2024 18:17:23 +0100 Message-ID: <20240114171723.14092-35-dev@benjarobin.fr> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240114171723.14092-1-dev@benjarobin.fr> References: <20240114171723.14092-1-dev@benjarobin.fr> Precedence: bulk X-Mailing-List: linux-trace-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG6EX2.mxp5.local (172.16.2.52) X-Ovh-Tracer-GUID: c5b92a38-7de5-4c3f-abb9-609ca25be3b4 X-Ovh-Tracer-Id: 1673650213980495770 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiledgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgtghisehtkeertdertddtnecuhfhrohhmpeeuvghnjhgrmhhinhcutffquefkpfcuoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqeenucggtffrrghtthgvrhhnpedtheetffeikedvjeegudelheelkeehheekgffgheehtdevjeffjedvgedtvefhjeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkedpledvrdduiedurdduvdeirdegnecuvehluhhsthgvrhfuihiivgepuddunecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoeguvghvsegsvghnjhgrrhhosghinhdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeihrdhkrghrrgguiiesghhmrghilhdrtghomhdplhhinhhugidqthhrrggtvgdquggvvhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheehvddpmhhouggvpehsmhhtphhouhht Remove stateAPtr and stateBPtr methods since no longer needed Signed-off-by: Benjamin ROBIN --- src/KsDualMarker.hpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/KsDualMarker.hpp b/src/KsDualMarker.hpp index 73c3960..e81d721 100644 --- a/src/KsDualMarker.hpp +++ b/src/KsDualMarker.hpp @@ -144,22 +144,16 @@ public: /** Get the marker B. */ KsGraphMark &markerB() {return _markB;} - /** Get a pointer to the State A object. */ - QState *stateAPtr() {return _stateA;} - - /** Get a pointer to the State B object. */ - QState *stateBPtr() {return _stateB;} - void updateMarkers(const KsDataStore &data, KsGLWidget *glw); void updateLabels(); /** Get the index inside the data array marker A points to. */ - ssize_t markerAPos() {return markerA()._isSet ? markerA()._pos : -1;} + ssize_t markerAPos() {return _markA._isSet ? _markA._pos : -1;} /** Get the index inside the data array marker B points to. */ - ssize_t markerBPos() {return markerB()._isSet ? markerB()._pos : -1;} + ssize_t markerBPos() {return _markB._isSet ? _markB._pos : -1;} signals: /**