From patchwork Wed Nov 1 14:33:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Thierry X-Patchwork-Id: 10036447 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A98FF603B5 for ; Wed, 1 Nov 2017 14:35:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2A3828ACE for ; Wed, 1 Nov 2017 14:35:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 975DE28BCF; Wed, 1 Nov 2017 14:35:19 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 24E2F28ACE for ; Wed, 1 Nov 2017 14:35:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=h9YSW9ez0FlZPkZtwGEptV7FfUf7v4SAODiue+d4y1I=; b=GnyaU/NvB7Jv3GRYI+CxnLYmYq CViG0bAyrFfc9PXT4A9Wa36psjaxjGXXQBuK5+e2WTdLu6ub+gcG31JTPxXPRJoUIYzXqIWjQ46QZ 2oRNRy0lhVzc36H5xC4SErks1/GzBxn40+w5/ljCTmfV5A8xeEzmiQeWxjJNPc7E1Q7SCXsVV+6Om Kjj0fU8fD0uNvmX0nJfG/DkkoIeoyxi/Oi5VouOgGJKRpw6/qU7lywpk3BPHDhW2wKgwd/u/zxM8/ fiQ9FiChRk1CwluZvwbmDwGlmlJpedbwfrf6VJK4iVKNU3whC6LAb2PVs3UoJjMFPNgyO2SlEwEfN oMlaTHZg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e9u6q-0006q5-Jv; Wed, 01 Nov 2017 14:35:12 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e9u5w-0005QA-EU for linux-arm-kernel@lists.infradead.org; Wed, 01 Nov 2017 14:34:20 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F37481610; Wed, 1 Nov 2017 07:33:56 -0700 (PDT) Received: from e112298-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 56FBB3F3E1; Wed, 1 Nov 2017 07:33:55 -0700 (PDT) From: Julien Thierry To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/2] perf: Fix ftrace builtin when kernel doesn't have function_graph Date: Wed, 1 Nov 2017 14:33:44 +0000 Message-Id: <1509546824-46165-3-git-send-email-julien.thierry@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509546824-46165-1-git-send-email-julien.thierry@arm.com> References: <1509546824-46165-1-git-send-email-julien.thierry@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171101_073416_860321_A8347E60 X-CRM114-Status: GOOD ( 11.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Julien Thierry , Peter Zijlstra , Will Deacon , linux-kernel@vger.kernel.org, rostedt@goodmis.org, takahiro.akashi@linaro.org, Ingo Molnar MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When linux is built without support for function graph tracer, the ftrace builtin of perf will fail when trying to reset max_graph_depth because the file does not exist. This prevents the use of function tracer from perf. Do not attempt to write this file when the tracer in use is not function_graph. Signed-off-by: Julien Thierry Cc: Will Deacon Cc: Mark Rutland Cc: Peter Zijlstra Cc: Ingo Molnar Cc: linux-kernel@vger.kernel.org --- tools/perf/builtin-ftrace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 1.9.1 diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c index 25a42ac..48120f2 100644 --- a/tools/perf/builtin-ftrace.c +++ b/tools/perf/builtin-ftrace.c @@ -130,7 +130,8 @@ static int reset_tracing_files(struct perf_ftrace *ftrace __maybe_unused) if (reset_tracing_cpu() < 0) return -1; - if (write_tracing_file("max_graph_depth", "0") < 0) + if (!strcmp(ftrace->tracer, "function_graph") && + write_tracing_file("max_graph_depth", "0") < 0) return -1; reset_tracing_filters();