From patchwork Thu May 25 21:00:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nadav Amit X-Patchwork-Id: 99200 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp48029vqr; Thu, 25 May 2023 14:14:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5beube7lGEfhawqUIeZoaY3+5nDRkErQdWgH+/mmv3QxTCeMMxxEd5XlxRYVKwOTC7TVId X-Received: by 2002:a05:6a21:338d:b0:10f:8798:9ff3 with SMTP id yy13-20020a056a21338d00b0010f87989ff3mr567457pzb.8.1685049244478; Thu, 25 May 2023 14:14:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685049244; cv=none; d=google.com; s=arc-20160816; b=CDuMTQ1Lpcvla7mmIZOX+u2p/paLOF+X2i9SduwiXUCLXzOD40+JycE0XM+2lryraU fAqVUsqph5s6GMcISBJuQG7SGKOBVndni46mvAiT1aSs/KaT3j+oR5BQ+fdbn8NumtPy Fzls0ysZLJbz87b7Rcg/tyg/ylpY9W2LM0PZrDWcdYt3zcfMIVN3ChQUgIitTRD+5y+3 7ItYRqpHFa8zcdgFyMsQ+x+6Vp2D4wh2AioF/ZsPtzKiIcdbOQDMvcCAFtIFfS3BPlUG ll8IwNfaYgUaGzCcawxqpFpcvsEwFPAd2XsYxDsvV/K0pCDMcGWwUzT7BXQhfkHCr5Pq +V7w== 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:date:subject:cc:to:from :dkim-signature; bh=plByf+i5Fok3NQ/XAuXTsKM1rTLN/fzcmyU+yIiV4ic=; b=PJrqi+tdUFC3/Gu1FPFfFmgklGDVXD3r9Pmw/9wAiQ3OHBs8kCUQ5bfaT2FjAl3t8P 98gW5+uo0eNVHOOyY5HT5ddLEczuDm+SsodZC3dn3pWTOcSjnt9Mvw5legQO+bi643T1 hUTiAgHloRiJ7RyKvxrsruoBmr3h+9QgQfOpv46Gk3ZlIpdcEkR0CI2QZ3cTGhuaSIwp z2TT14jngNhSoSteJgtNlBwHYohO08lCcpZJQ1Y8cX5XzTuVGCvL4oqBwYZD4RIlyEtX 5nOxj0dIUkLN22d/k63s/ASZRRS+9AfoVc3E7254OpzJx5AAYkSDlZbRBOB1J5OYbvUR rZzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=ky1DBxa8; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g9-20020a63fa49000000b00524eef20da6si1363440pgk.642.2023.05.25.14.13.48; Thu, 25 May 2023 14:14:04 -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=@gmail.com header.s=20221208 header.b=ky1DBxa8; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241879AbjEYVBH (ORCPT + 99 others); Thu, 25 May 2023 17:01:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232445AbjEYVBC (ORCPT ); Thu, 25 May 2023 17:01:02 -0400 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6D9F1B0; Thu, 25 May 2023 14:00:59 -0700 (PDT) Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-53f448cde66so224a12.1; Thu, 25 May 2023 14:00:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685048459; x=1687640459; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=plByf+i5Fok3NQ/XAuXTsKM1rTLN/fzcmyU+yIiV4ic=; b=ky1DBxa8WM/81sXdcWNsMFPfMbMP9MSiSdnrHilDQ/bSg2mSQmbDjXxAj/wajJaFUp 2gHwA6b91A/ZdrHsNZAZV/2bMQXTNbmu9qNkC/KU0o1CB4hFllmUSgChAccRy4BFisHs hhRd6ZfPQ5bTE1jlxQYbLXLkgZLIfV6YYgsMjhvW2xuU5vMy2ZmzUrBc+/kZRMeVcMKg ff9XqIFg5W3W3DzqWq0SHrWXHHv2SgUDWGPxuba7+I5YkxQLmn1ay4zak4VMFOxDzlFF 5hQWwXHIqlw1J2bO7BYDEhq6PJu3rAiTxW0yUtTf9WOJj4FDfs0Aywdwxa4b9BY73ZPN esRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685048459; x=1687640459; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=plByf+i5Fok3NQ/XAuXTsKM1rTLN/fzcmyU+yIiV4ic=; b=WMI2MKRo6aQegeV7QGyseWvYbH72NEEEvIjkHllQI1sOc2lsGzrZ5/esqKtD3mrS6j 2QSW0fkXrWhjwv1eEEPPIJpnfQsOKS2bU3xvk3jCKTuZpreA+6tm/fyTlJG6ia2vzuC3 PY99HicvJd+rtuSHo0c1GVUDgzJfhh3TEptrU7g1oPPAniO9TGosHiaZTlun6QrdGrM0 x6JNoVWlAisSgmjKNzz5xaPHzlIbILDocWinXkf5u7rfgRPwCws381FjUl9wKYKciB+3 1en1FpYZciPgbLLkREfHwVdvfSrcuNTDx2nXb2VcEHEagtk3trN9HifqOVP4hsgjoKO3 jW+g== X-Gm-Message-State: AC+VfDybzzIfzv80vN+i5u+YK9kgc9sGH6uIQZ1RahZ9w/Dn2Ifa8HJf aO8cVc6OE4757UfMR3X82Dc= X-Received: by 2002:a17:903:32c3:b0:1af:9b8a:9c79 with SMTP id i3-20020a17090332c300b001af9b8a9c79mr3676440plr.34.1685048459053; Thu, 25 May 2023 14:00:59 -0700 (PDT) Received: from sc2-haas01-esx0118.eng.vmware.com ([66.170.99.1]) by smtp.gmail.com with ESMTPSA id j21-20020a170902c3d500b001ae8587d60csm1807673plj.265.2023.05.25.14.00.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 14:00:58 -0700 (PDT) From: Nadav Amit X-Google-Original-From: Nadav Amit To: Steven Rostedt , "Arnd Bergmann" , "Thomas Gleixner" Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org, linux-um@lists.infradead.org, Linux-Arch , linux-mm@kvack.org, "Andy Lutomirski" , "Ingo Molnar" , "Dave Hansen" , "Borislav Petkov" , x86@kernel.org, Peter Zijlstra , Nadav Amit Subject: [PATCH v2 2/3] compiler: inline does not imply notrace Date: Thu, 25 May 2023 14:00:39 -0700 Message-Id: <20230525210040.3637-3-namit@vmware.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230525210040.3637-1-namit@vmware.com> References: <20230525210040.3637-1-namit@vmware.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766902196674382686?= X-GMAIL-MSGID: =?utf-8?q?1766902196674382686?= From: Nadav Amit Functions that are marked as "inline" are currently also not tracable. This limits tracing functionality for many functions for no reason. Apparently, this has been done for two reasons. First, as described in commit 5963e317b1e9d2a ("ftrace/x86: Do not change stacks in DEBUG when calling lockdep"), it was intended to prevent some functions that cannot be traced from being traced as these functions were marked as inline (among others). Yet, this change has been done a decade ago, and according to Steven Rostedt, ftrace should have improved and hopefully resolved nested tracing issues by now. Arguably, if functions that should be traced - for instance since they are used during tracing - still exist, they should be marked as notrace explicitly. The second reason, which Steven raised, is that attaching "notrace" to "inline" prevented tracing differences between different configs, which caused various problem. This consideration is not very strong, and tying "inline" and "notrace" does not seem very beneficial. The "inline" keyword is just a hint, and many functions are currently not tracable due to this reason. Disconnect "inline" from "notrace". Signed-off-by: Nadav Amit --- include/linux/compiler_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h index 547ea1ff806e..bab3e25bbe3f 100644 --- a/include/linux/compiler_types.h +++ b/include/linux/compiler_types.h @@ -184,7 +184,7 @@ struct ftrace_likely_data { * of extern inline functions at link time. * A lot of inline functions can cause havoc with function tracing. */ -#define inline inline __gnu_inline __inline_maybe_unused notrace +#define inline inline __gnu_inline __inline_maybe_unused /* * gcc provides both __inline__ and __inline as alternate spellings of