From patchwork Tue Feb 12 17:03:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10808319 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AF5F3746 for ; Tue, 12 Feb 2019 17:04:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E8462C4A2 for ; Tue, 12 Feb 2019 17:04:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9304E2C4AA; Tue, 12 Feb 2019 17:04:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD17A2C4A6 for ; Tue, 12 Feb 2019 17:04:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729694AbfBLRE2 (ORCPT ); Tue, 12 Feb 2019 12:04:28 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:34889 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728353AbfBLRE2 (ORCPT ); Tue, 12 Feb 2019 12:04:28 -0500 Received: by mail-wm1-f65.google.com with SMTP id t200so3855552wmt.0 for ; Tue, 12 Feb 2019 09:04:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=TPzahrGxSiS7re5yq69qr922slzySdv8npjmVQB6tq0=; b=SOvwCdQvpuY7Y0Nj9tdHYGnRO69fv7kq08V/CaB3LNF+VtGVOX9cJYlgBfrpWQxXBz tqIf8asBcm75et/qIgEHBx78caOchnaW34sH+rZx4gMy0TkfJuDaziwjEwTH9CJ7Dplv waYt9Lqg3nO+nsev9OnA68abPXYHRsSQigeZ99NXc4vwkqcj7Aq8ZYRkFcteDPFH0UzW joslXsl8G/JqdlBy0Yn5/3DUWyuvFbIVZZgLr4IbbNYQ8ZgSD8jUnoO0QSOpVLiUsjYJ QYvVgzVZMrD+hTblxV3hYApVtcreH6J3PKhE7wT+fEg5CPOqzoBAlyXDmvyzos114rst rlXA== X-Gm-Message-State: AHQUAuY+YoIJCacAQq/yUXArHAN7qgyzlkJlnqG1fnzLsG0oEU4DbL4+ S0hVbmDd8tDHKwCZ1T2UlfU= X-Google-Smtp-Source: AHgI3IZz3ALqcpRotvMEAeb89R2K6jVAA3UcDmWKKgM8nNljjuQCNpy2fmYHChT13XMdcNgejab1EQ== X-Received: by 2002:a1c:6788:: with SMTP id b130mr40889wmc.102.1549991065870; Tue, 12 Feb 2019 09:04:25 -0800 (PST) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id c139sm5579732wmd.13.2019.02.12.09.04.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Feb 2019 09:04:25 -0800 (PST) From: Yordan Karadzhov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, Yordan Karadzhov Subject: [PATCH 1/5] kernel-shark: Customize the marker switching button Date: Tue, 12 Feb 2019 19:03:58 +0200 Message-Id: <20190212170402.10104-2-ykaradzhov@vmware.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190212170402.10104-1-ykaradzhov@vmware.com> References: <20190212170402.10104-1-ykaradzhov@vmware.com> Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The handler for "mouse press events" in the customized button is reimplemented in order to provide the emission of a "deselect" signal in the case of right mouse click. Two additional signals are defined in KsDualMarkerSM. Those signals are used to re-emit the "deselect" signals of the two marker buttons. Later (in another patch) the signals will be connected to methods where the actual deselection of the markers will take place. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202327 Signed-off-by: Yordan Karadzhov --- kernel-shark/src/KsDualMarker.cpp | 21 ++++++++++++++ kernel-shark/src/KsDualMarker.hpp | 46 +++++++++++++++++++++++++++++-- 2 files changed, 65 insertions(+), 2 deletions(-) diff --git a/kernel-shark/src/KsDualMarker.cpp b/kernel-shark/src/KsDualMarker.cpp index dbeb923..43bc177 100644 --- a/kernel-shark/src/KsDualMarker.cpp +++ b/kernel-shark/src/KsDualMarker.cpp @@ -12,6 +12,21 @@ #include "KsDualMarker.hpp" #include "KsGLWidget.hpp" +/** + * Reimplemented handler for mouse press events. Right mouse click events will + * deselect the corresponding marker. + */ +void KsMarkerButton::mousePressEvent(QMouseEvent *e) +{ + if(e->button() == Qt::RightButton) { + emit deselect(); + + return; + } + + QPushButton::mousePressEvent(e); +} + /** * @brief Create KsGraphMark object. * @@ -178,6 +193,9 @@ KsDualMarkerSM::KsDualMarkerSM(QWidget *parent) connect(&_buttonB, &QPushButton::clicked, this, &KsDualMarkerSM::_doStateB); + connect(&_buttonB, &KsMarkerButton::deselect, + this, &KsDualMarkerSM::deselectB); + /* Define transitions from State B to State A. */ _stateB->addTransition(this, &KsDualMarkerSM::machineToA, _stateA); @@ -192,6 +210,9 @@ KsDualMarkerSM::KsDualMarkerSM(QWidget *parent) connect(&_buttonA, &QPushButton::clicked, this, &KsDualMarkerSM::_doStateA); + connect(&_buttonA, &KsMarkerButton::deselect, + this, &KsDualMarkerSM::deselectA); + _machine.addState(_stateA); _machine.addState(_stateB); _machine.setInitialState(_stateA); diff --git a/kernel-shark/src/KsDualMarker.hpp b/kernel-shark/src/KsDualMarker.hpp index 73d4f8a..597bddb 100644 --- a/kernel-shark/src/KsDualMarker.hpp +++ b/kernel-shark/src/KsDualMarker.hpp @@ -19,6 +19,36 @@ #include "KsUtils.hpp" #include "KsPlotTools.hpp" +/** + * The Marker Button class provides a button that deselect the corresponding + * marker in the case of a Right mouse click. + */ +class KsMarkerButton : public QPushButton +{ + Q_OBJECT +public: + /** + * @brief Create a default button. + */ + explicit KsMarkerButton(QWidget *parent = nullptr) + : QPushButton(parent) {} + + /** + * @brief Create a button with text. + */ + explicit KsMarkerButton(const QString &text, QWidget *parent = nullptr) + : QPushButton(text, parent) {} + + void mousePressEvent(QMouseEvent *e); + +signals: + /** + * This signal is emitted when the button is click by the Right mouse + * button. + */ + void deselect(); +}; + class KsGLWidget; /** The KsGraphMark represents a marker for KernelShark GUI. */ @@ -161,10 +191,22 @@ signals: */ void machineToB(); + /** + * This signal is used to re-emitted the deselect signal of the + * Marker A button. + */ + void deselectA(); + + /** + * This signal is used to re-emitted the deselect signal of the + * Marker B button. + */ + void deselectB(); + private: - QPushButton _buttonA; + KsMarkerButton _buttonA; - QPushButton _buttonB; + KsMarkerButton _buttonB; QLabel _labelMA, _labelMB, _labelDelta; From patchwork Tue Feb 12 17:03:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10808317 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 33874922 for ; Tue, 12 Feb 2019 17:04:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 22FA52C0B3 for ; Tue, 12 Feb 2019 17:04:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 172B62C4A9; Tue, 12 Feb 2019 17:04:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB2512C492 for ; Tue, 12 Feb 2019 17:04:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728353AbfBLRE3 (ORCPT ); Tue, 12 Feb 2019 12:04:29 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:40510 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729617AbfBLRE3 (ORCPT ); Tue, 12 Feb 2019 12:04:29 -0500 Received: by mail-wm1-f66.google.com with SMTP id q21so3814021wmc.5 for ; Tue, 12 Feb 2019 09:04:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Ps63Xwwi5nXjvOYWpthjWVngj8bBpJNpSe9YgwRom0U=; b=LnW1wlwG90HaKLWd5kPESGLotWJh6jD2kvZOjyzqEP6gdevugggYCeTxYg8FEa3KDn bVJNmYBCW7g7m/Vxp3bqracwEO9BvmuYPR2Av/6QOFZ7Owi4SOI2DWbGykIe6rHGQfSE DeHz9ZeaS5aovcey7c2s829jnuDzTBoExk9V9g4Fdo7yjgFLhBqbAFayXfnflvF5/ziz tHd1koBbu6B61liZhs+Uup18/HuQtw0+HXgQmTcnbZFssMFY197ofxnZwpuiUbkPemnB YC+yCoVxPHIl9MWX9JPH87VVPX0ORdfI1Fu95PaUp1MkDJpENahX2QLp64CLAeizMBPt BKrA== X-Gm-Message-State: AHQUAuaB6J/l3A7ZHPKNiT6fKhFekLSs+rLDoeSMAdZu0u+E834SU4ts t7tN7IBAs9LOO1w52gC4W8I= X-Google-Smtp-Source: AHgI3IalFq/f5wudkbYjWM/KUA4/XgaZlCC+zDrOw8N71mpl/1DEZA4L8kYBbCQsZ5OqLCUVML4kiw== X-Received: by 2002:a1c:9cce:: with SMTP id f197mr3655432wme.135.1549991067581; Tue, 12 Feb 2019 09:04:27 -0800 (PST) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id c139sm5579732wmd.13.2019.02.12.09.04.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Feb 2019 09:04:27 -0800 (PST) From: Yordan Karadzhov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, Yordan Karadzhov Subject: [PATCH 2/5] kernel-shark: Define a method in View for selecting the Passive marker Date: Tue, 12 Feb 2019 19:03:59 +0200 Message-Id: <20190212170402.10104-3-ykaradzhov@vmware.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190212170402.10104-1-ykaradzhov@vmware.com> References: <20190212170402.10104-1-ykaradzhov@vmware.com> Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The same method can be used to deselect the Passive marker. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202327 Signed-off-by: Yordan Karadzhov --- kernel-shark/src/KsTraceViewer.cpp | 16 ++++++++++++++++ kernel-shark/src/KsTraceViewer.hpp | 2 ++ 2 files changed, 18 insertions(+) diff --git a/kernel-shark/src/KsTraceViewer.cpp b/kernel-shark/src/KsTraceViewer.cpp index 369c78e..61d7386 100644 --- a/kernel-shark/src/KsTraceViewer.cpp +++ b/kernel-shark/src/KsTraceViewer.cpp @@ -704,6 +704,22 @@ void KsTraceViewer::_searchItemsMapReduce(int column, lamSearchReduce(_matchList, m.get()); } +/** + * @brief Color (select) the given row in the table, by using the color of the + * Passive marker. + * + * @param row: The row index. If the Passive marker is selected and the input + * value is negative, the Passive marker will be deselected. + */ +void KsTraceViewer::passiveMarkerSelectRow(int row) +{ + DualMarkerState state = _mState->getState(); + + _view.setVisible(false); + _model.selectRow(!state, row); + _view.setVisible(true); +} + /** * Get the currently selected row. If no row is selected the function * returns -1. diff --git a/kernel-shark/src/KsTraceViewer.hpp b/kernel-shark/src/KsTraceViewer.hpp index f59f5df..cf529ba 100644 --- a/kernel-shark/src/KsTraceViewer.hpp +++ b/kernel-shark/src/KsTraceViewer.hpp @@ -68,6 +68,8 @@ public: void clearSelection(); + void passiveMarkerSelectRow(int row); + int selectedRow(); void update(KsDataStore *data); From patchwork Tue Feb 12 17:04:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10808321 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8D71C922 for ; Tue, 12 Feb 2019 17:04:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B8B42C1DC for ; Tue, 12 Feb 2019 17:04:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A3242C4A9; Tue, 12 Feb 2019 17:04:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BD042C1DC for ; Tue, 12 Feb 2019 17:04:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729725AbfBLREb (ORCPT ); Tue, 12 Feb 2019 12:04:31 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:52744 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729617AbfBLREb (ORCPT ); Tue, 12 Feb 2019 12:04:31 -0500 Received: by mail-wm1-f67.google.com with SMTP id m1so3817496wml.2 for ; Tue, 12 Feb 2019 09:04:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QYicw5VDqn+MF+hSVCde3FK9OxX3udBbcb0GTkFM/F8=; b=saK4ByXXYGBLMqUBv7j2tC//vAGF+dG9hMPw6J5KvRr+DfpCbqQ+PIiLNO/KabwCFv opkOMbdZiW6YYs54Lx0pu4j3HrrnMl12rOvLRwUzeZllu/qO0APdeCtfFq6zPqNNX/ru oruN2wU8TiO9H8RxOn/zpms8PyYSQmuZ8RK3jfONgWGEnT6BWHayhX0QQ/8UHku728rF LPmt4aoBnsCX5rPjjMMWijscVPkGehN+9OAzWeIQo6DZOTo/QpfNhMSP1KhXG+rpAdKl TNgCR9S/8lJj5jqxvwYaafqTkOgr9aPlJDwN6xckqno/vZeLkMAcYYQxWtWxtZMqv9vJ nI3A== X-Gm-Message-State: AHQUAuYegQln1n+iB6tSXKwGMfU2//AecY7gAZQKMMVX8Blga141YZfi je9pHncMtiz/haenjbwgbxc= X-Google-Smtp-Source: AHgI3Ibju0dq8u5lwpHuLtfe9ZHo9Tr7woMDCh8qyijgUjAOktWZqzEKNwKoL/IB9Et4iAJXsSPH2A== X-Received: by 2002:a1c:9c0a:: with SMTP id f10mr3749499wme.73.1549991069256; Tue, 12 Feb 2019 09:04:29 -0800 (PST) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id c139sm5579732wmd.13.2019.02.12.09.04.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Feb 2019 09:04:28 -0800 (PST) From: Yordan Karadzhov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, Yordan Karadzhov Subject: [PATCH 3/5] kernel-shark: Define KS_NO_ROW_SELECTED as a negative row index (-1) Date: Tue, 12 Feb 2019 19:04:00 +0200 Message-Id: <20190212170402.10104-4-ykaradzhov@vmware.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190212170402.10104-1-ykaradzhov@vmware.com> References: <20190212170402.10104-1-ykaradzhov@vmware.com> Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently the model of the table treats any negative value of the Passive Marker index as "No Row is Selected". In multiple places in the code the value of "-1" is used in order to deselecting the marker. Defining a dedicated constant (KS_NO_ROW_SELECTED), to be used for deselecting the Passive Marker will make the code more readable and robust. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202327 Signed-off-by: Yordan Karadzhov --- kernel-shark/src/KsModels.cpp | 8 ++++---- kernel-shark/src/KsModels.hpp | 3 +++ kernel-shark/src/KsTraceViewer.cpp | 6 +++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/kernel-shark/src/KsModels.cpp b/kernel-shark/src/KsModels.cpp index 1b68143..b89fee8 100644 --- a/kernel-shark/src/KsModels.cpp +++ b/kernel-shark/src/KsModels.cpp @@ -199,8 +199,8 @@ KsViewModel::KsViewModel(QObject *parent) _nRows(0), _header({"#", "CPU", "Time Stamp", "Task", "PID", "Latency", "Event", "Info"}), - _markA(-1), - _markB(-1) + _markA(KS_NO_ROW_SELECTED), + _markB(KS_NO_ROW_SELECTED) {} /** @@ -311,10 +311,10 @@ void KsViewModel::selectRow(DualMarkerState state, int row) { if (state == DualMarkerState::A) { _markA = row; - _markB = -1; + _markB = KS_NO_ROW_SELECTED; } else { _markB = row; - _markA = -1; + _markA = KS_NO_ROW_SELECTED; } } diff --git a/kernel-shark/src/KsModels.hpp b/kernel-shark/src/KsModels.hpp index 808c574..3faaf4a 100644 --- a/kernel-shark/src/KsModels.hpp +++ b/kernel-shark/src/KsModels.hpp @@ -28,6 +28,9 @@ #include "libkshark-model.h" #include "KsSearchFSM.hpp" +/** A negative row index, to be used for deselecting the Passive Marker. */ +#define KS_NO_ROW_SELECTED -1 + enum class DualMarkerState; class KsDataStore; diff --git a/kernel-shark/src/KsTraceViewer.cpp b/kernel-shark/src/KsTraceViewer.cpp index 61d7386..2881bd0 100644 --- a/kernel-shark/src/KsTraceViewer.cpp +++ b/kernel-shark/src/KsTraceViewer.cpp @@ -474,7 +474,7 @@ void KsTraceViewer::markSwitch() * The passive marker is not set. * Make sure that the model colors nothing. */ - _model.selectRow(!state, -1); + _model.selectRow(!state, KS_NO_ROW_SELECTED); } /* @@ -722,12 +722,12 @@ void KsTraceViewer::passiveMarkerSelectRow(int row) /** * Get the currently selected row. If no row is selected the function - * returns -1. + * returns KS_NO_ROW_SELECTED (-1). */ int KsTraceViewer::selectedRow() { QItemSelectionModel *sm = _view.selectionModel(); - int dataRow = -1; + int dataRow = KS_NO_ROW_SELECTED; if (sm->hasSelection()) { /* Only one row at the time can be selected. */ From patchwork Tue Feb 12 17:04:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10808323 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 721B4922 for ; Tue, 12 Feb 2019 17:04:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60CFC2C4A6 for ; Tue, 12 Feb 2019 17:04:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 558A22C49F; Tue, 12 Feb 2019 17:04:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF3882C48B for ; Tue, 12 Feb 2019 17:04:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729617AbfBLREc (ORCPT ); Tue, 12 Feb 2019 12:04:32 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:40410 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729700AbfBLREc (ORCPT ); Tue, 12 Feb 2019 12:04:32 -0500 Received: by mail-wr1-f66.google.com with SMTP id q1so3512277wrp.7 for ; Tue, 12 Feb 2019 09:04:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0Hx1wgVdc1G6EHiAOFyWhFcEZrPnlmzgJ43u/19ITrA=; b=IJwZCBpfefcBrRNPWTTRvNxjsEATkB7rc8xwLjRezyJsepe/Sy7TR83zWGfgKudyd1 vpamEThgLvZazD8EOvV9ENHrjHHC8skHNRnUDULz+HKewcHlMVOxC2OKl2tFpAzua/T5 PqOSMApMOFsDL7xycGl/DAmHZ9jPZVvH3lV9yQQo4guhgNAtQ8NYRKr5xmc2SMgT+qXb SVrg84+h97loPknlVCQapize7Fniv1H89ZStn5BbVU593hD07Bky34KF+1FcuDNvZO9Q jiJt8aqDG3hCRSBrd28J7mTAFiqq0LKF+pEsQWXuln59HqbtKzJJh0TY8HqkKIHJS6m9 YnDA== X-Gm-Message-State: AHQUAubgiYJXr7fmZ5JmDg12UyzBLxxNv5zBYMe8YGSFq3i2jMdOjTgM wogniSVzqHK0svlvL0PpFXw= X-Google-Smtp-Source: AHgI3IagxvINaSxQQY9A2p8pV8MHkYETMVUxvD6nYFHRaRZQ2sJWj0sNmIBdLXNvSkNTlc9LCntuGQ== X-Received: by 2002:adf:e706:: with SMTP id c6mr3682597wrm.278.1549991070810; Tue, 12 Feb 2019 09:04:30 -0800 (PST) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id c139sm5579732wmd.13.2019.02.12.09.04.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Feb 2019 09:04:30 -0800 (PST) From: Yordan Karadzhov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, Yordan Karadzhov Subject: [PATCH 4/5] kernel-shark-qt: Do marker-deselect by right mouse click of the button Date: Tue, 12 Feb 2019 19:04:01 +0200 Message-Id: <20190212170402.10104-5-ykaradzhov@vmware.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190212170402.10104-1-ykaradzhov@vmware.com> References: <20190212170402.10104-1-ykaradzhov@vmware.com> Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Methods for deselecting Marker A and B are added to KsMainWindow. Those methods are connected to the "deselect" signals of the two marker buttons. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202327 Signed-off-by: Yordan Karadzhov --- kernel-shark/src/KsMainWindow.cpp | 30 ++++++++++++++++++++++++++++++ kernel-shark/src/KsMainWindow.hpp | 4 ++++ 2 files changed, 34 insertions(+) diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp index 06770d9..443b7b0 100644 --- a/kernel-shark/src/KsMainWindow.cpp +++ b/kernel-shark/src/KsMainWindow.cpp @@ -119,6 +119,12 @@ KsMainWindow::KsMainWindow(QWidget *parent) connect(&_deselectShortcut, &QShortcut::activated, this, &KsMainWindow::_deselect); + connect(&_mState, &KsDualMarkerSM::deselectA, + this, &KsMainWindow::_deselectA); + + connect(&_mState, &KsDualMarkerSM::deselectB, + this, &KsMainWindow::_deselectB); + _resizeEmpty(); } @@ -1137,3 +1143,27 @@ void KsMainWindow::_deselect() _mState.updateLabels(); _graph.glPtr()->model()->update(); } + +void KsMainWindow::_deselectA() +{ + if (_mState.getState() == DualMarkerState::A) + _view.clearSelection(); + else + _view.passiveMarkerSelectRow(KS_NO_ROW_SELECTED); + + _mState.markerA().remove(); + _mState.updateLabels(); + _graph.glPtr()->model()->update(); +} + +void KsMainWindow::_deselectB() +{ + if (_mState.getState() == DualMarkerState::B) + _view.clearSelection(); + else + _view.passiveMarkerSelectRow(KS_NO_ROW_SELECTED); + + _mState.markerB().remove(); + _mState.updateLabels(); + _graph.glPtr()->model()->update(); +} diff --git a/kernel-shark/src/KsMainWindow.hpp b/kernel-shark/src/KsMainWindow.hpp index 44f7dd7..abfe196 100644 --- a/kernel-shark/src/KsMainWindow.hpp +++ b/kernel-shark/src/KsMainWindow.hpp @@ -218,6 +218,10 @@ private: void _deselect(); + void _deselectA(); + + void _deselectB(); + void _updateFilterMenu(); void _filterSyncCBoxUpdate(kshark_context *kshark_ctx); From patchwork Tue Feb 12 17:04:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10808325 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6C275746 for ; Tue, 12 Feb 2019 17:04:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5AFC22C4AC for ; Tue, 12 Feb 2019 17:04:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4FD002C4A8; Tue, 12 Feb 2019 17:04:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF9B42C4A5 for ; Tue, 12 Feb 2019 17:04:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729728AbfBLREe (ORCPT ); Tue, 12 Feb 2019 12:04:34 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:34900 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729700AbfBLREe (ORCPT ); Tue, 12 Feb 2019 12:04:34 -0500 Received: by mail-wm1-f66.google.com with SMTP id t200so3855960wmt.0 for ; Tue, 12 Feb 2019 09:04:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=w750JyhiBEB13QK6qRQxx0rjaaookYP1EMZ1W4rlMFI=; b=YVi9bWd0qd8RhmdBSRU3TUgoKaUyHCio1cry1d+TM6mPTJWq+41jDE/JL3i4Dgut4D AaGDuJvmZcpPRQrd4xiSNqXLBooii04JOxjMYoNHnVVpBDSzXsvucSV28H9W3SfGvj2L Q1enibqDxa7mkYVGJhLhjMijb3GrenW9Pdock7alR7dCoTfRL8wZUWj54G1pWf+rDk2C hX/rvSZ3yW2qimWX3NsyUaof6wt19aG0/GhPYrQfpoI2wwIEzgfJzdbYQv9Z3sLouHQ6 Xbtm6BzNN2DbZo645260gn4mI2KHuRI/DmgE560LjjUFUA+WXvku9QUaaWQAVPoHIlQy sgCg== X-Gm-Message-State: AHQUAuaNmxxihBjXRX83LFxX3Opd88Z45a3//5zAo/74pcpeU6FQkHeI 920o7frrlMUFipC2TdxbJoI= X-Google-Smtp-Source: AHgI3IaMCdEQltdsqoOqtUC0q/SuOjgxewJALlFujFxHG5izsgnXQz3BCEVRfhieiSsIwDMQaWafXg== X-Received: by 2002:a1c:4681:: with SMTP id t123mr3646691wma.24.1549991072421; Tue, 12 Feb 2019 09:04:32 -0800 (PST) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id c139sm5579732wmd.13.2019.02.12.09.04.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Feb 2019 09:04:31 -0800 (PST) From: Yordan Karadzhov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, Yordan Karadzhov Subject: [PATCH 5/5] kernel-shark: Rename the method for deselecting the Active marker. Date: Tue, 12 Feb 2019 19:04:02 +0200 Message-Id: <20190212170402.10104-6-ykaradzhov@vmware.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190212170402.10104-1-ykaradzhov@vmware.com> References: <20190212170402.10104-1-ykaradzhov@vmware.com> Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This method deselects the Active marker regardless of its state (A or B). The method is renamed in order to avoid confusion with the methods for deselecting markers A and B. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202327 Signed-off-by: Yordan Karadzhov --- kernel-shark/src/KsMainWindow.cpp | 8 ++++---- kernel-shark/src/KsMainWindow.hpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp index 443b7b0..362b955 100644 --- a/kernel-shark/src/KsMainWindow.cpp +++ b/kernel-shark/src/KsMainWindow.cpp @@ -101,10 +101,10 @@ KsMainWindow::KsMainWindow(QWidget *parent) &_view, &KsTraceViewer::showRow); connect(&_graph, &KsTraceGraph::deselect, - this, &KsMainWindow::_deselect); + this, &KsMainWindow::_deselectActive); connect(&_view, &KsTraceViewer::deselect, - this, &KsMainWindow::_deselect); + this, &KsMainWindow::_deselectActive); connect(&_data, &KsDataStore::updateWidgets, &_view, &KsTraceViewer::update); @@ -117,7 +117,7 @@ KsMainWindow::KsMainWindow(QWidget *parent) _deselectShortcut.setKey(Qt::CTRL + Qt::Key_D); connect(&_deselectShortcut, &QShortcut::activated, - this, &KsMainWindow::_deselect); + this, &KsMainWindow::_deselectActive); connect(&_mState, &KsDualMarkerSM::deselectA, this, &KsMainWindow::_deselectA); @@ -1136,7 +1136,7 @@ void KsMainWindow::_splitterMoved(int pos, int index) _session.saveSplitterSize(_splitter); } -void KsMainWindow::_deselect() +void KsMainWindow::_deselectActive() { _view.clearSelection(); _mState.activeMarker().remove(); diff --git a/kernel-shark/src/KsMainWindow.hpp b/kernel-shark/src/KsMainWindow.hpp index abfe196..969b603 100644 --- a/kernel-shark/src/KsMainWindow.hpp +++ b/kernel-shark/src/KsMainWindow.hpp @@ -216,7 +216,7 @@ private: void _error(const QString &text, const QString &errCode, bool resize, bool unloadPlugins); - void _deselect(); + void _deselectActive(); void _deselectA();