From patchwork Tue Jul 23 22:50:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11055411 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 6619C13A0 for ; Tue, 23 Jul 2019 22:52:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5862328718 for ; Tue, 23 Jul 2019 22:52:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D3C82873D; Tue, 23 Jul 2019 22:52:43 +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 2615B2873F for ; Tue, 23 Jul 2019 22:52:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392323AbfGWWwl (ORCPT ); Tue, 23 Jul 2019 18:52:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:56686 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392358AbfGWWwk (ORCPT ); Tue, 23 Jul 2019 18:52:40 -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 D01F5227BF; Tue, 23 Jul 2019 22:52:39 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.92) (envelope-from ) id 1hq3eA-000806-VM; Tue, 23 Jul 2019 18:52:38 -0400 Message-Id: <20190723225238.859019956@goodmis.org> User-Agent: quilt/0.65 Date: Tue, 23 Jul 2019 18:50:46 -0400 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Cc: Yordan Karadzhov Subject: [PATCH 2/2] kernel-shark: Set the DISPLAY environment for pkexec kshark-record References: <20190723225044.576298160@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 running a fresh install, I hit this: ERROR: Capture process failed: Unknown errorqt.qpa.screen: QXcbConnection: Could not connect to display Could not connect to any X display. This was due to pkexec not saving the DISPLAY environment variable. To solve this, pass that variable as one of the environment variables to pkexec. Signed-off-by: Steven Rostedt (VMware) Reviewed-by: Yordan Karadzhov (VMware) --- kernel-shark/bin/kshark-su-record | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel-shark/bin/kshark-su-record b/kernel-shark/bin/kshark-su-record index 7faff1cb3339..8c9fbd02a351 100755 --- a/kernel-shark/bin/kshark-su-record +++ b/kernel-shark/bin/kshark-su-record @@ -6,4 +6,4 @@ then fi THIS_DIR=`dirname $0` -pkexec ${THIS_DIR}/kshark-record -o ${PWD}/trace.dat +pkexec env DISPLAY=${DISPLAY} ${THIS_DIR}/kshark-record -o ${PWD}/trace.dat