From patchwork Wed Jul 10 13:46:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11038585 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 0D0ED17EF for ; Wed, 10 Jul 2019 13:47:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 000CF28941 for ; Wed, 10 Jul 2019 13:47:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E906028948; Wed, 10 Jul 2019 13:47: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=-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 6165B28910 for ; Wed, 10 Jul 2019 13:47:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727627AbfGJNr1 (ORCPT ); Wed, 10 Jul 2019 09:47:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:56232 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727250AbfGJNr0 (ORCPT ); Wed, 10 Jul 2019 09:47:26 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 588122084B; Wed, 10 Jul 2019 13:47:26 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.92) (envelope-from ) id 1hlCwP-0002oa-8H; Wed, 10 Jul 2019 09:47:25 -0400 Message-Id: <20190710134725.144595473@goodmis.org> User-Agent: quilt/0.65 Date: Wed, 10 Jul 2019 09:46:37 -0400 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Cc: Yordan Karadzhov Subject: [PATCH 1/4] revert: "kernel-shark: Remove a duplicate error message" References: <20190710134636.116362181@goodmis.org> 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 From: "Steven Rostedt (VMware)" It turns out that if the kshark-record dialog does not show up for some reason, then without this "duplicate" message, the user gets no message at all to why the dialog did not appear. Signed-off-by: Steven Rostedt (VMware) --- kernel-shark/src/KsMainWindow.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp index 8826cf5cf8b2..198b410480a1 100644 --- a/kernel-shark/src/KsMainWindow.cpp +++ b/kernel-shark/src/KsMainWindow.cpp @@ -1154,9 +1154,35 @@ 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 Wed Jul 10 13:46:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11038591 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 85717184E for ; Wed, 10 Jul 2019 13:47:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76B8528900 for ; Wed, 10 Jul 2019 13:47:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B0292891B; Wed, 10 Jul 2019 13:47: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=-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 F3A4428910 for ; Wed, 10 Jul 2019 13:47:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727626AbfGJNr1 (ORCPT ); Wed, 10 Jul 2019 09:47:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:56228 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727325AbfGJNr1 (ORCPT ); Wed, 10 Jul 2019 09:47:27 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 59EDF2087F; Wed, 10 Jul 2019 13:47:26 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.92) (envelope-from ) id 1hlCwP-0002p4-Cz; Wed, 10 Jul 2019 09:47:25 -0400 Message-Id: <20190710134725.284088060@goodmis.org> User-Agent: quilt/0.65 Date: Wed, 10 Jul 2019 09:46:38 -0400 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Cc: Yordan Karadzhov Subject: [PATCH 2/4] kernel-shark: Remove the "make install" suggestion for capture errors References: <20190710134636.116362181@goodmis.org> 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 From: "Yordan Karadzhov (VMware)" 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. [ Steve: Although I hit this warning without needing a make install ;-) ] Link: http://lore.kernel.org/linux-trace-devel/20190709155650.2345-7-y.karadz@gmail.com Signed-off-by: Yordan Karadzhov (VMware) [ Removed "duplicate" print of it as well ] Signed-off-by: Steven Rostedt (VMware) --- kernel-shark/src/KsMainWindow.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp index 198b410480a1..13b50795340c 100644 --- a/kernel-shark/src/KsMainWindow.cpp +++ b/kernel-shark/src/KsMainWindow.cpp @@ -1179,7 +1179,6 @@ void KsMainWindow::_captureFinished(int ret, QProcess::ExitStatus st) QString message = "Capture process failed:
"; message += capture->errorString(); - message += "
Try doing:
sudo make install"; _error(message, "captureFinishedErr", false, false); } @@ -1191,8 +1190,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 Wed Jul 10 13:46:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11038593 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 32E6617EF for ; Wed, 10 Jul 2019 13:47:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 256CC28900 for ; Wed, 10 Jul 2019 13:47:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1903028910; Wed, 10 Jul 2019 13:47: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=-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 810D828915 for ; Wed, 10 Jul 2019 13:47:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727250AbfGJNr1 (ORCPT ); Wed, 10 Jul 2019 09:47:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:56242 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727602AbfGJNr0 (ORCPT ); Wed, 10 Jul 2019 09:47:26 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 66785208C4; Wed, 10 Jul 2019 13:47:26 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.92) (envelope-from ) id 1hlCwP-0002pX-Hu; Wed, 10 Jul 2019 09:47:25 -0400 Message-Id: <20190710134725.436998774@goodmis.org> User-Agent: quilt/0.65 Date: Wed, 10 Jul 2019 09:46:39 -0400 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Cc: Yordan Karadzhov Subject: [PATCH 3/4] kernel-shark: Show the standard error of kshark-record References: <20190710134636.116362181@goodmis.org> 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 From: "Steven Rostedt (VMware)" When kshark-record fails, report the standard error which can be very useful for debugging the issue that when wrong. For example, after removing the kshark lib functions, instead of just having "Unknow error" print when kshark-record dialog fails, I now get: /usr/local/bin/kshark-record: error while loading shared libraries: libkshark-gui.so.0.9.8: cannot open shared object file: No such file or directory Signed-off-by: Steven Rostedt (VMware) --- kernel-shark/src/KsMainWindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp index 13b50795340c..54aa6d782ad1 100644 --- a/kernel-shark/src/KsMainWindow.cpp +++ b/kernel-shark/src/KsMainWindow.cpp @@ -1179,7 +1179,7 @@ void KsMainWindow::_captureFinished(int ret, QProcess::ExitStatus st) QString message = "Capture process failed:
"; message += capture->errorString(); - + message += capture->readAllStandardError(); _error(message, "captureFinishedErr", false, false); } } @@ -1190,6 +1190,7 @@ void KsMainWindow::_captureError(QProcess::ProcessError error) QString message = "Capture process failed:
"; message += capture->errorString(); + message += capture->readAllStandardError(); _error(message, "captureFinishedErr", false, false); } From patchwork Wed Jul 10 13:46:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11038589 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 6AF9F1890 for ; Wed, 10 Jul 2019 13:47:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5ECFC2893A for ; Wed, 10 Jul 2019 13:47:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5293428984; Wed, 10 Jul 2019 13:47: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=-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 C9E3A2893A for ; Wed, 10 Jul 2019 13:47:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727539AbfGJNr1 (ORCPT ); Wed, 10 Jul 2019 09:47:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:56248 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727626AbfGJNr1 (ORCPT ); Wed, 10 Jul 2019 09:47:27 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9633C20651; Wed, 10 Jul 2019 13:47:26 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.92) (envelope-from ) id 1hlCwP-0002q4-Mm; Wed, 10 Jul 2019 09:47:25 -0400 Message-Id: <20190710134725.599995325@goodmis.org> User-Agent: quilt/0.65 Date: Wed, 10 Jul 2019 09:46:40 -0400 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Cc: Yordan Karadzhov Subject: [PATCH 4/4] kernel-shark: Use
for dialog and \n for console error messages References: <20190710134636.116362181@goodmis.org> 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 From: "Steven Rostedt (VMware)" The Qt dialog boxes require '
' to print a new line but consoles require a '\n'. Instead of printing '
' to the console or '\n' to the dialog, always have the '\n' turn into '
' for the dialog and all '
' turn into '\n' for the console. Signed-off-by: Steven Rostedt (VMware) Reviewed-by: Yordan Karadzhov (VMware) --- kernel-shark/src/KsMainWindow.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp index 54aa6d782ad1..29d44d9a9230 100644 --- a/kernel-shark/src/KsMainWindow.cpp +++ b/kernel-shark/src/KsMainWindow.cpp @@ -1028,10 +1028,12 @@ void KsMainWindow::loadDataFile(const QString& fileName) } } -void KsMainWindow::_error(const QString &text, const QString &errCode, +void KsMainWindow::_error(const QString &mesg, const QString &errCode, bool resize, bool unloadPlugins) { QErrorMessage *em = new QErrorMessage(this); + QString text = mesg; + QString html = mesg; if (resize) _resizeEmpty(); @@ -1039,8 +1041,11 @@ void KsMainWindow::_error(const QString &text, const QString &errCode, if (unloadPlugins) _plugins.unloadAll(); + text.replace("
", "\n", Qt::CaseInsensitive); + html.replace("\n", "
", Qt::CaseInsensitive); + qCritical().noquote() << "ERROR: " << text; - em->showMessage(text, errCode); + em->showMessage(html, errCode); em->exec(); }