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;