Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp615776lqb; Wed, 17 Apr 2024 06:25:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW1t5n1KnZpLv0nb/e1TYVQ1Pf8wXqdXUFruqnE1FBiKOlN6lBwSHYvLk25gfmsVWt/PU1JJNLmZ+TTGqI/lbNzJ9Hg1gLWzc/oW3HM6Q== X-Google-Smtp-Source: AGHT+IEpgJ1BdVAIh3nXwodZxvd49P3XG3Nj4++NXjSsxYNhvGjg1CgY8BSL/oHliVg1mJChI+rK X-Received: by 2002:a19:ca0a:0:b0:514:cbee:a261 with SMTP id a10-20020a19ca0a000000b00514cbeea261mr9347003lfg.27.1713360346818; Wed, 17 Apr 2024 06:25:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713360346; cv=pass; d=google.com; s=arc-20160816; b=Dq26d7XBgFOeE+y3guI22a0e/x8EfEBrR3sRoT/nnwj1HFa+Ldy3cM+lCwy/nmpslW r/SDGN2mzohWA7KpkDjgQ67p3g3C4aNyhLsud4eYHSyYh03Ql8dFU9wO5OAHNbM9to+U 7ov6SuMkzfGMBPkh1aF94giGd85VJCVpYa475XFtKI8ceNVEJWvJ95iEGcvqS4Bw+Ybw wBI0NXY+4zfBNiYHxo1NcGRLusBLOF7Vc/4GXx0dRmBpUJ3+ngQAAaZcaEq998K1gHjD 2wwzraIw/XFessXph2UaYGU+ppI70Bpx7dMbOMaMMn4P7TErwXiVyOXewiakBch1+NUd oaOg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=j8cyIk19S5qMJVfYY0zeu1mj9rkEHcyEafhsqtO5RCQ=; fh=kZAxSsEDdziVMYBZ5M2g+zUaD8x5Zy78CY9eHIbZTkg=; b=ctiJ0NCPeHQGrhnf0pOUiI0gr84s2KaxVf6CDB4WzVvHzbWNvcAn2n+UVTYi4I5ijN Dpn8nuBQfVo8GDzWs1kwwC6Uats/gWqYH4E/Uop98eD5sWWhCPqo6Es3rz4KZmA9QLg0 fbxjwEmownE7CZD8Vhuju+qs976MSrJ3wkicbneHDqEVCYrhtfIvcl2BBoErShBfDdKR lRhy1LJxz05y3dT8kQAMXGLKlrztDbq9BWINW5jfYBr/3HL/a7hLmyfZz2By0kJwZXfW NfuugrxplDTGjo2f7JWdCdIo+cw8Jfcy0RjgFAkpXz8Wj9flHBqAZEmcOfuQV6KNLBpg xynA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-148560-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148560-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id hp12-20020a1709073e0c00b00a523537b982si5961346ejc.878.2024.04.17.06.25.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 06:25:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148560-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-148560-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148560-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com 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 865281F218F6 for ; Wed, 17 Apr 2024 13:25:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 792EC140E47; Wed, 17 Apr 2024 13:24:43 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 474F513C910; Wed, 17 Apr 2024 13:24:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713360283; cv=none; b=k8s7s0qNAHIwCBFxSzw73hda4F9BXY4OyKCRQ1xKg+UsRmnNBqfRtjyMkNsU2k7X3tk8YPOZ/PjP6QaYeE6bnv+nt2YvGZQOJZJT0+XECGbdj6bV0IWbjK/BN1eY15HDlDM0ea1Xv5ev5lAKBWgYY4krONEsjsk0rHgdfNY0S5g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713360283; c=relaxed/simple; bh=PDeBdt6CsgyabjmfzzexP71XAp/o9b6LqNuTAgkvKR4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=qporKNFV/gIkei7CImUJpCmFCo/G9SVYCyhqhqVQ1i1xZ9eKHG+YwBunhtGA1SlzQQ1iZDXl14mTexjgDnlsJVsO3pjTC7sONmYoJnZl7ZamqFx9Ih12VfDXuOhmBZBMjgAvbCDQT2YhwNYckCFzQkfTtaNPsqiAR/HXxEoYjgg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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