From patchwork Tue Jul 23 12:52: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: 11054503 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 D8EEF112C for ; Tue, 23 Jul 2019 12:52:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C9A1A28587 for ; Tue, 23 Jul 2019 12:52:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BDCAD285EB; Tue, 23 Jul 2019 12:52:01 +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 4BCA128587 for ; Tue, 23 Jul 2019 12:52:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389914AbfGWMwB (ORCPT ); Tue, 23 Jul 2019 08:52:01 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:41647 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732432AbfGWMwA (ORCPT ); Tue, 23 Jul 2019 08:52:00 -0400 Received: by mail-wr1-f68.google.com with SMTP id c2so39853196wrm.8 for ; Tue, 23 Jul 2019 05:51:59 -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=RFVw4HfewavyR0oE+NeHv+pjPUawhk5+prelYCykGRg=; b=oKpDWjV7Ri6FR9Z8OLpUPvRxUHaLhBq9GlixuUGnbC/NMvCuGp3osdHS0boCKAu59i Gv3DVgTk4sVJeFieYmLUBqxemb/sr+hovqKbAYgf4N00N28A+GB/ybN7Fe3e+5sA65te 36H8L/R/sokghrEV68PgWGG5yAt1DXRS0xP9lkMm+n6yxQ8FNrgkLfm/++bL0HhjUMmG YA0YOMtq8SwwuR8ZW0C2L4FPC7ouohWDpSQAIEvrJd0ftEvpFhtPxo44kL4Ds7ebtAnV A4nHepPhsE4vA/7Gjv4jqLPsnWXmjZNA7MSrYFJ1znPX1rqTz6IZjPnwYTFEt4p06ytK T+tQ== 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=RFVw4HfewavyR0oE+NeHv+pjPUawhk5+prelYCykGRg=; b=pt7Xa9lIkV9aQKyLJMqitfD62YefVYmjQuDmRl2sdZfaIq9LdJEjgDL8beMKy0hblU qGReTtQwJuOZyE1oghNkIT7u0LAaj8gPyuXsVFR4KfOO2EFmEC6i7vQZhR4wrPmvzxRr VTyyoZnNANdnlOWXzfGp774Flis8D86pr40c9XEI5ENYtQUSsH2N9JKGHkcQOq0K3nJr cS6RqJZncxFmjjIeF/ffcdCDhlwKabsRR6ypCtHhKIhy1Imm9mZmTImjwpjooPqAGIWL JkB2p8dYdXJdZv9Pv/45tPhipzFb1wqKItxNwPJ61ZS7gxIKnTLLsa7pw9vWs+MxVobi CKTg== X-Gm-Message-State: APjAAAVlHsnCuP2MmQ0FA0Kaqw5RZY8V/ffzRPgU4dCSuiCCDhn6+4RE CL+BUgvq8Vax7qp8akuGJFo= X-Google-Smtp-Source: APXvYqwbHOGKzLB4Ndg0ctVJhuhkF6FIHKMI3DPLqAtio73EuWg46u+Q+EX1KQSbG2NprTYrfuYTyQ== X-Received: by 2002:a5d:4211:: with SMTP id n17mr11821439wrq.137.1563886318837; Tue, 23 Jul 2019 05:51:58 -0700 (PDT) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id e19sm57423320wra.71.2019.07.23.05.51.58 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 05:51:58 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, howaboutsynergy@pm.me, "Yordan Karadzhov (VMware)" Subject: [PATCH 1/3] kernel-shark: Make KsEventsCheckBoxWidget::removeSystem more robust Date: Tue, 23 Jul 2019 15:52:02 +0300 Message-Id: <20190723125204.22799-2-y.karadz@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190723125204.22799-1-y.karadz@gmail.com> References: <20190723125204.22799-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 function has to be able to handle safely the case when the Checkbox tree widget is empty or it does not contain the item to be removed. Reported-by: howaboutsynergy Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204277 Fixes: 4a02481fff (Remove all system=ftrace events from Record dialog) Signed-off-by: Yordan Karadzhov (VMware) --- kernel-shark/src/KsWidgetsLib.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kernel-shark/src/KsWidgetsLib.cpp b/kernel-shark/src/KsWidgetsLib.cpp index 84afec9..330230e 100644 --- a/kernel-shark/src/KsWidgetsLib.cpp +++ b/kernel-shark/src/KsWidgetsLib.cpp @@ -749,10 +749,13 @@ QStringList KsEventsCheckBoxWidget::getCheckedEvents(bool option) /** Remove a System from the Checkbox tree. */ void KsEventsCheckBoxWidget::removeSystem(QString name) { - QTreeWidgetItem *item = - _tree.findItems(name, Qt::MatchFixedString, 0)[0]; + auto itemList = _tree.findItems(name, Qt::MatchFixedString, 0); + int index; - int index = _tree.indexOfTopLevelItem(item); + if (itemList.isEmpty()) + return; + + index = _tree.indexOfTopLevelItem(itemList[0]); if (index >= 0) _tree.takeTopLevelItem(index); } From patchwork Tue Jul 23 12:52:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 11054505 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 300F3112C for ; Tue, 23 Jul 2019 12:52:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F06228587 for ; Tue, 23 Jul 2019 12:52:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 131D6285ED; Tue, 23 Jul 2019 12:52:03 +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 B2E2528587 for ; Tue, 23 Jul 2019 12:52:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725280AbfGWMwC (ORCPT ); Tue, 23 Jul 2019 08:52:02 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:46567 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732442AbfGWMwC (ORCPT ); Tue, 23 Jul 2019 08:52:02 -0400 Received: by mail-wr1-f68.google.com with SMTP id z1so43025434wru.13 for ; Tue, 23 Jul 2019 05:52:00 -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=dybi/trpqjaTo9oVl4SyfCWKAipl1AwJiIMcpNlAozg=; b=Sr31Yfg9/uVinCxCQz4pI69RK8QOnmh5ThZVfA44E/A3TiZ0nhsMmit8cWU/pzOk8k g85Q0hocQ86Hu2hhTMr2FzZY5MiAcaUcIYOIloUmwHQEwQu41IkfURKTQ4dxkD5jjOOy pYjv5YizmpBG+GkEzFlq2TBhWKt6f8cAvPPMJ+xmf5G6Y+bsqgK8jnS3S6bM0hclE3Hp WNASExkYrwlAkgpEUKUS8ium30YfB0D1NeJTBVmHN16WkaTGMglt8FErOWv9CM/1ghKO JcMrunSldq0Okz78X1BitKc5nr3zInaLCj5Gwe3wai7gxH4kOblS/UpjPTR/1vZJrVbL TO6Q== 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=dybi/trpqjaTo9oVl4SyfCWKAipl1AwJiIMcpNlAozg=; b=d/WXZTpYGAiYNqv76VPHBeDBnSBOnbkIf36tMenJxlEw5TP/0d03SSR/nLoJ/ry9JP B3wTY1W8TiWJ4DSP6l5PBycvFB84dRG8RCEAf6pARx6Kx/ycAjLQi8gkVL7Y/RXWw04r foNms820/OpbLwxHSKO3be6aUVIxsgdHEt++hMjwq5L1w0OwSdbh6nr0Xiqr6LtS4cCA 6ehtHObVLF6m4jwLtjqj+VFHT3on0Y2iWQvYwGP9xqWfBr3bWZWbOicEHzC+tkX9WV7r iq0A2yrZA7NcXCW3bX9wykmVMV8LISL155ZoFqCOl/WFMPs293Qw30bhSJfyC1yMvFyM qtBg== X-Gm-Message-State: APjAAAXHbeS3EoFGsxtigp+afDDqzOZdbQCa1tNRwMcQEcf5bDjgLd3H XrzBWTwvEXUXg3MYzYLQQ04= X-Google-Smtp-Source: APXvYqx1NYb1gjCncQ23ShXSpgge6PJfA5GvjR8AyjKUKSqbIp2yPfJQkyn/z+prEKEozXZDV0dt/A== X-Received: by 2002:adf:f206:: with SMTP id p6mr8225678wro.216.1563886320296; Tue, 23 Jul 2019 05:52:00 -0700 (PDT) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id e19sm57423320wra.71.2019.07.23.05.51.59 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 05:52:00 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, howaboutsynergy@pm.me, "Yordan Karadzhov (VMware)" Subject: [PATCH 2/3] kernel-shark: Better error message for the constructor of KsCaptureControl Date: Tue, 23 Jul 2019 15:52:03 +0300 Message-Id: <20190723125204.22799-3-y.karadz@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190723125204.22799-1-y.karadz@gmail.com> References: <20190723125204.22799-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 error message includes the case when the tracing directory cannot be found or mounted. Signed-off-by: Yordan Karadzhov (VMware) --- kernel-shark/src/KsCaptureDialog.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/kernel-shark/src/KsCaptureDialog.cpp b/kernel-shark/src/KsCaptureDialog.cpp index 0a29518..2e6e8f9 100644 --- a/kernel-shark/src/KsCaptureDialog.cpp +++ b/kernel-shark/src/KsCaptureDialog.cpp @@ -55,13 +55,19 @@ KsCaptureControl::KsCaptureControl(QWidget *parent) _topLayout.addWidget(line); }; - if (pluginList.count() == 0) { + if (pluginList.count() == 0 || !_localTEP) { /* - * No plugins have been found. Most likely this is because - * the process has no Root privileges. + * No plugins or events have been found. Most likely this is + * because the process has no Root privileges or because + * tracefs cannot be mounted. */ QString message("Error: No events or plugins found.\n"); - message += "Root privileges are required."; + + if (!_localTEP) + message += "Cannot find or mount tracing directory.\n"; + if (!pluginList.count()) + message += "Root privileges are required.\n"; + QLabel *errorLabel = new QLabel(message); errorLabel->setStyleSheet("QLabel {color : red;}"); From patchwork Tue Jul 23 12:52:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 11054507 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 46CB9112C for ; Tue, 23 Jul 2019 12:52:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3769A285F0 for ; Tue, 23 Jul 2019 12:52:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B3C12860A; Tue, 23 Jul 2019 12:52:04 +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 D9A4628587 for ; Tue, 23 Jul 2019 12:52:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389948AbfGWMwD (ORCPT ); Tue, 23 Jul 2019 08:52:03 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:36723 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732432AbfGWMwD (ORCPT ); Tue, 23 Jul 2019 08:52:03 -0400 Received: by mail-wr1-f68.google.com with SMTP id n4so43128994wrs.3 for ; Tue, 23 Jul 2019 05:52:02 -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=xoyij2NCyYTS84LBv1xSvP+kJxzGRYrq2YWH+GE/qxU=; b=MjKhWaaboQngX/17lc/biyZfybAIGv80JtosiPKw4MX1hXxJ/yFSqoSxeTayd2MUw6 POK6L3pm7WJTuoaOBkQjeULpmN9DxsHDL7n2dGXfXe79Q69AQv45Iofk73dS+Kraw2FF H5fggWzep3LZIAlPJpwxDWOKuNLL66mp6/oUXiTwaJ1rxpQgENHkb0V2avP0bb4m72m9 i9bbB6Z7uVyoGOcFByi75mHF93FuwcbzqENA8lUYO8gsZDs6HZdyACmG8W5h62BrhG6v EVxL07ATOWKFCC7XKgDHv00+Dbj6nq9TjXczTQwGkFRnWcPxE0N+sCXEqtQ5aVJEa9aC JmGA== 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=xoyij2NCyYTS84LBv1xSvP+kJxzGRYrq2YWH+GE/qxU=; b=euakcT0kJOM6PxZ9rxN0nnnXMOIAYhixqh1QTa5fQuPP97mgWgwmo/Qp9F7XL1CwyW ws8rPGGohdwpdNeQxhEjfW+Vz5YS9gS90DEaueggauSIAh4/POKz9xnCVcEcpmERcuFI 6RSgqvXlCEPawxR5It5pHPcB0Mo8CEMIAmuL9ovG/7gZzniJmdLVuDgf1F6woJ+OI1o6 kRhfkw52FDBqRs6vr8RwaTxOvFL/ptaZ8DZ80FaflmnblCY7mGk5lYf61shK/0n15Okw bCiEjS1fbya47j77PWx2gz63WbQjN6RGhzuzrQlcA3NbceO+yJoq4HG1bTiMRoOClTIH iIyQ== X-Gm-Message-State: APjAAAUunu3NarPHo7wEFYBkAIj4BjH/15U1egp2DHd33qWj6xxbJqPB +I/2Ia35zv89XAWeueSuzz0= X-Google-Smtp-Source: APXvYqziS9M18iqm1HRSbQbJiBzF9TVDgzDMnfXswkWTfD1fOvIJDekSVyeJMeSIa+qcer1geMFvVQ== X-Received: by 2002:adf:ed8a:: with SMTP id c10mr83951481wro.33.1563886321466; Tue, 23 Jul 2019 05:52:01 -0700 (PDT) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id e19sm57423320wra.71.2019.07.23.05.52.00 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 05:52:01 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, howaboutsynergy@pm.me, "Yordan Karadzhov (VMware)" Subject: [PATCH 3/3] kernel-shark: Disable Capture if trace-cmd can't function Date: Tue, 23 Jul 2019 15:52:04 +0300 Message-Id: <20190723125204.22799-4-y.karadz@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190723125204.22799-1-y.karadz@gmail.com> References: <20190723125204.22799-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 In the case of an error all key buttons of the Record dialog are disabled. Signed-off-by: Yordan Karadzhov (VMware) --- kernel-shark/src/KsCaptureDialog.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/kernel-shark/src/KsCaptureDialog.cpp b/kernel-shark/src/KsCaptureDialog.cpp index 2e6e8f9..2962917 100644 --- a/kernel-shark/src/KsCaptureDialog.cpp +++ b/kernel-shark/src/KsCaptureDialog.cpp @@ -74,6 +74,19 @@ KsCaptureControl::KsCaptureControl(QWidget *parent) _topLayout.addWidget(errorLabel); lamAddLine(); + + /* Disable all key buttons. */ + QVector widgets = + {&_importSettingsButton, + &_exportSettingsButton, + &_outputBrowseButton, + &_pluginsComboBox, + &_commandCheckBox, + &_applyButton, + &_captureButton}; + + for (auto &b: widgets) + b->setDisabled(true); } pluginList.prepend("nop");