From patchwork Mon Jul 15 13:20:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 11044043 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 55EA013BD for ; Mon, 15 Jul 2019 13:21:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45770284F9 for ; Mon, 15 Jul 2019 13:21:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 38B4A284ED; Mon, 15 Jul 2019 13:21:25 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,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 C00A1284F9 for ; Mon, 15 Jul 2019 13:21:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730139AbfGONVY (ORCPT ); Mon, 15 Jul 2019 09:21:24 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:51867 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730111AbfGONVY (ORCPT ); Mon, 15 Jul 2019 09:21:24 -0400 Received: by mail-wm1-f66.google.com with SMTP id 207so15167897wma.1 for ; Mon, 15 Jul 2019 06:21:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xL/50sP+0yqBwtM2a/folq4pA8V482HHff9A2bu6yYU=; b=Q+YjJRFzEkuq21qL3fY3fBr1OmO1ToAFk6xKhqYCRKdYVJtAlmkI8Kqyo7p47rdKPm AREvOgYmk/WRPfzsgQXxy27L+5a7r3jZ4dJqaBakhFNUT1VnmG0HjPD2huJhB0VSNbpp JqOWvifadCiUlc8Gx13TYXc8sYW2tD/w5Xj1vuD3ctr4yrC26UM15G4LCYInbY63adKG rCe5lHNjOyHRhBcvJS4Jm/rfx4eWn9pZR9Ri+qgnU5K4JiqxgjVZpdSmcf6Fup/LhGk2 aCO5gLXzXF13+61RGx+7oJPHnvp1RT0TAETf+UHQOwIPy9RM1OnCriuYcAKs5K1t4Iu4 mlFg== 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:mime-version:content-transfer-encoding; bh=xL/50sP+0yqBwtM2a/folq4pA8V482HHff9A2bu6yYU=; b=fGsg38IldcGIIUHVnBp4pFsfm+oTqClff+Es5S3uWjNPYI19/CxiyJ50m8lR6mqjny CQMZ/NIlp8bpguXQ2T1TOlyg3mcAVV5eY+u+EaKwDwNWJP5CLIdWU4wRuBzyIgZGSt5t /FX20Gi98ic+U9BXJIvKUotrcN1MCieHaU5uNyHath0hWLPTHlwFGF9b1ApXKFks3mj8 gVNQt+9+fJeuz1ZrGVEtQeKb0FbOZcMrIkwWt4fFjxz2dj3ZVhq1jmn5Q+d/vmcN5KHD vZWLl7w5VRb4k/0gwg2+PiLeKZDUkFhh42URVyiMak214dPczs6LJ3ADOy00f6368yjM okiA== X-Gm-Message-State: APjAAAVu+zET0lLvot8IuVcxnTU31mc5eMpG1tgncGgyAfbPeVyq3P1x 3U+1vuedVxwfyQn5lBenyII= X-Google-Smtp-Source: APXvYqzlwPXwYzzsZOSZhn4dQ0G54UlpMvtsj8hJI11L6PFFL/dacQYb19jV9BwUR9Z5vL0usPQzDA== X-Received: by 2002:a05:600c:2243:: with SMTP id a3mr23877313wmm.83.1563196882542; Mon, 15 Jul 2019 06:21:22 -0700 (PDT) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id c78sm23819426wmd.16.2019.07.15.06.21.21 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 15 Jul 2019 06:21:22 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, "Yordan Karadzhov (VMware)" , Valentin Schneider Subject: [PATCH 1/3] kernel-shark: The graph widget must follow the active marker Date: Mon, 15 Jul 2019 16:20:40 +0300 Message-Id: <20190715132042.5154-2-y.karadz@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190715132042.5154-1-y.karadz@gmail.com> References: <20190715132042.5154-1-y.karadz@gmail.com> MIME-Version: 1.0 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 "Graph follows" checkbox controls if the Graph widget follows or not the change of the Active marker made from the View widget (the text data table). In the same time, when the user clicks on the checkbox switching it from Unchecked to Checked, a signal is send to the Graph widget to make sure that it will visualize the current position of the Active marker. When sending this signal, we currently use the iterator of the search results list, which is wrong because of two reasons. First, the search results list can be empty, which will trigger a segmentation fault, as reported by Valentin Schneider. But even more important is that nothing guarantees that when the checkbox is clacked, the marker and the iterator both point to the same trace entry. Note that the iteration over the search results is only one of the possible ways to change the marker. Reported-By: Valentin Schneider Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204139 Tested-by: Valentin Schneider Signed-off-by: Yordan Karadzhov (VMware) --- kernel-shark/src/KsTraceViewer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel-shark/src/KsTraceViewer.cpp b/kernel-shark/src/KsTraceViewer.cpp index 05977c3..89e5dba 100644 --- a/kernel-shark/src/KsTraceViewer.cpp +++ b/kernel-shark/src/KsTraceViewer.cpp @@ -285,10 +285,11 @@ void KsTraceViewer::_searchEditText(const QString &text) void KsTraceViewer::_graphFollowsChanged(int state) { - _graphFollows = (bool) state; + int row = selectedRow(); - if (_graphFollows && _searchDone()) - emit select(*_it); // Send a signal to the Graph widget. + _graphFollows = (bool) state; + if (_graphFollows && row != KS_NO_ROW_SELECTED) + emit select(row); // Send a signal to the Graph widget. } void KsTraceViewer::_search() From patchwork Mon Jul 15 13:20:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 11044045 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 847F513BD for ; Mon, 15 Jul 2019 13:21:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 75DA628478 for ; Mon, 15 Jul 2019 13:21:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A50428451; Mon, 15 Jul 2019 13:21:28 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,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 1A06D26242 for ; Mon, 15 Jul 2019 13:21:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730111AbfGONV0 (ORCPT ); Mon, 15 Jul 2019 09:21:26 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:45387 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730155AbfGONV0 (ORCPT ); Mon, 15 Jul 2019 09:21:26 -0400 Received: by mail-wr1-f65.google.com with SMTP id f9so17034563wre.12 for ; Mon, 15 Jul 2019 06:21:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EOBQ60ITXtZtIGdb716hV5lp4TeV2dveLh4AF40gqvY=; b=s/Q+bKreKedytPsnTQzHhfbOEzSnAqd+vBW1BLVLZZm3GnQlpPJGtEKwbIH1uHfo9M icOGv1YeRjPi2O8BCRy3a/oU1RtLkOjvtrZVlEsvwxPCoMey4Y/Shi4XHQ6aJKk9JNdU aaHfOcanxeQWOckUDGxZK7cM1cQ09EAYq5qaO5RcK0ElJH45/a7PBSXiCFd453VGMciR NcAgYGgJ51juECzD4leoPu7axYfJm6JQW3KzrDoDVxbDA+KOi0TKthl8izp4S55b/eWm P5G77d1frEQSedSshx/wLirD3O/taj+rMitQQPH3mUa89F2QEsSnpx7ISXJPo6+wt8rW UdBg== 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:mime-version:content-transfer-encoding; bh=EOBQ60ITXtZtIGdb716hV5lp4TeV2dveLh4AF40gqvY=; b=edUxB0vh4VjpVa0jnoqJzxadZGHNNTtiKGBzjxvK+hU7nYZDTvQLcDNNW/q2U61F36 tzaoeUJ23oFQneulSjPg1v1c9B2+Zs/zBow12fMi6YBc8iFxY3vB75bTbIYLN9qN65kf 8JYhz+t0gbaU3Lk4eVDacHoKn0QPWCNEn9poUBxqwgsvfaHwUIafWt0aR/8FMSlL4si7 94b8ebKi1iK0fc1M+r1ACNlSZ6Qosu1gvwekSs8R2gUvY/Pq+KB45L24Azxb7amKE3eX M5Py6fB5CyfzUyqJCORtcqLRIhgVZCO6J4ULFOhrVlMINGCALJKmYcsCrQGGwhue0jGP zK7Q== X-Gm-Message-State: APjAAAVv0Aux6hlzgwnJ3vPx4d8NfS732fEClMn+lCgKe3OeNfsM96AT Xl47fDLGFQev+jqffjvn98E= X-Google-Smtp-Source: APXvYqztWcQ9LP3NYEf0B1QdB8/jQ2AJgDwurntikVSJ78NLTVQQCkcrl/Ads1iOQrI9TmsEhwVZZA== X-Received: by 2002:a5d:6190:: with SMTP id j16mr17080094wru.49.1563196884128; Mon, 15 Jul 2019 06:21:24 -0700 (PDT) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id c78sm23819426wmd.16.2019.07.15.06.21.23 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 15 Jul 2019 06:21:23 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, "Yordan Karadzhov (VMware)" Subject: [PATCH 2/3] kernel-shark: Always clear the marker after resizing the table. Date: Mon, 15 Jul 2019 16:20:41 +0300 Message-Id: <20190715132042.5154-3-y.karadz@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190715132042.5154-1-y.karadz@gmail.com> References: <20190715132042.5154-1-y.karadz@gmail.com> MIME-Version: 1.0 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 It looks more like a Qt bug, but sometimes the automatic resize of the table widget done in KsTraceViewer::_resizeToContents() has the parasitic effect to select the first row of the table (making the row green). If this is happening clear the selection by hand. Signed-off-by: Yordan Karadzhov (VMware) --- kernel-shark/src/KsTraceViewer.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/kernel-shark/src/KsTraceViewer.cpp b/kernel-shark/src/KsTraceViewer.cpp index 89e5dba..c176cef 100644 --- a/kernel-shark/src/KsTraceViewer.cpp +++ b/kernel-shark/src/KsTraceViewer.cpp @@ -563,12 +563,20 @@ void KsTraceViewer::keyReleaseEvent(QKeyEvent *event) void KsTraceViewer::_resizeToContents() { - int rows, columnSize; + int rows, columnSize, markRow = selectedRow(); _view.setVisible(false); _view.resizeColumnsToContents(); _view.setVisible(true); + /* + * It looks like a Qt bug, but sometimes when no row is selected in + * the table, the automatic resize of the widget (the lines above) has + * the parasitic effect to select the first row of the table. + */ + if (markRow == KS_NO_ROW_SELECTED) + _view.clearSelection(); + /* * Because of some unknown reason the first column doesn't get * resized properly by the code above. We will resize this From patchwork Mon Jul 15 13:20:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 11044047 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 8DD3D138B for ; Mon, 15 Jul 2019 13:21:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7CE9428478 for ; Mon, 15 Jul 2019 13:21:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7085728451; Mon, 15 Jul 2019 13:21:29 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,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 3A3691FEBD for ; Mon, 15 Jul 2019 13:21:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730155AbfGONV1 (ORCPT ); Mon, 15 Jul 2019 09:21:27 -0400 Received: from mail-wr1-f43.google.com ([209.85.221.43]:42114 "EHLO mail-wr1-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730162AbfGONV1 (ORCPT ); Mon, 15 Jul 2019 09:21:27 -0400 Received: by mail-wr1-f43.google.com with SMTP id x1so2073970wrr.9 for ; Mon, 15 Jul 2019 06:21:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1qWdphIC5MG/9KGy/S6VtxIcYiqQsZWRRowFrH6kblc=; b=ubbmDjZHQCK7CLx9wzWbrcFQyA5gyiQtfuVzhd2r0C4GjWnouI9xTs7UNtMXSsU9c4 V1DOkLokkU9dzKRbQSkmniUewEOlPtp4lG/m/pz2AGdDieAyyA+neL3/ZWxrr7VMZL18 ar2HR30rTUuJg2zm6wgSalQpCg47db9dvGunx/AKMrqLAQAx2O20Nt5gEJ4XxlfXaID+ g4v7b8mbdo1QY8pvFhszSPgcBkjtfEqaucWR06q3sZUmbhwi/AFescUfUDmzCsyKn61E 6UQs0CzxBSHFn8p6ZQ1ImNQV4IBxRrr5QqGa7mPQTABt0UVU1VXkXH6/1JktfyLmSmWH dISg== 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:mime-version:content-transfer-encoding; bh=1qWdphIC5MG/9KGy/S6VtxIcYiqQsZWRRowFrH6kblc=; b=ofZLVonq2KumBKYsphG2LmeOhaLAkqGbDsKb6ndadVGz9rR1r+0fB5RTpSrGEOAF6N +7ZpLVgWz/xH7sHiG3ZYh/c6oN+gWRiLrU/b28Yt7odrr0aaob/IQC3s2XXDde1Uuq5i EFq80be0fWRLxUt1R0tv2wIpS+AwM/9JuPf3I17YjbsMSo3DA0zPFYSQ5Nclf0RfM5Dn c15j2MLtvuoMZQ9ATwD9Ew1gszxD1RzeF0onyCY/UpP7SKdKOccgYAF7FcU/EJ2DIjep kUBaHtkN3phmKVbuIQKIc7iRkZ3ccktdsmjb5/kA85WhaUhkMhLoDLOyzQoNw0ZosJ+i iWSQ== X-Gm-Message-State: APjAAAVv2U5lF9nJIL50kUB4GJspiwJ5T7VXbMYsnls60M1tdHqYasDt Mti3sWU7NDWYNij1t6AbEQE= X-Google-Smtp-Source: APXvYqz7M/thwNico+6kXL3MGDj6YuiHKEu2axhhW5PbpzJ1ToJgS9vVmWw2R5p/tpTXswvG2KjsDw== X-Received: by 2002:adf:9f0e:: with SMTP id l14mr27228075wrf.23.1563196885275; Mon, 15 Jul 2019 06:21:25 -0700 (PDT) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id c78sm23819426wmd.16.2019.07.15.06.21.24 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 15 Jul 2019 06:21:25 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, "Yordan Karadzhov (VMware)" Subject: [PATCH 3/3] kernel-shark: Don't try to update the markers if no data is loaded Date: Mon, 15 Jul 2019 16:20:42 +0300 Message-Id: <20190715132042.5154-4-y.karadz@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190715132042.5154-1-y.karadz@gmail.com> References: <20190715132042.5154-1-y.karadz@gmail.com> MIME-Version: 1.0 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 change aims to avoid showing the labels of the time axis (zeros) when no data is loaded. Signed-off-by: Yordan Karadzhov (VMware) --- kernel-shark/src/KsMainWindow.cpp | 18 ++++++++++++------ kernel-shark/src/KsMainWindow.hpp | 2 ++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp index 8826cf5..c8d9d25 100644 --- a/kernel-shark/src/KsMainWindow.cpp +++ b/kernel-shark/src/KsMainWindow.cpp @@ -1210,12 +1210,20 @@ void KsMainWindow::_splitterMoved(int pos, int index) _session.saveSplitterSize(_splitter); } +void KsMainWindow::_updateMarkData() +{ + if (_data.size() < 1) + return; + + _mState.updateLabels(); + _graph.glPtr()->model()->update(); +} + void KsMainWindow::_deselectActive() { _view.clearSelection(); _mState.activeMarker().remove(); - _mState.updateLabels(); - _graph.glPtr()->model()->update(); + _updateMarkData(); } void KsMainWindow::_deselectA() @@ -1226,8 +1234,7 @@ void KsMainWindow::_deselectA() _view.passiveMarkerSelectRow(KS_NO_ROW_SELECTED); _mState.markerA().remove(); - _mState.updateLabels(); - _graph.glPtr()->model()->update(); + _updateMarkData(); } void KsMainWindow::_deselectB() @@ -1238,6 +1245,5 @@ void KsMainWindow::_deselectB() _view.passiveMarkerSelectRow(KS_NO_ROW_SELECTED); _mState.markerB().remove(); - _mState.updateLabels(); - _graph.glPtr()->model()->update(); + _updateMarkData(); } diff --git a/kernel-shark/src/KsMainWindow.hpp b/kernel-shark/src/KsMainWindow.hpp index 62e66a0..7e2e839 100644 --- a/kernel-shark/src/KsMainWindow.hpp +++ b/kernel-shark/src/KsMainWindow.hpp @@ -232,6 +232,8 @@ private: void _error(const QString &text, const QString &errCode, bool resize, bool unloadPlugins); + void _updateMarkData(); + void _deselectActive(); void _deselectA();