Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp5584921rwb; Wed, 9 Aug 2023 06:28:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFtfomsOlDhvqwESaVlGx7HVMsWIzPF/r4cVFMXKEYNrq5xeFtqlCF575D1qVu3bV8YTbbB X-Received: by 2002:a17:906:3298:b0:99b:6e54:bd6e with SMTP id 24-20020a170906329800b0099b6e54bd6emr2090281ejw.56.1691587720489; Wed, 09 Aug 2023 06:28:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691587720; cv=none; d=google.com; s=arc-20160816; b=aNSrdR8Bv7UpW0W18MvTlAvHB+2mayyHcqfBdkO8ZJ8nQ8aRMKx+v7X9RpUFdXiEij yOGaeGLldo4ihmcYurI6EoXKpBUvFjCbVRoH0C4RDxzIUne0SldcFGubONY1TWfTk4jr 602yNH2GfReIzd5WA9HgDoHkPlFqe1Ook87DY/wjxrfcKA82HbafLfIsB+k7NUcnl0mU YZmgszjHD3uozBYq0Tff7xG3UQSsm6s6tiozOUidk/CPsfeVK+O+2mCcFYzlOdfFy2Xv lEOMyaumrR/17596JqECceJSeQ7RdI2CfyZNBDvODC3L8B5cuv8LNYpCDghESGzqbrLZ 4Mqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=dbRTactPL+UoTh7JhtLP7m2QS4BKZHHCNQWVDx5nQag=; fh=4Ch4P+TGKtpbgfG71/kyuyy4wiNIYjEkJGijdTSHSpA=; b=jxkYzbrGxnMN19e7QTKHB4wAu6SYKVw5NEv/AYcmEqmOm3psVsI9N+2bx3wHV8ag2e ZvtG3NSRrFZQRuiAlHpHzRLv5b2o72dP2Up9m7MyoasZWx9gExqzcaf0BrH32pqLJL43 tBIk0vYLJtgkqKJE3gYdsEQGSRleYRDNyCq3L3pSbqcL5DchJzlsIXqON7MQL+aAPL9I sDVwy3H6e/ARqEoChfIQ/PFXFTNYQQUb7iXyVKpbuhxr6+OwtZLeNZISNFY6j8vyUiQ3 QZ1y5Nn2p8nXmvHfLX5VYn3W75oAwE9rQMdY+uAs8HdcKfIH/NFYibA4fuT7ZG2SR5bb asVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="GEO0/nvB"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s17-20020a1709067b9100b0099bc2498813si8752466ejo.323.2023.08.09.06.28.16; Wed, 09 Aug 2023 06:28:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="GEO0/nvB"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231737AbjHIK30 (ORCPT + 99 others); Wed, 9 Aug 2023 06:29:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230210AbjHIK3Z (ORCPT ); Wed, 9 Aug 2023 06:29:25 -0400 Received: from mail-oo1-xc2e.google.com (mail-oo1-xc2e.google.com [IPv6:2607:f8b0:4864:20::c2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 215E31999 for ; Wed, 9 Aug 2023 03:29:25 -0700 (PDT) Received: by mail-oo1-xc2e.google.com with SMTP id 006d021491bc7-56d263da4f2so4771681eaf.0 for ; Wed, 09 Aug 2023 03:29:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691576964; x=1692181764; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=dbRTactPL+UoTh7JhtLP7m2QS4BKZHHCNQWVDx5nQag=; b=GEO0/nvBajwIJUPnEU41+WNGwH2DtulMBc4FPYU1jw1eJyQzRO1uSpXBuBH8QLOwCt GwhW7UCHdaFTfMpbBv5D8LXISJFDNz6p84oe70QtyPQ0jjTGD/KZxrq2YaTVBZXBmjLX O/QMcqR39ySFwSZn+/0ISTfXyj/Fu+13hAe1M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691576964; x=1692181764; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dbRTactPL+UoTh7JhtLP7m2QS4BKZHHCNQWVDx5nQag=; b=AKdWrnwyF9bVgEMLvTQ1EqUdJYPVcVOw/G4dv8MPNElAGGAlKGOwdvA0Iz74cO0sZd tJ7ma5O/zAXWcmGEPvn9Oq0m1hjYZhvr+io6ZH/Ur8MZ74c6cw2ammUf4J+MrDq1OdAU lTGhKmfyI0ks6flveuwP9dHlsBk+1AtfIZXIuGBY3cTD4Ztivtx0t3ixrDxKGGzzDDpy R9DAOg4eYFfTJtU8GzE8wzeBYwch70oYEd9S5qt0hpKGwMNscY1ehMYoZj9yjVtZ+lPq mD+ndI9Y38sdaiaDLb9UiILWKXkgNi7yfRaOG2hNK+9OAnTFm0LZufN2kfdcSMXmo5ia IKSQ== X-Gm-Message-State: AOJu0Yz6D5CRBBSdxDYd32jzX5BHa54WWynwXXGV6Wc/e0VfjdYCjNkv CfcdbE5TvuS1KquLySfoj541DBAz0Ntb2FaPCMB0hg== X-Received: by 2002:aca:2113:0:b0:3a7:4878:235a with SMTP id 19-20020aca2113000000b003a74878235amr2168484oiz.29.1691576964523; Wed, 09 Aug 2023 03:29:24 -0700 (PDT) MIME-Version: 1.0 References: <169139090386.324433.6412259486776991296.stgit@devnote2> <169139092722.324433.16681957760325391475.stgit@devnote2> In-Reply-To: <169139092722.324433.16681957760325391475.stgit@devnote2> From: Florent Revest Date: Wed, 9 Aug 2023 12:29:13 +0200 Message-ID: Subject: Re: [RFC PATCH v2 2/6] tracing: Expose ftrace_regs regardless of CONFIG_FUNCTION_TRACER To: "Masami Hiramatsu (Google)" Cc: Alexei Starovoitov , Steven Rostedt , linux-trace-kernel@vger.kernel.org, LKML , Martin KaFai Lau , bpf , Sven Schnelle , Alexei Starovoitov , Jiri Olsa , Arnaldo Carvalho de Melo , Daniel Borkmann , Alan Maguire , Mark Rutland , Peter Zijlstra , Thomas Gleixner Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 7, 2023 at 8:48=E2=80=AFAM Masami Hiramatsu (Google) wrote: > diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h > index ce156c7704ee..3fb94a1a2461 100644 > --- a/include/linux/ftrace.h > +++ b/include/linux/ftrace.h > @@ -112,11 +112,11 @@ static inline int ftrace_mod_get_kallsym(unsigned i= nt symnum, unsigned long *val > } > #endif > > -#ifdef CONFIG_FUNCTION_TRACER > - > -extern int ftrace_enabled; > - > -#ifndef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS > +/* > + * If the architecture doesn't support FTRACE_WITH_ARGS or disable funct= ion nit: disables* > + * tracer, define the default(pt_regs compatible) ftrace_regs. > + */ > +#if !defined(CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS) || !defined(CONFIG_FU= NCTION_TRACER) I wonder if we should make things simpler with: #if defined(HAVE_PT_REGS_COMPAT_FTRACE_REGS) || !defined(CONFIG_FUNCTION_TR= ACER) And remove the ftrace_regs definitions that are copy-pastes of this block in arch specific headers. Then we can enforce in a single point that HAVE_PT_REGS_COMPAT_FTRACE_REGS holds. Maybe that's a question for Steven ?