Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5765477ioo; Wed, 1 Jun 2022 12:06:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxg7L+yt/imLLl7kxlczh4p+G2QVECFX62a4tLLDubsAemJTgfpXnynqOD/Scb80e56/zNg X-Received: by 2002:a17:902:e84a:b0:163:df09:9083 with SMTP id t10-20020a170902e84a00b00163df099083mr889810plg.43.1654110374902; Wed, 01 Jun 2022 12:06:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654110374; cv=none; d=google.com; s=arc-20160816; b=q+qbNWveWJ+c2uCzGoESg8ydujf8eXYRfKBV7Awsu3hK+QQ4Wn5N3zTNSLbEijZiDw ys5iJ8dUBOn0bRilGGps5cym3FGzby0g/IqyIsWBMCbZsJQ2MPSScDvJDV677x61RLN+ 0mm7HoTMaO2l7ID06uC/lehpmc4GSaUAtWPtU6P5IJMYCoi/H3jghcb6UgjTBg4kFDxe TqIdvYq3pO3Ec9AWfOYGSXCQyCdcaTDqQDhokPHcxaDZtf0hvud3v//+76pvoZHciPNw RiU+tRXy3Anzgfbmhmxe7afBYeAX4tBeqnf5dXIegiuliZiyPVyXuMh79K4vwuy8I0Wf 8EVQ== 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; bh=kWveidJkxJSG9fqZ+Dd7nvGBIdc+MLuFGbr2I6Ya4n4=; b=UMH7JJi2KI8zujv8yRIKAMgzcsOI28oLvVURbAAydzxmgn0Kowi7g0wJe2CIraKb/2 oX5YrY9MVSWcbTjz1Ghm6NmAPBuacvtTUhXtIv9AJ3yVM5dsI6AzEstqqA9rjrmtGsAx H7p5+YaKXavka/ScOl8skfnwAFNFTJK6ZBGBdhzefMOUPSaqHyC/bZELIJL5pTGHombP d506XnMW1HPmXuD7w4nfVndOwWsfTix7FKZ867Q/WjtklcZIRzU+pZOJY/9Qj4arctZ2 W0ArvK7QGp85jFUGEFN9SDuG6ygIyPH8OhCFtYAwYmGXH2nBnFk4SkeSsz1Tn+RxmbN2 eJwg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id w4-20020a631604000000b003c380b38a80si3207306pgl.307.2022.06.01.12.06.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 12:06:14 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AB33410656F; Wed, 1 Jun 2022 11:47:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356525AbiFAR6W convert rfc822-to-8bit (ORCPT + 99 others); Wed, 1 Jun 2022 13:58:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245473AbiFAR6N (ORCPT ); Wed, 1 Jun 2022 13:58:13 -0400 Received: from mx0b-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A8BA6A420 for ; Wed, 1 Jun 2022 10:58:11 -0700 (PDT) Received: from pps.filterd (m0148460.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 251Dsljb013172 for ; Wed, 1 Jun 2022 10:58:10 -0700 Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3gdv91wdyn-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 01 Jun 2022 10:58:10 -0700 Received: from snc-exhub201.TheFacebook.com (2620:10d:c085:21d::7) by snc-exhub204.TheFacebook.com (2620:10d:c085:21d::4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Wed, 1 Jun 2022 10:58:07 -0700 Received: from twshared14818.18.frc3.facebook.com (2620:10d:c085:108::8) by mail.thefacebook.com (2620:10d:c085:21d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Wed, 1 Jun 2022 10:58:07 -0700 Received: by devbig932.frc1.facebook.com (Postfix, from userid 4523) id 79B608603CC6; Wed, 1 Jun 2022 10:58:02 -0700 (PDT) From: Song Liu To: , , CC: , , , , , , Song Liu Subject: [PATCH bpf-next 1/5] ftrace: allow customized flags for ftrace_direct_multi ftrace_ops Date: Wed, 1 Jun 2022 10:57:45 -0700 Message-ID: <20220601175749.3071572-2-song@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220601175749.3071572-1-song@kernel.org> References: <20220601175749.3071572-1-song@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT X-FB-Internal: Safe Content-Type: text/plain X-Proofpoint-GUID: wNeSjBOPD4IQM2ZjcJQNBrJ7nvP-A0wI X-Proofpoint-ORIG-GUID: wNeSjBOPD4IQM2ZjcJQNBrJ7nvP-A0wI X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-01_06,2022-06-01_01,2022-02-23_01 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 This enables users of ftrace_direct_multi to specify the flags based on the actual use case. For example, some users may not set flag IPMODIFY. Signed-off-by: Song Liu --- kernel/trace/ftrace.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 2fcd17857ff6..afe782ae28d3 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -5456,8 +5456,7 @@ int modify_ftrace_direct(unsigned long ip, } EXPORT_SYMBOL_GPL(modify_ftrace_direct); -#define MULTI_FLAGS (FTRACE_OPS_FL_IPMODIFY | FTRACE_OPS_FL_DIRECT | \ - FTRACE_OPS_FL_SAVE_REGS) +#define MULTI_FLAGS (FTRACE_OPS_FL_DIRECT | FTRACE_OPS_FL_SAVE_REGS) static int check_direct_multi(struct ftrace_ops *ops) { @@ -5547,7 +5546,7 @@ int register_ftrace_direct_multi(struct ftrace_ops *ops, unsigned long addr) } ops->func = call_direct_funcs; - ops->flags = MULTI_FLAGS; + ops->flags |= MULTI_FLAGS; ops->trampoline = FTRACE_REGS_ADDR; err = register_ftrace_function(ops); -- 2.30.2