From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 188E8C4345F for ; Wed, 17 Apr 2024 13:24:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=M8H+V9KjjfeJkCrPbZacKqDHcNWAPoIcrBoOLT6pyEg=; b=g3UwcybMz/kLSO yubGb2YDACZDhGiNYCrFNKf3DaXqAOJDREVooz195ZVBIj3Yf2tewz2tCbw6wxxAylLdFBmw0yeVB bcfCBnbJ/7yGDPNBZL0CtyQc8hGu5CjP7Iw3daExgwGXfOwiPJKICJxRDJtIwMHEiOI2VyCJy4Ff2 ZZX+oqPD9fuMUGD5HRzCLQ7ZDK2BUCJvbqziqa/xbbmoTF/eCIYv653x0zcNqBtapEjv9OvCjnkY+ AER7KOtznRaWMJwqRhiKWvc+0ylDTWSwfax3MiCKK9dl4TfBMBQr72PV+niW+tPTbn27PT1/P6yG3 XGX/41cDcMNWboBHfmQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rx5HK-0000000G7rJ-0wZ5; Wed, 17 Apr 2024 13:24:46 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rx5HG-0000000G7pa-3GXu for linux-arm-kernel@lists.infradead.org; Wed, 17 Apr 2024 13:24:44 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5F0E2339; Wed, 17 Apr 2024 06:25:08 -0700 (PDT) Received: from [192.168.1.100] (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E84B73F738; Wed, 17 Apr 2024 06:24:35 -0700 (PDT) Message-ID: <1b52699d-8f92-4a79-89aa-c4df1594e8b1@arm.com> Date: Wed, 17 Apr 2024 14:24:33 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V2 0/8] perf tools: Fix test "perf probe of function from different CU" To: Alexey Dobriyan , Chaitanya S Prakash , Ian Rogers Cc: linux-perf-users@vger.kernel.org, anshuman.khandual@arm.com, Josh Poimboeuf , Peter Zijlstra , Suzuki K Poulose , Mike Leach , John Garry , Will Deacon , Leo Yan , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Chenyuan Mi , Masami Hiramatsu , Ravi Bangoria , =?UTF-8?Q?Ahelenia_Ziemia=C5=84ska?= , Colin Ian King , Changbin Du , Kan Liang , Athira Rajeev , Tiezhu Yang , =?UTF-8?Q?Georg_M=C3=BCller?= , Liam Howlett , bpf@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20240408062230.1949882-1-ChaitanyaS.Prakash@arm.com> <2d7a896b-bbee-4285-9b2b-3edfab6797d3@p183> Content-Language: en-US From: James Clark In-Reply-To: <2d7a896b-bbee-4285-9b2b-3edfab6797d3@p183> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240417_062443_096300_0692B533 X-CRM114-Status: GOOD ( 17.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 14/04/2024 12:41, Alexey Dobriyan wrote: > On Thu, Apr 11, 2024 at 05:40:04PM +0530, Chaitanya S Prakash wrote: >> >> On 4/9/24 11:02, Alexey Dobriyan wrote: >>> On Mon, Apr 08, 2024 at 11:52:22AM +0530, Chaitanya S Prakash wrote: >>>> - Add str_has_suffix() and str_has_prefix() to tools/lib/string.c >>>> - Delete ends_with() and replace its usage with str_has_suffix() >>>> - Delete strstarts() from tools/include/linux/string.h and replace its >>>> usage with str_has_prefix() >>> It should be the other way: starts_with is normal in userspace. >>> C++, Python, Java, C# all have it. JavaScript too! >> >> This is done in accordance with Ian's comments on V1 of this patch >> series. Please find the link to the same below. > > Yes, but str_has_suffix() doesn't make sense in the wider context. > >> https://lore.kernel.org/all/CAP-5=fUFmeoTjLuZTgcaV23iGQU1AdddG+7Rw=d6buMU007+1Q@mail.gmail.com/ > > The naming ends_with makes sense but there is also strstarts and > str_has_prefix, perhaps str_has_suffix would be the most consistent > and intention revealing name? > Hi Alexey, >From a brief check it looks like str_has_prefix() is already quite common with 94 uses. So the path of least resistance is to make everything self consistent and add str_has_suffix(). I agree it's a bit of a mouthful and not so common in other languages. Once this more complicated set gets through we could always do a simple search and replace change it to anything we like. But it would touch _lots_ of different drivers and trees, so it would be hard to justify. Thanks James _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel