From patchwork Tue Jul 9 15:56:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 11037175 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 AF51C138D for ; Tue, 9 Jul 2019 15:57:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FB052870E for ; Tue, 9 Jul 2019 15:57:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93C782870C; Tue, 9 Jul 2019 15:57:23 +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 22EB92870C for ; Tue, 9 Jul 2019 15:57:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726197AbfGIP5X (ORCPT ); Tue, 9 Jul 2019 11:57:23 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:37843 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726133AbfGIP5W (ORCPT ); Tue, 9 Jul 2019 11:57:22 -0400 Received: by mail-wr1-f67.google.com with SMTP id n9so12480930wrr.4 for ; Tue, 09 Jul 2019 08:57:21 -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=KUJu4Rni6rC/rSWs4QI8yRyv6goC3gpPLBmQaOsz+bM=; b=sBucg1ha+Q5s5itulihgchHlxeA+VWIbiZDkmf3U3JFboX/vSh3+ksNglyML8IBqo1 Uhr3CmBbi87HqlD8Ykz9hKWK8Axiw/xhJhTkFLMY6ltt8PZ06ZI4wb+GglOrqDRIB96n WnndukAD6k/orXbXNFY5je28cdxFMP2PTxTJn8RLUVsiucMWMj2ENTpUsI3ItPn4xUS9 0Yz4lmz6yZyt7Kd3XhMrg08zmM65EGYws4kOBZeYmHoT5yPDr5S5p6yJmAocs1ySE0mJ 7w8ALxtI9qtWccC1Nuq8txDvKfeLXx/m5U/dRrX8WWYtqB4R+2jSdTv/vYnpKLWG1v6l rGFQ== 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=KUJu4Rni6rC/rSWs4QI8yRyv6goC3gpPLBmQaOsz+bM=; b=O7U5actbontSN2SZ4whrs5+17ePCdR3vdW9VBbFGw8+LSL7ZlHtD4n9W+ynOaHHEhj MTRYkg/Uf0JERoNrnozHkoyvh3cZULJ4Ox/xthOOF1pK+xPilzjxYscfy/i3LR2cXmoI dpsnug9gleFKpsxWbOIH5oYPCO8qgUn/NV/dapse9PPjJYl4zD1w8Zng7eIBbjUtPviJ nEGlZowDVXKKqVyrqn3KwJaeZCyTY3wD4gXVRKnDqdrOE2CJUzhVMP0TliJOZbz7JZfs RZV573uYKtjn+s2WKCsNhnq2eQU1Om4VXLh2yfj5riT2qd19PVuvgf2a4RsyT3jniAFg Fimg== X-Gm-Message-State: APjAAAVCNjsaG/G9E+hMhHP/jSmpH5v+6PGdEsFUyLYHANWm82SfMAkg yc1MXR23G6LVO44atpBFf8s= X-Google-Smtp-Source: APXvYqyB1RzGNU3FOKK/NGZNdizMDJzYxvasbvdgUEE9aLzz2OEJ+6EsBiS2dX1tuhZKizPfWeNbVw== X-Received: by 2002:adf:c706:: with SMTP id k6mr25913387wrg.40.1562687840903; Tue, 09 Jul 2019 08:57:20 -0700 (PDT) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id v5sm24313746wre.50.2019.07.09.08.57.20 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 09 Jul 2019 08:57:20 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, "Yordan Karadzhov (VMware)" Subject: [PATCH 1/8] kernel-shark: Don't free the string field of KS_CONFIG_STRING document Date: Tue, 9 Jul 2019 18:56:43 +0300 Message-Id: <20190709155650.2345-2-y.karadz@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190709155650.2345-1-y.karadz@gmail.com> References: <20190709155650.2345-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 kshark_config_doc_get() if the outputted document is of type KS_CONFIG_STRING, do not try to free the old string before setting the new one. Note that those strings are owned by the json object. Reported-by: Steven Rostedt (VMware) Fixes: b3b5b6504b1 ("kernel-shark-qt: Add I/O for configuration data.") Signed-off-by: Yordan Karadzhov (VMware) --- kernel-shark/src/libkshark-configio.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel-shark/src/libkshark-configio.c b/kernel-shark/src/libkshark-configio.c index 9106522..cac27a7 100644 --- a/kernel-shark/src/libkshark-configio.c +++ b/kernel-shark/src/libkshark-configio.c @@ -310,7 +310,6 @@ bool kshark_config_doc_get(struct kshark_config_doc *conf, if (!get_jval(conf, key, &tmp->conf_doc)) goto fail; - free(val->conf_doc); val->conf_doc = (char *) json_object_get_string(tmp->conf_doc); free(tmp); From patchwork Tue Jul 9 15:56:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 11037177 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 5545C14C0 for ; Tue, 9 Jul 2019 15:57:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45A322870C for ; Tue, 9 Jul 2019 15:57:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3962628714; Tue, 9 Jul 2019 15:57: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 D43512870C for ; Tue, 9 Jul 2019 15:57:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726218AbfGIP5Y (ORCPT ); Tue, 9 Jul 2019 11:57:24 -0400 Received: from mail-wr1-f52.google.com ([209.85.221.52]:33840 "EHLO mail-wr1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726211AbfGIP5Y (ORCPT ); Tue, 9 Jul 2019 11:57:24 -0400 Received: by mail-wr1-f52.google.com with SMTP id 31so4834229wrm.1 for ; Tue, 09 Jul 2019 08:57:22 -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=G8BNxHGQFIurQtSbHNJIYbTT2zYIjn4djInsYOxdlEk=; b=TfCHvVkfob2din3YdqoXLToDUCaXPMVqbvhk78XqIz5tCbv5HBGjskhytYQLutTuRQ 87ayPCrrH8AslLwkEZ+sg4aB20SVcsiluC1d8hqrh0aezq7eB9CbJ0IBcjf++InnfUNQ G9TC/hOZktFVC42RAt59JDAymCaKPrImCwkgdyG0+F/T/AAPsYEntwyRAK5DVulwdXlo 3l9zuB0azI4kY2nkpdxh4S4QWTwEuQTW9qhG9lbfiVLfSDljh3bxvm0rJnFF9tqOxskr GtwTm+pIxkNVM1YvptMsTlhItu6iX3LrDjq5Nss1W3Ms4q8BtquevJoE5WI82lB8d8E5 coNQ== 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=G8BNxHGQFIurQtSbHNJIYbTT2zYIjn4djInsYOxdlEk=; b=Ep4EO8leIx33X72tVB1YBhP626kZZsEpR7NQ3xJXhDogCl1HVqFs++9Zz0FwMQogvw SIuSzw8NDMOC4oa1yQunvxm8t7sLluKMlk1ijfDiEJAjrHIY5YvaFV9QlTMXG026R7nW DZRUweEyvpgW6guFkHEaQYXagaRJho+e2o5iUG8XySXhIpkmLNHL+lYmTYq2vhfxfgL+ S3/Mvt2AqIcSx60zooREbp3BRvkeb0XWREm0YORy/rYhgNROtj0Tok/yPCo7cWO92DKu 3aIsmb9B0oa+CN4KSO7BEdNBpIxYW+2N0b6GA6FFBv0vZCvmY801fUwzXtu90KpR6Gjn bGlA== X-Gm-Message-State: APjAAAXh8iysYaetwEeZaHByq341x5uncEP1pYzALIySE/bpq+yEEfoR 0k5PoLtMZcL3i7PoR7xyoq8= X-Google-Smtp-Source: APXvYqyM6kMVzLYAhHKaIDGmalzs5K/Q9FE8CDzvHL103RZqdiPEd/Kb+Yi/Uly8+ipGJePCZbEFyA== X-Received: by 2002:adf:e50b:: with SMTP id j11mr25957430wrm.351.1562687842363; Tue, 09 Jul 2019 08:57:22 -0700 (PDT) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id v5sm24313746wre.50.2019.07.09.08.57.21 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 09 Jul 2019 08:57:22 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, "Yordan Karadzhov (VMware)" Subject: [PATCH 2/8] kernel-shark: Add method for getting all selected events Date: Tue, 9 Jul 2019 18:56:44 +0300 Message-Id: <20190709155650.2345-3-y.karadz@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190709155650.2345-1-y.karadz@gmail.com> References: <20190709155650.2345-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 A new method is added to the class KsEventsCheckBoxWidget. It returns a list of strings containing all selected events. If the whole system is selected (the top level checkbox is checked), only the name of the system is added to the list. Signed-off-by: Yordan Karadzhov (VMware) --- kernel-shark/src/KsWidgetsLib.cpp | 41 +++++++++++++++++++++++++++++++ kernel-shark/src/KsWidgetsLib.hpp | 2 ++ 2 files changed, 43 insertions(+) diff --git a/kernel-shark/src/KsWidgetsLib.cpp b/kernel-shark/src/KsWidgetsLib.cpp index ea02b5e..1c55c79 100644 --- a/kernel-shark/src/KsWidgetsLib.cpp +++ b/kernel-shark/src/KsWidgetsLib.cpp @@ -706,6 +706,47 @@ KsEventsCheckBoxWidget::KsEventsCheckBoxWidget(struct tep_handle *tep, _adjustSize(); } +/** + * @brief Get a list of all checked events. If the whole system is selected + * (the top level checkbox is checked), only the name of the system is + * added to the list. + * + * @param option: If True, "-e" is added as prefix to each element of the list. + * + * @returns A list of checked events or systems. + */ +QStringList KsEventsCheckBoxWidget::getCheckedEvents(bool option) +{ + QTreeWidgetItem *sysItem, *evtItem; + QStringList list; + QString optStr; + int nSys, nEvts; + + if (option) + optStr = "-e"; + + nSys = _tree.topLevelItemCount(); + for(int t = 0; t < nSys; ++t) { + sysItem = _tree.topLevelItem(t); + if (sysItem->checkState(0) == Qt::Checked) { + list << optStr + sysItem->text(0); + } else { + nEvts = sysItem->childCount(); + for (int c = 0; c < nEvts; ++c) { + evtItem = sysItem->child(c); + if (evtItem->checkState(0) == Qt::Checked) { + list << optStr + + sysItem->text(0) + + ":" + + evtItem->text(0); + } + } + } + } + + return list; +} + /** Remove a System from the Checkbox tree. */ void KsEventsCheckBoxWidget::removeSystem(QString name) { QTreeWidgetItem *item = diff --git a/kernel-shark/src/KsWidgetsLib.hpp b/kernel-shark/src/KsWidgetsLib.hpp index 6f22374..0d79250 100644 --- a/kernel-shark/src/KsWidgetsLib.hpp +++ b/kernel-shark/src/KsWidgetsLib.hpp @@ -333,6 +333,8 @@ struct KsEventsCheckBoxWidget : public KsCheckBoxTreeWidget KsEventsCheckBoxWidget(struct tep_handle *pe, QWidget *parent = nullptr); + QStringList getCheckedEvents(bool option); + void removeSystem(QString name); }; From patchwork Tue Jul 9 15:56:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 11037179 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 A099E14C0 for ; Tue, 9 Jul 2019 15:57:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9146E2870C for ; Tue, 9 Jul 2019 15:57:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8584028714; Tue, 9 Jul 2019 15:57:26 +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 359012870C for ; Tue, 9 Jul 2019 15:57:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726238AbfGIP50 (ORCPT ); Tue, 9 Jul 2019 11:57:26 -0400 Received: from mail-wm1-f46.google.com ([209.85.128.46]:50770 "EHLO mail-wm1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726133AbfGIP5Z (ORCPT ); Tue, 9 Jul 2019 11:57:25 -0400 Received: by mail-wm1-f46.google.com with SMTP id v15so3652444wml.0 for ; Tue, 09 Jul 2019 08:57: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=4vTSVwzPagn4coALClzcY4CBNS9gpkyjygDFxvKLxyE=; b=SdTwv5qEecv8z7SL7gA/w+C6qizCgHDFbH2s7GSFVqB27avatPjHMgpHIV9SzOu/NI py4CNaBPerZjoGyBnefCPuYm0IitEk+GOg+y2m6tqZIzvKZlVpESN01CVAd8bEW0ruac vDxXOxuowkFGIv8Go3A2JeD2YxX2XBAsWggwc+16bpzyytnpUME/eL/M/2U10shzcudt 1bqN/IHYfW9fbAQPbWPlcf9BuC255JE9N7oQCVkebKOpkfAyEN9JJcsvtaA7IvH/NpXX 0y09Bfe2ulTZYUFoHHlokuc5jBTsmyFPZQeRXUvUNbE99akXBWI9482jfqshC+zN5RQb sK8g== 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=4vTSVwzPagn4coALClzcY4CBNS9gpkyjygDFxvKLxyE=; b=HKgzizeuRg4eKtUHoeCEdmjF5RAPCELAuMAntgr3ag34qsYoZp5yJlYsrLWDVGuwhc b8XIWTo+pdxYXD2140+78c2194nBSp3FCn6ipg7U8eyT/dGLvJbdmqJdPxN0snuMZ4tZ 81A/W8vAOS7rT+4pja3wFAj/U/BWVAdUFcbTHTtiZtU5/pXrwyf+7QaXvwPgiTM3e9gZ wCqqUrPeNBBxYjUUvQIT++/LTvRt26MPNbaYX/5pj8+cuKXayODvLQlqC5J0ba3tta5U cGMHGf5hURzpCj6f93cfGjc45SNFZneoWz5WC7noyC/saTMUPEVNdjRwsXVFh4C5hpwa O8zA== X-Gm-Message-State: APjAAAXmngYNgrO0Lolxy/jKkw3/JiFU1SjtWPYKqI5gs8RnY8TStJUm sCp5cabTDV34Szd9qWZUuPfMTn79HQI= X-Google-Smtp-Source: APXvYqzQae2iOFTojM1DqU8fyL29mpWJ9aLHQ4jaij3gyET0q4tNJBFwhxs03pZeODm4xEuGtdEsuQ== X-Received: by 2002:a7b:cbcb:: with SMTP id n11mr574565wmi.146.1562687843609; Tue, 09 Jul 2019 08:57:23 -0700 (PDT) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id v5sm24313746wre.50.2019.07.09.08.57.23 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 09 Jul 2019 08:57:23 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, "Yordan Karadzhov (VMware)" Subject: [PATCH 3/8] kernel-shark: Optimize the command line options used by the capture dialog Date: Tue, 9 Jul 2019 18:56:45 +0300 Message-Id: <20190709155650.2345-4-y.karadz@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190709155650.2345-1-y.karadz@gmail.com> References: <20190709155650.2345-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 Do not include all events belonging to a given system if the whole system is selected. Add only the name of the system instead. Do not specify a plugin if the selected plugin is "nop". Suggested-by: Steven Rostedt (VMware) Signed-off-by: Yordan Karadzhov (VMware) --- kernel-shark/src/KsCaptureDialog.cpp | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/kernel-shark/src/KsCaptureDialog.cpp b/kernel-shark/src/KsCaptureDialog.cpp index b107595..7da6c08 100644 --- a/kernel-shark/src/KsCaptureDialog.cpp +++ b/kernel-shark/src/KsCaptureDialog.cpp @@ -143,23 +143,14 @@ QStringList KsCaptureControl::getArgs() QStringList argv; argv << "record"; - argv << "-p" << _pluginsComboBox.currentText(); - if (_eventsWidget.all()) { - argv << "-e" << "all"; - } else { - QVector evtIds = _eventsWidget.getCheckedIds(); - tep_event *event; + if (_pluginsComboBox.currentText() != "nop") + argv << "-p" << _pluginsComboBox.currentText(); - for (auto const &id: evtIds) { - event = tep_find_event(_localTEP, id); - if (!event) - continue; - - argv << "-e" + QString(event->system) + - ":" + QString(event->name); - } - } + if (_eventsWidget.all()) + argv << "-e" << "all"; + else + argv << _eventsWidget.getCheckedEvents(true); argv << "-o" << outputFileName(); argv << _commandLineEdit.text().split(" "); From patchwork Tue Jul 9 15:56:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 11037181 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 6038C138D for ; Tue, 9 Jul 2019 15:57:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 501CB2870C for ; Tue, 9 Jul 2019 15:57:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4494228714; Tue, 9 Jul 2019 15:57:27 +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 E02002870C for ; Tue, 9 Jul 2019 15:57:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726241AbfGIP50 (ORCPT ); Tue, 9 Jul 2019 11:57:26 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:36465 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726211AbfGIP50 (ORCPT ); Tue, 9 Jul 2019 11:57:26 -0400 Received: by mail-wr1-f68.google.com with SMTP id n4so21653905wrs.3 for ; Tue, 09 Jul 2019 08:57: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=H/nK5illKgnQiy6dXA6lfChEZ8E9xkUC5KDq1Ibm3nE=; b=Uh9Kl2hwYpRRrdHqHIZUkGXlGLfi40hbd3H3Z4/rLhQ2jTjLSRECG6uV9/2/u70nhB 75P0+PjCh8w76Z9riMPcoA5csB3BC5xZg/o97mUf8I2GtkzCS632VXIQP7uRXg158HAn UflYPeINBN289YD0IWHZY1Jz8je0t2MhZ7S81HteIqX1Zb74sBkocdBZgFh9T0JduJNH P+ZogL50TJ/7F1xhZyQuLdbOzTxAMsQu5MX9THom/oJ8JybXz2U5b4GySyJ5W8YZmLfo FeQVkd4Dz3yMpAI25evfY7gYM8Iq1/tXQfAt4OAO7+nJOdv+6hQfNjqbVdTI2iR39PhE lBcA== 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=H/nK5illKgnQiy6dXA6lfChEZ8E9xkUC5KDq1Ibm3nE=; b=MLhaaMBiXX3l9yoXYSXiNYoafe/8JZkfWyaQLSjboyT8zm3PB5zo8Q0RmXYAtC88GI dBLfZ+a9w5/yL7kzUV3M7azu6VfXCurzXvKx2JB2TjhYOj1hBpSshqPD6s2BrhphtWhb tgmPMG4MtIQijrde48G0sN3cscps6mdnlchbYutBrsk8S3zEvAVhrSHnVWQmB/AIgSlq lwXEMp5wvdBgdxgdRg0PRYTwb3tlifxsRO20da4oFGzpYZWncCJjd6WbE11QGyH+eabe 9qFQVa9SnSrc0HYhHKRkYfya6J1dt/Q5HP4hstfzmxdYoXzCZLR5vh5aplHXYWQeKBN4 pPfA== X-Gm-Message-State: APjAAAUg1PeyDo7CEjIycmn1kNyGA8F0g7bIZV+dSk1Bxl9fLYICyvQe WSKyjtLKclNtaez4FL1Qgk4= X-Google-Smtp-Source: APXvYqycXhh0qDuNdKv+LnunfBz1qs2jyA/0AbyGg8NPSR9gS2LqPs+0vvbNel6aPxECrZxlz59vfw== X-Received: by 2002:adf:eccd:: with SMTP id s13mr17278838wro.193.1562687844866; Tue, 09 Jul 2019 08:57:24 -0700 (PDT) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id v5sm24313746wre.50.2019.07.09.08.57.24 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 09 Jul 2019 08:57:24 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, "Yordan Karadzhov (VMware)" Subject: [PATCH 4/8] kernel-shark: Don't try to open data file if recording failed Date: Tue, 9 Jul 2019 18:56:46 +0300 Message-Id: <20190709155650.2345-5-y.karadz@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190709155650.2345-1-y.karadz@gmail.com> References: <20190709155650.2345-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 when the recording process failed, the Capture dialog should not send a signal to the KernelShark GUI to open a new tracing data file. Suggested-by: Steven Rostedt (VMware) Signed-off-by: Yordan Karadzhov (VMware) --- kernel-shark/src/KsCaptureDialog.cpp | 10 +++++++++- kernel-shark/src/KsCaptureDialog.hpp | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/kernel-shark/src/KsCaptureDialog.cpp b/kernel-shark/src/KsCaptureDialog.cpp index 7da6c08..c877094 100644 --- a/kernel-shark/src/KsCaptureDialog.cpp +++ b/kernel-shark/src/KsCaptureDialog.cpp @@ -314,6 +314,7 @@ KsCaptureMonitor::KsCaptureMonitor(QWidget *parent) : QWidget(parent), _mergedChannels(false), _argsModified(false), + _captureStatus(false), _panel(this), _name("Output display", this), _space("max size ", this), @@ -448,6 +449,9 @@ void KsCaptureMonitor::_captureFinished(int exit, QProcess::ExitStatus status) _consolOutput.appendPlainText(errMessage); QCoreApplication::processEvents(); + _captureStatus = false; + } else { + _captureStatus = true; } } @@ -531,8 +535,12 @@ void KsCaptureDialog::_setChannelMode(int state) void KsCaptureDialog::_sendOpenReq(const QString &fileName) { - QLocalSocket *socket = new QLocalSocket(this); + QLocalSocket *socket; + + if (!_captureMon._captureStatus) + return; + socket = new QLocalSocket(this); socket->connectToServer("KSCapture", QIODevice::WriteOnly); if (socket->waitForConnected()) { QByteArray block; diff --git a/kernel-shark/src/KsCaptureDialog.hpp b/kernel-shark/src/KsCaptureDialog.hpp index 2265704..b168a2b 100644 --- a/kernel-shark/src/KsCaptureDialog.hpp +++ b/kernel-shark/src/KsCaptureDialog.hpp @@ -119,6 +119,8 @@ public: */ bool _argsModified; + bool _captureStatus; + private: QVBoxLayout _layout; From patchwork Tue Jul 9 15:56:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 11037183 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 C5A9A14C0 for ; Tue, 9 Jul 2019 15:57:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B6A3B2870C for ; Tue, 9 Jul 2019 15:57:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB26528714; Tue, 9 Jul 2019 15:57: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 5ACFF2870C for ; Tue, 9 Jul 2019 15:57:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726251AbfGIP52 (ORCPT ); Tue, 9 Jul 2019 11:57:28 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:54287 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726133AbfGIP52 (ORCPT ); Tue, 9 Jul 2019 11:57:28 -0400 Received: by mail-wm1-f65.google.com with SMTP id p74so3628208wme.4 for ; Tue, 09 Jul 2019 08:57:26 -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=AHunqJETTE6J5yl+agrAXzmMG4fvntDz6Z8j37hRPyg=; b=rNtIw7+QdfafExM+vAYWdUlPlM56B5ixZU9c2oGZEXb+w5bHlleRGmkVMt50+U4aGn Ni6wlZK1UaZGVTGQ5cWEkCUa6K/PSSbcK+enIiV04Imn7lOVr1xGF8iy1D71OI30TnE1 wOuVHA2ijU1RD93AkzCnOTrA6MU2SB+gcRsP/+CkaydFo9F4Gw3W9QBc7Y1/nPHiYh8I PqQgirsWw27tQuo8lilJWLB8OtNoxAWBd5MtXnWt3IP8H3MyvHKVLQYd7N/H42CRO0uV ShmzTkgxzuA8oGsSFSYWF8EDvS7ck14/Jqifh1KUTY0Q7lREG9K0ukXXy/NbaogWfvF2 Xiig== 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=AHunqJETTE6J5yl+agrAXzmMG4fvntDz6Z8j37hRPyg=; b=GvGtZRutxm+OYcvEAEETKWWUD/wpsKVEL5XksA37rhvLGOCjNFO1ZvAU1XPDo95LPI wYCRZlMVc3rPuHKsCvesfulsM441B4hU03o1wU0xbecOVUqONDtPM93WtTeKe1xIwqgC hpw6SP8f+bSjCeZsacBl9S29RtoSlwTrD7rxvDomJzi+ozS0VTdM9CqVITopobLgXvxY AmvDDgihcsFQEaUWoK/8UR8EWDXgtAYbNdSUguEIpXydmqdvY/Xd5kiGsoKMDlrt61h8 aj/tdyi+8gJTvkm4uKs51e1OMdyij5ZG5JZuCTE6NiSZpOsLoXbA4aF/xmpnM+9wQxNO 8Q6A== X-Gm-Message-State: APjAAAUuNtRY2VuUSd949tIvigud8q/joU0nzj/5WHY0SkmXd+N3US7O QUXKGeYQlvT1C/6Luwnt5qa4tH33rSs= X-Google-Smtp-Source: APXvYqwu5wepZkWkFmaC1Qh+XRcPkI/YfBV+m87IknWKlzpXKGepcV5zVdExsicqHo1nZ607O3hOcw== X-Received: by 2002:a05:600c:284:: with SMTP id 4mr624121wmk.12.1562687846123; Tue, 09 Jul 2019 08:57:26 -0700 (PDT) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id v5sm24313746wre.50.2019.07.09.08.57.25 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 09 Jul 2019 08:57:25 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, "Yordan Karadzhov (VMware)" Subject: [PATCH 5/8] kernel-shark: Remove a duplicate error message Date: Tue, 9 Jul 2019 18:56:47 +0300 Message-Id: <20190709155650.2345-6-y.karadz@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190709155650.2345-1-y.karadz@gmail.com> References: <20190709155650.2345-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 If the capture process finishes with an error the _captureError() slot will print an error message. We do not need to print identical message in _captureFinished(). Signed-off-by: Yordan Karadzhov (VMware) --- kernel-shark/src/KsMainWindow.cpp | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp index 1e03632..752a17a 100644 --- a/kernel-shark/src/KsMainWindow.cpp +++ b/kernel-shark/src/KsMainWindow.cpp @@ -1143,35 +1143,9 @@ void KsMainWindow::_captureStarted() _captureLocalServer.listen("KSCapture"); } -/** - * If the authorization could not be obtained because the user dismissed - * the authentication dialog (clicked Cancel), pkexec exits with a return - * value of 126. - */ -#define PKEXEC_DISMISS_RET 126 - void KsMainWindow::_captureFinished(int ret, QProcess::ExitStatus st) { - QProcess *capture = (QProcess *)sender(); - _captureLocalServer.close(); - - if (ret == PKEXEC_DISMISS_RET) { - /* - * Authorization could not be obtained because the user - * dismissed the authentication dialog. - */ - return; - } - - if (ret != 0 || st != QProcess::NormalExit) { - QString message = "Capture process failed:
"; - - message += capture->errorString(); - message += "
Try doing:
sudo make install"; - - _error(message, "captureFinishedErr", false, false); - } } void KsMainWindow::_captureError(QProcess::ProcessError error) From patchwork Tue Jul 9 15:56:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 11037185 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 5BF2414C0 for ; Tue, 9 Jul 2019 15:57:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C7982870C for ; Tue, 9 Jul 2019 15:57:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4131928714; Tue, 9 Jul 2019 15:57: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=-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 ECB172870C for ; Tue, 9 Jul 2019 15:57:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726282AbfGIP53 (ORCPT ); Tue, 9 Jul 2019 11:57:29 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:36270 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726211AbfGIP53 (ORCPT ); Tue, 9 Jul 2019 11:57:29 -0400 Received: by mail-wm1-f65.google.com with SMTP id g67so3812983wme.1 for ; Tue, 09 Jul 2019 08:57:28 -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=oafdOE8cfRFcWDHI3K/XrnurRFkCwhoOhyD3nfV4xjc=; b=dsnBZ+3xtGobcd4JSiENGMzhLM9tNbjUdHw1/3UebxFHWXPssY7ep7lX4QIqQxjE56 FkaeiipwZVJMHtGjY/o8Ye1v+f5cZ0rsZa2rGRA7kZwpjsv6zJHFLkV4wj/yM8A/H6Ak EKcrXnukrTc+amF6OeCxiO5n3zmJhlrjuvFt94XXgADGG9Nn2AJiPe8AVOBmMTFTLqpk 0iArAA84Q0nFVwbFFABU6b4Elr+VCUnzIW45aYO5Q5JK4115H7iXMk7ZFOcyY3SNgfOj d0fNdLhEId2A8j/bTW6eGVGGLqnvzWJka4ZyWbIHhzCtW/5dHhAb1LoBLz1k0YZJnn7B ZdaA== 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=oafdOE8cfRFcWDHI3K/XrnurRFkCwhoOhyD3nfV4xjc=; b=IudCVsRi6BwazfL1Gdgcjn+/z/MgvlNaPXfaUH4MMF6GiqN1DAmVeaiqSau+MBmzbD +BOqAV1Fq5679nWkWBOGfs6yKHIMNd9OuSa2qRz4nN22sR8co5t28qHi3gSGSrsMC5ix oIQLk30ID8dzjHVHykarsuF0phUUFsynwFLj9FKIugx28iGtXyXwP9Ne1CDAoaWiPLPo Au+3gmNhVIPmnt9XrhaqTAktKQwc/KSgMz3dXtsURD4ph6CEoYWH/+Ti19nNGcaLKcIF I0VoSgZHHbNG33WiY1GsbAzG8DAu2SULYn77HxOdXh6wbHP7mq8Hve4C+MOeNKDnIsUR NErw== X-Gm-Message-State: APjAAAU8is7MN1VGpbQxgSRUog+sOSJAEC/0QumJb8BnoczGX5SKJfw/ FYLnAhiJVVVCtekn7KbolvM= X-Google-Smtp-Source: APXvYqzhhRbw/4AEN7R0yl6ZSKTv8OrxyAQJ5GuGWimKZ3tGoOv++2VoZqKCLL2hjxmvMTeDTinD8A== X-Received: by 2002:a7b:c0d0:: with SMTP id s16mr556271wmh.136.1562687847497; Tue, 09 Jul 2019 08:57:27 -0700 (PDT) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id v5sm24313746wre.50.2019.07.09.08.57.26 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 09 Jul 2019 08:57:27 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, "Yordan Karadzhov (VMware)" Subject: [PATCH 6/8] kernel-shark: remove the "make install" suggestion for capture errors Date: Tue, 9 Jul 2019 18:56:48 +0300 Message-Id: <20190709155650.2345-7-y.karadz@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190709155650.2345-1-y.karadz@gmail.com> References: <20190709155650.2345-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 message is not appropriate, although it is most likely that the error occurs because the user didn't install KernelShark and it runs the executable from its build location. Signed-off-by: Yordan Karadzhov (VMware) --- kernel-shark/src/KsMainWindow.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp index 752a17a..3f238db 100644 --- a/kernel-shark/src/KsMainWindow.cpp +++ b/kernel-shark/src/KsMainWindow.cpp @@ -1154,8 +1154,6 @@ void KsMainWindow::_captureError(QProcess::ProcessError error) QString message = "Capture process failed:
"; message += capture->errorString(); - message += "
Try doing:
sudo make install"; - _error(message, "captureFinishedErr", false, false); } From patchwork Tue Jul 9 15:56:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 11037187 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 DF942138D for ; Tue, 9 Jul 2019 15:57:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D00EB2870C for ; Tue, 9 Jul 2019 15:57:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C4A8728714; Tue, 9 Jul 2019 15:57:31 +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 718EC2870C for ; Tue, 9 Jul 2019 15:57:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726298AbfGIP5b (ORCPT ); Tue, 9 Jul 2019 11:57:31 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:37867 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726133AbfGIP5b (ORCPT ); Tue, 9 Jul 2019 11:57:31 -0400 Received: by mail-wr1-f67.google.com with SMTP id n9so12481439wrr.4 for ; Tue, 09 Jul 2019 08:57:29 -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=jyjy99QwM8/P9RxrZz9xRTDp6gY5k1+hpLrM5MKvJMg=; b=sl9Gv1KXMzbYSePBa+XjxzCOvMlhYxL1s0j2Px1KFKlSziO9vdaFENhEqLQaKbq13/ XmR4mio6/gk7lmtUdOG1EjqypULQOaaMCewbsKhidp+uCbmE4Q9eMKJoh7wT7p2dEoKf K7tr7NYg3FMgodRUiwlcU21SpGrKvMeVHao85HrrlwZrqWEaQiNgLrz1UnJvgLIWNlFD 4ZbOfidBRnU8IgFn9TI/ZgaEfSHhH2obZawmtELsDUI4zXq9bz63B8Ab16IhKhTMGbiV URGKDm+No5KL7WpFzFdSz3q3hkJ0dtYFyxuTkdgDIcM4NL0RjkmLXfoe3u2OlW50BRju 1Kyw== 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=jyjy99QwM8/P9RxrZz9xRTDp6gY5k1+hpLrM5MKvJMg=; b=b5qpctGuMmlTVl4/2Wu6zCMhiK4n72rFVLb8pXNPIL+zqY9WU86UCDAeoZD0hJtrKM PXXU0PrSlljjMemK5WFp1i4YgKGLVj1axwZoEa0gPnjnchQD+Kxmmip+6wojIR4rQqNO Bx/TfTQexif9MsT4L0oD+GIfy9Yfw1SLpacYAbtl3VbDig/TqRonK5SWD9i8EfesLUqY MuWEut6GSXn/2VG1LtKb3+brkXt5uswepdlZpjhvsHKtI9NNB5Vadeop26TvIFJIOSCP Q/qDFhoCUaqTHIIWYJyDM/fUXhYmJAYaEZyzKZjfGPFlL6rBJdBbuN8k+kBvm/LqVQeU oXwg== X-Gm-Message-State: APjAAAX+gmP0c2qzQsSICvAm4AKVKiw6exxcFXAle4KZoUYQyDl3TJDC syHNPjA/vFXRgmqGemZR2Rw= X-Google-Smtp-Source: APXvYqx3ksLNxi388AE6AOfOGB6c1eFEnqRiByS19nC3APHYp3eo0POHVRICUpaEqjrc7HHY/wvO/A== X-Received: by 2002:adf:f98a:: with SMTP id f10mr798449wrr.250.1562687849009; Tue, 09 Jul 2019 08:57:29 -0700 (PDT) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id v5sm24313746wre.50.2019.07.09.08.57.28 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 09 Jul 2019 08:57:28 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, "Yordan Karadzhov (VMware)" Subject: [PATCH 7/8] kernel-shark: Disconnect "capture errors" before closing KernelShark GUI Date: Tue, 9 Jul 2019 18:56:49 +0300 Message-Id: <20190709155650.2345-8-y.karadz@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190709155650.2345-1-y.karadz@gmail.com> References: <20190709155650.2345-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 is done because we do not want to show error messages if the Capture dialog is not closed. Signed-off-by: Yordan Karadzhov (VMware) --- kernel-shark/src/KsMainWindow.cpp | 15 +++++++++++++-- kernel-shark/src/KsMainWindow.hpp | 2 ++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp index 3f238db..55518a3 100644 --- a/kernel-shark/src/KsMainWindow.cpp +++ b/kernel-shark/src/KsMainWindow.cpp @@ -155,6 +155,16 @@ KsMainWindow::~KsMainWindow() _data.clear(); + /* + * Do not show error messages if the "capture" process is still + * running (Capture dialog is not closed). + */ + if (_capture.state() != QProcess::NotRunning) { + disconnect(_captureErrorConnection); + _capture.close(); + _capture.waitForFinished(); + } + if (kshark_instance(&kshark_ctx)) kshark_free(kshark_ctx); } @@ -1129,8 +1139,9 @@ void KsMainWindow::_initCapture() connect(&_capture, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(_captureFinished(int, QProcess::ExitStatus))); - connect(&_capture, &QProcess::errorOccurred, - this, &KsMainWindow::_captureError); + _captureErrorConnection = + connect(&_capture, &QProcess::errorOccurred, + this, &KsMainWindow::_captureError); connect(&_captureLocalServer, &QLocalServer::newConnection, this, &KsMainWindow::_readSocket); diff --git a/kernel-shark/src/KsMainWindow.hpp b/kernel-shark/src/KsMainWindow.hpp index 22700d9..62e66a0 100644 --- a/kernel-shark/src/KsMainWindow.hpp +++ b/kernel-shark/src/KsMainWindow.hpp @@ -159,6 +159,8 @@ private: QSettings _settings; + QMetaObject::Connection _captureErrorConnection; + void _open(); void _restoreSession(); From patchwork Tue Jul 9 15:56:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 11037189 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 F17B714C0 for ; Tue, 9 Jul 2019 15:57:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E29C22870C for ; Tue, 9 Jul 2019 15:57:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D757D28714; Tue, 9 Jul 2019 15:57: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=-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 9228D2870C for ; Tue, 9 Jul 2019 15:57:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726133AbfGIP5c (ORCPT ); Tue, 9 Jul 2019 11:57:32 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:51036 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726211AbfGIP5c (ORCPT ); Tue, 9 Jul 2019 11:57:32 -0400 Received: by mail-wm1-f67.google.com with SMTP id v15so3652804wml.0 for ; Tue, 09 Jul 2019 08:57:31 -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=pYazrgosvtTthqaC1yaLNiDyalB8WLVpERa/5Wr2ZZE=; b=DttUS7coK4OyqNwgWzqmswMSI1i11mZXBaeGj860KkJgVJ88LI/QW88AAeB0qTEXvK whKLOdMNItBw47NBqeak7zc6HeXN7FOYY72AqJOYdGf6E7Cy84A6WdIhiBlGVAiYqMXC eYRmjKnYcKjsEyRm8sD/MJSoICVaoiupKUcjvyFOVQbykoegsws49vwbPiTzxVR0+wfY DIHLeu5W0RFvuHKI+a1CuhSkO5EJDw+kVE9ITQXidrO6hi97FvN4Y7Du/Hki6xAUMaiK CvhgP/p5bOF19GD4bzMt0Qux2jeh79w3N4mIKw1UsRHbV4F/dMyMFMOY/7QSQCcU9c1Q nYfg== 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=pYazrgosvtTthqaC1yaLNiDyalB8WLVpERa/5Wr2ZZE=; b=OOXZh+TTVckWgbWvWKLAZVBlY29Uy5c/4ztfjDR4aQKcnxh71qC9kYMWxiV0xm09H/ FJWUp/CE8mlyRlRSBJJF8vXck4j+vTZdd30R2qistq1R8HOi+JdRKHc1Pz4TvjNjvJ2I 4l+OAItGX7rye3hycG3QFCQrYhPAPNBGy6bLPh2WCT7+FrfrXB5rpb7WfhQGOEGuyk/L qwASjhW4jGv8Dqg/UDJJGz03E0bEhIS8qwfFDTObIUD83rjiD9Q2fmufBw6raSBF0TXd b+HmzO18e1XhlHIlFSMvGi9Xik6lBmDkN0FD47VblU+/8ZEHrZ7/vsrvX4EQ7yRVDgMy 02iQ== X-Gm-Message-State: APjAAAWAzOUr9iZj2vTd70HFTYHE/t2FN7Xd2orJ9bdbPxAV5Z4g+JuK 5ATzfw8ZVzQnVJn29rabcFg= X-Google-Smtp-Source: APXvYqy3ZLSCtYQ5hNKF+OdcRYJALsCS4e7Euf81VkNhsYp42sMSd5z6EkoE7mQlMtCsIxijNBGgvA== X-Received: by 2002:a1c:770d:: with SMTP id t13mr559784wmi.79.1562687850405; Tue, 09 Jul 2019 08:57:30 -0700 (PDT) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id v5sm24313746wre.50.2019.07.09.08.57.29 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 09 Jul 2019 08:57:30 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, "Yordan Karadzhov (VMware)" Subject: [PATCH 8/8] kernel-shark: Less scary error message from Capture dialog Date: Tue, 9 Jul 2019 18:56:50 +0300 Message-Id: <20190709155650.2345-9-y.karadz@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190709155650.2345-1-y.karadz@gmail.com> References: <20190709155650.2345-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 Most likely the reason for this error to occur is that the KernelShark GUI is not open (was closed). Signed-off-by: Yordan Karadzhov (VMware) --- kernel-shark/src/KsCaptureDialog.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel-shark/src/KsCaptureDialog.cpp b/kernel-shark/src/KsCaptureDialog.cpp index c877094..acba330 100644 --- a/kernel-shark/src/KsCaptureDialog.cpp +++ b/kernel-shark/src/KsCaptureDialog.cpp @@ -554,6 +554,9 @@ void KsCaptureDialog::_sendOpenReq(const QString &fileName) socket->flush(); socket->disconnectFromServer(); } else { - _captureMon.print(socket->errorString()); + QString error(socket->errorString()); + + error += "\n(maybe KernelShark GUI is not open)"; + _captureMon.print(error); } }