Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp96911rdb; Wed, 14 Feb 2024 14:03:24 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWK3bZ5qUYnDeYmc/Q7P8aB565sOkIJ2YSOerBni5x4wuhP1kPW5Cbn2GCnJIlYAir0N7zKp/U7aLVtSZIWDINdv/4Vvx0NsSUakmZR8g== X-Google-Smtp-Source: AGHT+IGJtp0zt+ahrXxRgPgmlW49lifBk+AdeCteTPCrgn2tHWznbdNnkv7ID39f3buLTkkEl/7d X-Received: by 2002:a05:6a00:cca:b0:6de:1d0b:ae29 with SMTP id b10-20020a056a000cca00b006de1d0bae29mr181697pfv.0.1707948204281; Wed, 14 Feb 2024 14:03:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707948204; cv=pass; d=google.com; s=arc-20160816; b=X7W5HeSl502CfMtK9ryVelBJ7hzUOnJRjjJFIrECEoN36U5VqOZx3su+OTx2Mr6qWo HwQshKVXp4wPqZalymR8OMWmYyqvIlUD1/UJ/RoIlQxSpajBT3n/d15U4sa8vzI/Y3Sx s1T6CD8AZZua+5Vtwb1VWOVg2rjUYrHjnt4DrU6Hz7SfCIe5Re9t161GnBsGwvTYN68Q txrsubB+/9pHZcFEnW8rds0PJy24Oj6J5RyyXVprGmvTE+IY4YJYZ/zB1wPX6RM9u1u5 0Nyyg1C2tb+WZAqfThf9rl5WM9k3nM4oIV6BwQ8+qEUOELAoa1reylEM3oNjpWFDEA3Q 7LPg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=8wYfCtUOcHCknKPxjQLZZJYk5nY9b53cOSCJihn+f7U=; fh=w89ypH6jACXYAlcXLisd6GrTXbcsnS0cWQ1Z39iL5JE=; b=Z3F6I+P9QihOk1vIh/f86sC8SKWKk3RVVZGwxvvwcqoRqoG3/KL2zDAvtKNYxSuPcO hZ0NP7Yh4+02Dc0CzDgsQPBwtLyYMlEd/gwdUTpmKH7cFtOxmmFNdZGeGv4uEtNgMvb9 LTVz7lvN4gsNtjLrleN64B9FtXZSryz1+4mxEsRV9e1ZjSnwl/hp2XU3WIXTEDPEP2Yv s3p/GCNVzV9UvqAVNW3XohDIkb3xinI8a0siGtlE42tnj+lyjQZyTJstSdRttAWFC7Iu qfKb70OLeCm2tCPXhGvHH0tTyZ+t1N2RYXYXA4eZm6xUzmop8kr2jx4jWlpUUhMnQnD4 ImZQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=S0lruz5D; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-66018-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66018-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=2; AJvYcCXo9H04kNegzCnkiGnc/vgprbJdKJLPji49Fr6llzNts3WiL56MI7MGzYDFCu5uHhKsWhmWFcYO+eCe/aqfWzBJ3XWlmZU1F/ukdDxcHw== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ck22-20020a056a02091600b005dc875b87ddsi3470972pgb.223.2024.02.14.14.03.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 14:03:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66018-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=S0lruz5D; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-66018-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66018-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 55EE02852F8 for ; Wed, 14 Feb 2024 22:03:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 90E1B14198D; Wed, 14 Feb 2024 22:03:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="S0lruz5D" Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 34D8013F00D for ; Wed, 14 Feb 2024 22:03:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707948181; cv=none; b=mgMNJ0DlXvrCBRvgU0t/peTEuKkByFkOTQdTONKTbjsSjWD0TXZGhNMJvVPLs7GtFJYT6U8AcwmOH14/S0b57CGFOTLN+NUKxkq8Dl2wOG/AYY4ag3gHkGlRtxZsxSjKfREszVgDw+0YYik7tQIrBNy7xDx2YKMsSY4Ut6Ofeu4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707948181; c=relaxed/simple; bh=mowh5P/4USMz1hX4Z6lQ+7O67PyHytCTcWCBD3Z33XA=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Content-Type; b=OaAfL52OCuOcqykhLlPGYG7ze9Qh/TnnqP16gsv1jqhz4OF7phwr1rfGwUVaTXhd1bRGTL+RugH/n8jcvxRiiLplkD0sU3OyDw7s4aCApYzjgghFK4TYlGWrRzFUKlE6h9SpZsetG27MywtrJdCxWQRW/FpUOIeDpUSn2Z+jvQ4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=S0lruz5D; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1db35934648so11725ad.1 for ; Wed, 14 Feb 2024 14:03:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707948179; x=1708552979; darn=vger.kernel.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8wYfCtUOcHCknKPxjQLZZJYk5nY9b53cOSCJihn+f7U=; b=S0lruz5DM19Czn95YTg5N1eYWkyGuqgN2rW2k3HLvRXe6vU+6tfgFMul3IRePjVrJB OoMwkuxojD+sa0da/NcMv6PDJdT0TQlmKteQIemHTw+LyrGT5+Sl3c9eTTPqVAolXFH/ 8uhPAp0qCaR7VYXByn7CSzAJnHhDQmoYfmNectK5EXJDk3LMJNNEEmjJGVGh0bSkwApD I/3Muv8zZfl7AzW0po/OAMSbtdRvFfDa//hUNUiiVTrLdKNAJ4zcXwaFO1tJE//HzRaf xooz8e4hwOET5Bu8Ln8ek9UyAupr4DXplVSz0gOcvHRJ43+MjXPM8eQwz411Kmn3CAnx PKdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707948179; x=1708552979; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8wYfCtUOcHCknKPxjQLZZJYk5nY9b53cOSCJihn+f7U=; b=Q3nuMB0cMI8gvzJ238a9ickBKX8XdZVuj0Z8QRqrf5dsleWgb44ZkrXAmePPj1Ne8K HY8SpUxhi3OqdjwptCUMopKcpRLVYwY57KtlMVxKvLmE2bxR/VcWIJgs9xKJcWCT7zrb bbTTzVHt1Um1hH7CixN0qEcea6x1ODzmjOryMlTJQWA4Y1o8GcVfu+tIj1HknoSG8xX5 afKMReO6XGBPR/kl7e9IMle7kEgpj9heWwyPnJgnPnuYVFaTNWggc7Jym91hvzAeDFr4 b7Dk9eo1KXSNsmRy88R7zyEmH6aBLO9z/dqbEqzIi1scZCvjdM2um1owqqL3wiu38zaH GfUg== X-Forwarded-Encrypted: i=1; AJvYcCVSoEBAtqd6FOQFXdZ/aNmmW1yIdaCRKgGXAF9BG7GesbXaHpAGJjJqrJbdrsZxOveTxhcGh8qx+cemyZD1uMEYLjb60Obj3F2PEzCd X-Gm-Message-State: AOJu0Ywn682iMKDSK39nqMo+AMXoVxteGT9r/6b7eqExImZ8p8zSBr3M Os06a4rX+gHzkR75eowYseOq8zZ/9dA+U2J+F8vXd99hyjGwFXvHk+49iH16A6RoMbuS8E5GES+ GYDfYnQ2+2ViaTd02GKHQAu8ZX4HfwbLIj4Ls X-Received: by 2002:a17:903:2053:b0:1da:292b:cf94 with SMTP id q19-20020a170903205300b001da292bcf94mr405169pla.4.1707948179247; Wed, 14 Feb 2024 14:02:59 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240202234057.2085863-1-irogers@google.com> In-Reply-To: <20240202234057.2085863-1-irogers@google.com> From: Ian Rogers Date: Wed, 14 Feb 2024 14:02:44 -0800 Message-ID: Subject: Re: [PATCH v3 0/8] Clean up libperf cpumap's empty function To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Suzuki K Poulose , Mike Leach , James Clark , Leo Yan , John Garry , Will Deacon , Thomas Gleixner , Darren Hart , Davidlohr Bueso , =?UTF-8?Q?Andr=C3=A9_Almeida?= , Kan Liang , K Prateek Nayak , Sean Christopherson , Paolo Bonzini , Kajol Jain , Athira Rajeev , Andrew Jones , Alexandre Ghiti , Atish Patra , "Steinar H. Gunderson" , Yang Jihong , Yang Li , Changbin Du , Sandipan Das , Ravi Bangoria , Paran Lee , Nick Desaulniers , Huacai Chen , Yanteng Si , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Feb 2, 2024 at 3:41=E2=80=AFPM Ian Rogers wrot= e: > > Rename and clean up the use of libperf CPU map functions particularly > focussing on perf_cpu_map__empty that may return true for maps > containing CPUs but also with an "any CPU"/dummy value. > > perf_cpu_map__nr is also troubling in that iterating an empty CPU map > will yield the "any CPU"/dummy value. Reduce the appearance of some > calls to this by using the perf_cpu_map__for_each_cpu macro. > > v3: Address handling of "any" is arm-spe/cs-etm patch. > v2: 6 patches were merged by Arnaldo. New patch added ensure empty > maps are allocated as NULL (suggested by James Clark). Hopefully a > fix to "perf arm-spe/cs-etm: Directly iterate CPU maps". > > Ian Rogers (8): > libperf cpumap: Add any, empty and min helpers > libperf cpumap: Ensure empty cpumap is NULL from alloc > perf arm-spe/cs-etm: Directly iterate CPU maps > perf intel-pt/intel-bts: Switch perf_cpu_map__has_any_cpu_or_is_empty > use > perf cpumap: Clean up use of perf_cpu_map__has_any_cpu_or_is_empty > perf arm64 header: Remove unnecessary CPU map get and put > perf stat: Remove duplicate cpus_map_matched function > perf cpumap: Use perf_cpu_map__for_each_cpu when possible Ping. Thanks, Ian > tools/lib/perf/cpumap.c | 33 ++++- > tools/lib/perf/include/perf/cpumap.h | 16 +++ > tools/lib/perf/libperf.map | 4 + > tools/perf/arch/arm/util/cs-etm.c | 114 ++++++++---------- > tools/perf/arch/arm64/util/arm-spe.c | 4 +- > tools/perf/arch/arm64/util/header.c | 13 +- > tools/perf/arch/x86/util/intel-bts.c | 4 +- > tools/perf/arch/x86/util/intel-pt.c | 10 +- > tools/perf/builtin-c2c.c | 6 +- > tools/perf/builtin-stat.c | 31 +---- > tools/perf/tests/bitmap.c | 13 +- > tools/perf/tests/topology.c | 46 +++---- > tools/perf/util/auxtrace.c | 4 +- > tools/perf/util/bpf_kwork.c | 16 +-- > tools/perf/util/bpf_kwork_top.c | 12 +- > tools/perf/util/cpumap.c | 12 +- > tools/perf/util/record.c | 2 +- > .../scripting-engines/trace-event-python.c | 12 +- > tools/perf/util/session.c | 5 +- > tools/perf/util/stat.c | 2 +- > tools/perf/util/svghelper.c | 20 ++- > 21 files changed, 192 insertions(+), 187 deletions(-) > > -- > 2.43.0.594.gd9cf4e227d-goog >