Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp477966lqr; Wed, 5 Jun 2024 11:18:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUG+IGrxTLCeYxOivyt/6O0MFqKRKTEg0GSYOiwG1DjXWR3Yr04mWyG5/JfmjNcd5QzEmjPLSQPOgg0jPvWF5j6UOI601l4CR1e7m9BUQ== X-Google-Smtp-Source: AGHT+IFpoL19k3j/OcEGSpzjxtfaIXyeze224QukDtOF65Rsy8+IL28/qkC2Xu7/qxkUunG5l1yI X-Received: by 2002:a05:6512:3498:b0:52b:8363:34ef with SMTP id 2adb3069b0e04-52bab4d1583mr1992234e87.15.1717611528508; Wed, 05 Jun 2024 11:18:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717611528; cv=pass; d=google.com; s=arc-20160816; b=aPy5/n7KGfe/1wDykoj53nR3aW9vwSbsgmL+X6jhXu1YIJ2G+2xBLwzU44Eeic0eE6 0lw9iBJcrGxb1fpQnPdYk4vIbekmfSugpzIMi7zaoDdPPtf4v0cy6gyR25yANQ6uBsWW o7lPlnV0WX2vcJrNqarB5nsugfA3Rqus6cQvTYHR8KQ/VDW4t066mQtDFQ4Rc70LCPbN Dy2rw7LmKrJ+dexCNoZmq2Cubo+KNdTKUM/udXCfXbG69aZZrARwlvOtv0ZyE83NWeoy RkCTjrhjYsjZshaphsYIuo4leXQWQrI8xxQTnswkBBT9N7+RxJClddcKtl5QNroUEfpi mWwQ== 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=H/0+O/WTongaK25JbFpwMHrtqzVUSK0imCUYqD5az8z23MeSnmBbvhkLYpnq0P4uDZ RrdLwO5f5bPs+S1YzeCxzETNA7xAereF6y1Ols5B/Ttxvn0N87aQ6JLmC/ciK2/b3IFy MOFsQQWmvXBWTXToVdOSCZPkVGRiFtMJd5vEBnuKunIYtSiZ9DL6RVP/2f1kTDbygHk4 uNmMhzoWLdDO7ASqnSvFo4DBEDTXTwtV30EPMqYopQ8o7iLb4DrwlqXFjIRSezM1NRjk GFJfeB16jMoj0DogKZIs7i/N+B1AeqL6+KiKqlAfRA9xkA1pb8aVJuyQ0cZVXH5pdXYD cW/g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-203028-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203028-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-a68dff63f3fsi436428666b.863.2024.06.05.11.18.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 11:18:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203028-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-203028-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203028-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 E72CB1F28C2A for ; Wed, 5 Jun 2024 18:09:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AEC86381B1; Wed, 5 Jun 2024 18:04:06 +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 2951D3D9E; Wed, 5 Jun 2024 18:04:06 +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=1717610646; cv=none; b=Hx7i+Sp0Gb7f6Fw5q300Sp71Fuj5hG/CYggeQ6gF/Sud805Ww2MWVGTrk1//TPZTJsPRUwo420gyBVNvfZLs7BMv/CCOex6WQlpSYmG/ewsidlCiYZEV26STUCvvKZ/fP3uihcibGCEN+XH6k5cguGnyE+M0EARqdVHCpmqDGUM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610646; c=relaxed/simple; bh=Ldbg+sdfEohAnkSLIhjaFK1vi72Igfk+qnGb+F/ERbE=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=QOt8axdhiOAXyZUrB3rKdZXIZWkBSX12oF8wM1Q6CBwxB4es8BJcCmB+rl2mJ2CfxgBOsTtDtE889DYyg3UFZWq4xTncJ1OgbRvj5c6ZD3WcHm4SKciAKp1pM0XdMRJMpjpqtiLN249LHLCflgUEkSpwHkhZlW9t89pAo7UDQrA= 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 DCF55C2BD11; Wed, 5 Jun 2024 18:04:05 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1sEuzY-00000000hX1-2oUS; Wed, 05 Jun 2024 14:04:08 -0400 Message-ID: <20240605180408.537723591@goodmis.org> User-Agent: quilt/0.68 Date: Wed, 05 Jun 2024 14:03:35 -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 v2 1/5] ftrace: Rename dup_hash() and comment it References: <20240605180334.090848865@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