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 96BE1C4345F for ; Wed, 17 Apr 2024 13:40:20 +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:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hLkfkp8u+QKr8apna+EA2O7mRM8irSCktUiKFMtf07w=; b=qrELQXSVNbbbRX niVYuermqqJF90Wg8V474F2qJ1Tkf+Z3M5g0g827+Cb2DR/SjXj7ASGpZgDxtbTbQKWtCH/coYUwT gOC/H3y72iIeCAwWb7YL8bIg9TK+I1II5/xEAwydEyxLJNk0VLVSkE5X/o2lWZ9JPvw7ESRbtKZRd UWR1wO0PrYQOy88IWB+r0Q4+v62KZJ7tq7tp+RMsBaG1zJ8EobYuzoQweBfyRLvZqH9fFsmTi51Fu ATojuPeqDwbq+5nSWOfpEVuBzy7QtXmgkm+Yvf0ip8lMlltoXZR8qWPspR33rnniEZ5fZOgox8fd7 jk0WC1PAVN67xMNNqD4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rx5WC-0000000GCLw-0Ulg; Wed, 17 Apr 2024 13:40:08 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rx5W7-0000000GCJH-345e for linux-arm-kernel@lists.infradead.org; Wed, 17 Apr 2024 13:40:06 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 1CE4DCE1262; Wed, 17 Apr 2024 13:40:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE70DC072AA; Wed, 17 Apr 2024 13:39:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713361200; bh=b/sDQSq5JjwUA6lrjG6U3vqq2NaTsKZLOqjslzcjaPQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=G3frWAbKid/PFYHRRbptixtGcA2rMU0xjx0kj6bXI+3GdbUHAYfUO9WURlMmxkr+4 EWl0ebX7frfwTRdfEC/HXAB/ldZIORDKJ/v5Bhw9QJI/mo5TZP0qkLbFQgPPaib+jb fCNud3ASO8Lywj+Idh5ZHXx3Ze1Hpl0pHCP1SP+kjmfaqluWM/eAQWoHX4BMZ+8A1G J2nAZoYzItEe6qqMwaeO2uaeb35ORQq3P6+w+t79IwBP9VvwRHQxkMMWRlf3z7EhK5 HEwrXkZl4hJVwOgnersh85w8K/xnDFXU7KfmwNlSk3nOhdZ+hSsQNSf8zJOtiHvhpk vmHVResSMaxpw== Date: Wed, 17 Apr 2024 10:39:56 -0300 From: Arnaldo Carvalho de Melo To: James Clark Cc: Alexey Dobriyan , Chaitanya S Prakash , Ian Rogers , 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 , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Chenyuan Mi , Masami Hiramatsu , Ravi Bangoria , Ahelenia =?utf-8?Q?Ziemia=C5=84ska?= , Colin Ian King , Changbin Du , Kan Liang , Athira Rajeev , Tiezhu Yang , Georg =?iso-8859-1?Q?M=FCller?= , Liam Howlett , bpf@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V2 0/8] perf tools: Fix test "perf probe of function from different CU" Message-ID: References: <20240408062230.1949882-1-ChaitanyaS.Prakash@arm.com> <2d7a896b-bbee-4285-9b2b-3edfab6797d3@p183> <1b52699d-8f92-4a79-89aa-c4df1594e8b1@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1b52699d-8f92-4a79-89aa-c4df1594e8b1@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240417_064004_163917_E03DB1BF X-CRM114-Status: GOOD ( 24.92 ) 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 Wed, Apr 17, 2024 at 02:24:33PM +0100, James Clark wrote: > 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? > 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. Right, we try to follow the kernel APIs to make tools/perf more familiar to kernel developers, this return strlen() thing on str_has_prefix() looked too clever for me at first, but since we need to do it anyway, and return !0 to indicate it has the prefix and there are usecase... The bpftool people agreed as well, so in tools/ it seems we're in general agreement about using str_has_{prefix,suffix}(). - Arnaldo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel