Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp5722069rwb; Wed, 9 Aug 2023 08:18:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGRwtwyEhn+InVXaEAGvIJa9A43x9t7QrD1qruHAkOlb0fqmlzlpgEoCU/OGqH7vTa8+gz5 X-Received: by 2002:a05:6870:9a25:b0:1be:ceca:c666 with SMTP id fo37-20020a0568709a2500b001bececac666mr3867162oab.14.1691594299547; Wed, 09 Aug 2023 08:18:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691594299; cv=none; d=google.com; s=arc-20160816; b=oH+Xn/XUyenlCKSOdxBvvtqNkkVrp/yP9IDQ+KolLbo7gjtNnhuS04puHDTK/KKyy6 Med3aQKdyvI6uylfYGHbNK1dWX53ByR0ooCh6RMTYztw6HIFiHuH9cBUfNU5qhVKHVEb 3pTrKaiSdwRZsq77utrpQ2JWR0QK66g4vNujCz2D0rVncx04DJgltpgOHNETqylTdL4d tpaGj6Cax9Yv49FdprrhPSZZepbYBLKuiEMKnOOFTSpY9jk/q/1sSzbr67JelNj/D5xS /ILIs+ANcFZPYxOJBz3WmPjqcP+rQVcGqEBb8CbgCsYiOdU3Lq+Q4rjVF4GOpmYpGs9o cDKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=RB5mjtToncur0dtAZZXnWVL5TDYLd9jR7YWCsH03qrQ=; fh=g9Bw0epkbGk1DkAgG7vR8XN0xStfTcipNOxWcjLkU0g=; b=ia2hR201hwOagLyD1TMRDt/CiGwC0otiewlte+DgN0GCCF3TAlkGzB9Jg1O9cLhGAt KFRtsTQLPOJGqN7IVE86gRohQdno6cbqqiuTq6biiNEl1YKr+YYzNkRd2avpvFb+AYh1 jSP23YWMgwUVFdeUvyVrVK+l3nN/Dsu2yNXRb6GzSSNFY/qp8MFZSs3mSQiF14Q+zd2U xm6vORDariXV78LtZwHTA5XGZsYEcOY8rwQvNgirkeTfUSlBOoMziQMViJ9uLZD9bRYD rX+lsN+4d0xAcWSGMxzA+71CgrQEZ4W4lohZhO5zoZOs9E8wjW3ymxH0CiR2RwpJBmam O02g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U1CjP3mW; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g188-20020a636bc5000000b0053f3b62c207si9064227pgc.767.2023.08.09.08.18.07; Wed, 09 Aug 2023 08:18:19 -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=@kernel.org header.s=k20201202 header.b=U1CjP3mW; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233217AbjHIOQQ (ORCPT + 99 others); Wed, 9 Aug 2023 10:16:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232513AbjHIOQP (ORCPT ); Wed, 9 Aug 2023 10:16:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC19E2110; Wed, 9 Aug 2023 07:16:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 82BBF63476; Wed, 9 Aug 2023 14:16:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 982C1C433C9; Wed, 9 Aug 2023 14:16:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691590572; bh=1SsVUXtWZgOegRFQu/GbBOH3DZTNW23JsvaY2VEYgBY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=U1CjP3mWibzJWHlC+0WnkiYzptEzDbUEGoUKGfIq13sTvP5wK9jycbLETah8A4uHz iTlb/R0Qtz6uGeKJE3Au1LooZ601DpkjB+604scSfx55ovfJRN5gd43KUzLXG/WnLk ABdowwihO3Dh788RrYv5zy7hEb0U8ET8wH64r8ZYq0RleqaQEopIAxOn+F+swadv4S 8BbhiYTOTnHQGDY18ffsYNZaIWrBXUlpNkzXbVYsa1ngNVVwY6fq5JgkQWK0Ex8iHZ UVQyWpG55QO1akmjijvJDSzzRZ8bzMzlNK0Ntp6hZNmi90F74cChRsgswa2CANnr42 hWYULQmdXtlFQ== Date: Wed, 9 Aug 2023 23:16:07 +0900 From: Masami Hiramatsu (Google) To: Florent Revest 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 Subject: Re: [RFC PATCH v2 2/6] tracing: Expose ftrace_regs regardless of CONFIG_FUNCTION_TRACER Message-Id: <20230809231607.0c5c75e7c3b69fcc96d82cb4@kernel.org> In-Reply-To: References: <169139090386.324433.6412259486776991296.stgit@devnote2> <169139092722.324433.16681957760325391475.stgit@devnote2> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS 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 Wed, 9 Aug 2023 12:29:13 +0200 Florent Revest wrote: > On Mon, Aug 7, 2023 at 8:48 AM 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 int 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 function > > nit: disables* Thanks! > > > + * tracer, define the default(pt_regs compatible) ftrace_regs. > > + */ > > +#if !defined(CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS) || !defined(CONFIG_FUNCTION_TRACER) > > I wonder if we should make things simpler with: > > #if defined(HAVE_PT_REGS_COMPAT_FTRACE_REGS) || !defined(CONFIG_FUNCTION_TRACER) > > 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. Here, the "HAVE_PT_REGS_COMPAT_FTRACE_REGS" does not mean that the ftrace_regs is completely compatible with pt_regs, but on the memory it wraps struct pt_regs (thus we can just cast the type). - CONFIG_DYNAMIC_FTRACE_WITH_REGS ftrace_regs is completely compatible with pt_regs - CONFIG_DYNAMIC_FTRACE_WITH_ARGS | ftrace_regs may not compatible with pt_regs | +- CONFIG_HAVE_PT_REGS_COMPAT_FTRACE_REGS but on memory image, ftrace_regs includes pt_regs. Thank you, > > Maybe that's a question for Steven ? -- Masami Hiramatsu (Google)