Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp382675lqb; Tue, 4 Jun 2024 14:29:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVRR/P1l1+WdaRdL5sLwF0Jrh8lHDZ/oQhluJKoxjfGrNcT132iFMUW5xsUZuM8bbjYutd7FnDujjqJQ85vfXS7fsE8jAVIe/FW6uAfUw== X-Google-Smtp-Source: AGHT+IFH5yRLBUo/Mne+iig2OGLCJWphRGGO5V0lqqFMx/Oh9Z6wthPxufuiFBDf8mZpubmWyari X-Received: by 2002:a05:6512:5d5:b0:52a:39aa:7767 with SMTP id 2adb3069b0e04-52bab4ca5bbmr427290e87.3.1717536556197; Tue, 04 Jun 2024 14:29:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717536556; cv=pass; d=google.com; s=arc-20160816; b=talE5ZLB1PS+UiGrcbPxnPNkmXAHeNpi/wuBeufLxng4MKss0Wvgdw87UX2WBs/8ju v65v49UWnRGHyDsWTyh1qT6yUcBR/KKNs/L/ljL2eULSRFoOvxyAIsTxosBWfy9dxcl0 jiCqoPd2yiBwtlnRveXj/6Q+O1QU6YggB/d+Dg9tRxB/eEj2eSps76GkwJbOHRYh8wIf HjUTrG2Rqhtol1rX68svKX947NNnN2w8S2iiqiWpVPC6+ze2ELrRN1tF0CgtNR44Lw2U RoV05esSQRF/Pe2wAp7VMPC46Ft0J32fwDLAILIxWgLljZbOYNX7V5aoUQoJpLGRS5rE PRVg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:subject:cc:to:from:date:user-agent:message-id; bh=6SIModNLsD6wB8UC6cw+r/Reb1wkwlmAsFwddq3RZWI=; fh=mjDKelfe6UwtrbrQsWTm6mHxXqJJm1yC7XMGoQRRIY8=; b=IX52hFRgdODm5ULYPqmUfjcyGwrMfmGBXwwW+Cl1ANjzvv8VY4TNH0LbGR9jus88h0 1wN3SlnlkG/aKnIZY1WltaEo/TT+h1DhB24u/H/jDV5cXy3+Y18dD/z5/L8u4rSkz0c6 DMdjy/1mhFUMmo+pXb5A3GwzycoiTM/ztxs1aRy+CQScVIO7dRP+/EfXi/8IG4/3139+ B3/2H65tlpYyL52CGWNltFsdKzQgAB3c03o2ZAoa5X44atMXwgP1E3+5quec7oMNqMry z5fK7tzl/3CKt/dcSCpSO8RySCivTsPFmq4R4SRbWEtuzhN4XXhj1CT6czvV0CJe/3ww wc1A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-201399-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201399-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6844cec22asi528802066b.431.2024.06.04.14.29.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 14:29:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201399-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-201399-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201399-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5D8421F2184B for ; Tue, 4 Jun 2024 21:29:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EDB5814D29C; Tue, 4 Jun 2024 21:28:54 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6C42814BFAB; Tue, 4 Jun 2024 21:28:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717536534; cv=none; b=TPIrkKq6b1Es6B41YbNGCLfRBNI3TTrwbpOxpYvZMKoQSwh/B87kr5h50+WI77PbpmopXMG6n5mV3+0Hq6c4GlKnRDsU0I3SGgAKaam8jttgqZJ7nlX5i433ntp0t6dNoDAmBlpVjouUh+nAaUAyEni/QVeU2FMRJS9s24w1v7E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717536534; c=relaxed/simple; bh=Ldbg+sdfEohAnkSLIhjaFK1vi72Igfk+qnGb+F/ERbE=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=ht1z+TOufFEJhy46OKbWVpS0jk/hc4JmjCis7S/1wHVYAeUlfkRmSKNFq/bWILUy468Cg2oPp4AkTLtCvvcPMRlfXI60YuuidlwkDeQF80z4M1dztB7Ah03qdRQVX+X8dfQd6m4TGOOcpRJXy2/7NPHPTykFhb9VxvSssNv8fzM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id F28DDC2BBFC; Tue, 4 Jun 2024 21:28:53 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1sEbiA-00000000bDL-2xE8; Tue, 04 Jun 2024 17:28:54 -0400 Message-ID: <20240604212854.564747474@goodmis.org> User-Agent: quilt/0.68 Date: Tue, 04 Jun 2024 17:28:18 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton Subject: [PATCH 1/5] ftrace: Rename dup_hash() and comment it References: <20240604212817.384103202@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 From: "Steven Rostedt (Google)" The name "dup_hash()" is a misnomer as it does not duplicate the hash that is passed in, but instead moves its entities from that hash to a newly allocated one. Rename it to "__move_hash()" (using starting underscores as it is an internal function), and add some comments about what it does. Signed-off-by: Steven Rostedt (Google) --- kernel/trace/ftrace.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index da7e6abf48b4..9dcdefe9d1aa 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -1391,7 +1391,11 @@ ftrace_hash_rec_enable_modify(struct ftrace_ops *ops, int filter_hash); static int ftrace_hash_ipmodify_update(struct ftrace_ops *ops, struct ftrace_hash *new_hash); -static struct ftrace_hash *dup_hash(struct ftrace_hash *src, int size) +/* + * Allocate a new hash and remove entries from @src and move them to the new hash. + * On success, the @src hash will be empty and should be freed. + */ +static struct ftrace_hash *__move_hash(struct ftrace_hash *src, int size) { struct ftrace_func_entry *entry; struct ftrace_hash *new_hash; @@ -1438,7 +1442,7 @@ __ftrace_hash_move(struct ftrace_hash *src) if (ftrace_hash_empty(src)) return EMPTY_HASH; - return dup_hash(src, size); + return __move_hash(src, size); } static int -- 2.43.0