Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp7671000ioo; Fri, 3 Jun 2022 11:01:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyusWlnixgMXNhcBfPWFluLDkIxA4+7rbRVxMuIvK9jIpCeg60NjCRRaZY7//1zDfV6GhbR X-Received: by 2002:a17:903:1c6:b0:161:9fbc:5a6 with SMTP id e6-20020a17090301c600b001619fbc05a6mr11351368plh.65.1654279271000; Fri, 03 Jun 2022 11:01:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654279270; cv=none; d=google.com; s=arc-20160816; b=yutf7w4OK2QX1+K2BT3VSGanogOB05vEyuVLNelmMgYcSbQL7YT5EeXj/MeBh2dhQ+ TXsRCI8Zo4me7Fi1hPFAzVC7JCZ9W+DKqjLkzBz55ln6LQWnyuNYxwgHJ4++UKTnZbgp ki1D3YnISb0MpNTJ6zUnGrs3loQo08ZJluJJsuypo2gydlmZHYBVtvt7dbXdO7hKGq3Z ubleyulI+Ge4lqIKZMF+g6d3Xq4WppgYOFxY8jo3ECLty9bpUQfb8bsj9Qyaz7s/mSz2 H79bLFm3UiJMOBZ1VtG0/y6MhFmnJ02ygGIwYomyvdkHQQzkLmYwRcvldyYWDxbACscQ QO+A== 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=cQWSTyRR4W+j4J4XDp+hR/1dvGZUcx+aaiTs3J6w9H77e+RXH7zVEzWf4pfhohUN+1 kw4hjC1jlKiZed1fgzxJL+6fMsl9AfSwz9Smr2O3mo2uQ1mmM/ITBrsM/HXtLM3BpmK0 sqnw/GU9orIdoC0j5UPyU2LTFYYlp4CBtpOzty8lTUiUjkdaJ6SdB6ToM4KVWkpm+Kv5 gkIl+2KI5S5KT2jeuCxYcNMpB9Lj8izBF/hVZw6YC0Ng2Uo0Cn2+oZ7snAt8Y5DtRFJP K4pu6Tq2AZ1JHIc1HcwOuCJ1eCOAhL79nBYJ8lGInFXh+VAEDO9tphFutuPYsCL/7kFd Wo4w== ARC-Authentication-Results: i=1; mx.google.com; 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 rm2-20020a17090b3ec200b001d2fe6d0a11si12323421pjb.176.2022.06.03.11.00.56; Fri, 03 Jun 2022 11:01:10 -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; 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 S238932AbiFBTkw convert rfc822-to-8bit (ORCPT + 99 others); Thu, 2 Jun 2022 15:40:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238909AbiFBTki (ORCPT ); Thu, 2 Jun 2022 15:40:38 -0400 Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 533AB2F3B0 for ; Thu, 2 Jun 2022 12:39:51 -0700 (PDT) Received: from pps.filterd (m0148461.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 252AItbM020992 for ; Thu, 2 Jun 2022 12:39:50 -0700 Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3geubaub24-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 02 Jun 2022 12:39:50 -0700 Received: from twshared35153.14.frc2.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:83::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Thu, 2 Jun 2022 12:39:48 -0700 Received: by devbig932.frc1.facebook.com (Postfix, from userid 4523) id AE1C286C00B8; Thu, 2 Jun 2022 12:37:13 -0700 (PDT) From: Song Liu To: , , CC: , , , , , , , Song Liu Subject: [PATCH v2 bpf-next 1/5] ftrace: allow customized flags for ftrace_direct_multi ftrace_ops Date: Thu, 2 Jun 2022 12:37:02 -0700 Message-ID: <20220602193706.2607681-2-song@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220602193706.2607681-1-song@kernel.org> References: <20220602193706.2607681-1-song@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT X-FB-Internal: Safe Content-Type: text/plain X-Proofpoint-GUID: d4WpjTGRzPn_BiOPB5J37Uok7ngmsTIO X-Proofpoint-ORIG-GUID: d4WpjTGRzPn_BiOPB5J37Uok7ngmsTIO 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-02_05,2022-06-02_01,2022-02-23_01 X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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