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 88931C433EF for ; Sun, 9 Jan 2022 18:32:24 +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=XVkf0I7JTHxtejXNoXZCI7AJyuTXLfmhf7CnI39VJWM=; b=YxP0trKAv5P9iH 64xYFDX39voo5vfzyznDSV7jP7oNDvaTo4nt6eolR+t06XfXTRYyS17cOCfhHCFGL8kX2CnjQhPtp 1cZyuMw1DtVczxI7RkUL7AyUv3YXtCk1c7E0WBay7n2HIp0eSeI1gH/5yvbt97A/89iF18drm1o1q YPFxEsSedzh8RtSX8KL0M1EEtBtOqSXvZyWsI0f+yBgAQ3DmNe2vuc1ABZV95/1x6R2meTHPfnSZS e/sPIp/zE/+LobzjGWbich8GqlbcrvcOrsw8Q/JjZWl13XPXMCVfevEltCME5W5W70nTLrU9ifoPK IsaYp2smXWMSbKhBRA8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n6cxx-008ESp-4q; Sun, 09 Jan 2022 18:30:53 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n6cxr-008ERD-Qp for linux-arm-kernel@lists.infradead.org; Sun, 09 Jan 2022 18:30:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641753045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=An+oxkp/d/zOEov/Qf6h7tx0CIo4kpBYV+ftCCkPi8U=; b=FNFgFDe2I5VA2/IivCtm1OfhGBiHQBFfckpGN2n03JY1O0hMQ50OryvoA2DyA67heQjPZi cTUYSq6ZodXY/gWwKNM4b4cxKoDfWAeHy3fmAZ4Jqpd5ShGVEw9cCDOejuOJbi4JoySTLV 1zXBQ+x98XKNp9hRHI5m2BJX3Ko/QVc= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-388-T0-Mh2m_NNuMvQKGnD-kRw-1; Sun, 09 Jan 2022 13:30:42 -0500 X-MC-Unique: T0-Mh2m_NNuMvQKGnD-kRw-1 Received: by mail-ed1-f70.google.com with SMTP id y18-20020a056402271200b003fa16a5debcso8459873edd.14 for ; Sun, 09 Jan 2022 10:30:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=An+oxkp/d/zOEov/Qf6h7tx0CIo4kpBYV+ftCCkPi8U=; b=IwTMAcDlyKMwZUt9PmuOnLqwo9pQLfOMttSRmoQ5bQOPVmjisZR4WZLE0FNijlHfEQ LZMVQ7iRxsRLk9R9tPNx9rqF5UkFpY+Dhw3vKGtPZXPWnTPOsyWnCBo4HMEW+x9fu1Ln Mh3Q+r4WUrBAHFIGZg4YLwCpytirB1pYSqnmBuV7Gu+v3eKJc+ph1o262ETOLekuiCm0 kAe7od9S36TGQ3ftnqX54ra4SVerMbybyVn14AZWsGBYO6ApllQOkslqy2zaTu2lm/Qe zxXgffy+J9dq+RZHjpWXkwOQDyaOEqizYBUGaYzRL/tf09Zp9X26uFO3iJgabBAnU3AS C+Iw== X-Gm-Message-State: AOAM533N3jtp+z/GTinPKJTqzUfZLa3tCuIKIjFESqOq+xBZW1ZWtqv6 z9oxCxTVbLsfEagXaATxX62wW/mfPLrkWMoUQmsT8OmuCS9lQZSF7LbPtk7olCT+jghJjLX0onC mhvVAjj5Os7RuWcYXZBrEpqdh0ZmBUb34fdw= X-Received: by 2002:a17:906:f8c7:: with SMTP id lh7mr11009479ejb.485.1641753040958; Sun, 09 Jan 2022 10:30:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLGNR4PxiE5GS9/dvOtlC6tJp2UO68Q4ykPGmDNa8TUmfmcksFWKtROYgf/hsNP7D7u+ABLQ== X-Received: by 2002:a17:906:f8c7:: with SMTP id lh7mr11009453ejb.485.1641753040720; Sun, 09 Jan 2022 10:30:40 -0800 (PST) Received: from krava (nat-pool-brq-u.redhat.com. [213.175.37.12]) by smtp.gmail.com with ESMTPSA id i22sm1597840ejw.75.2022.01.09.10.30.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jan 2022 10:30:40 -0800 (PST) Date: Sun, 9 Jan 2022 19:30:38 +0100 From: Jiri Olsa To: Ian Rogers Cc: Andi Kleen , Namhyung Kim , John Garry , Kajol Jain , "Paul A . Clarke" , Arnaldo Carvalho de Melo , Riccardo Mancini , Kan Liang , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Vineet Singh , James Clark , Mathieu Poirier , Suzuki K Poulose , Mike Leach , Leo Yan , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, zhengjun.xing@intel.com, eranian@google.com Subject: Re: [PATCH v4 48/48] perf cpumap: Give CPUs their own type. Message-ID: References: <20220105061351.120843-1-irogers@google.com> <20220105061351.120843-49-irogers@google.com> MIME-Version: 1.0 In-Reply-To: <20220105061351.120843-49-irogers@google.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jolsa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220109_103047_994261_61B55652 X-CRM114-Status: GOOD ( 18.06 ) 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 Tue, Jan 04, 2022 at 10:13:51PM -0800, Ian Rogers wrote: > A common problem is confusing CPU map indices with the CPU, by wrapping > the CPU with a struct then this is avoided. This approach is similar to > atomic_t. > > Suggested-by: John Garry > Signed-off-by: Ian Rogers SNIP > tools/perf/util/stat.h | 2 +- > tools/perf/util/svghelper.c | 6 +- > tools/perf/util/synthetic-events.c | 12 +- > tools/perf/util/synthetic-events.h | 3 +- > tools/perf/util/util.h | 5 +- > 59 files changed, 408 insertions(+), 347 deletions(-) that's massive ;-) did it find any mis-use of the index/value? how about the same for threads? > diff --git a/tools/lib/perf/include/internal/cpumap.h b/tools/lib/perf/include/internal/cpumap.h > index 71a31ed738c9..581f9ffb4237 100644 > --- a/tools/lib/perf/include/internal/cpumap.h > +++ b/tools/lib/perf/include/internal/cpumap.h > @@ -4,6 +4,11 @@ > > #include > > +/** A wrapper around a CPU to avoid confusion with the perf_cpu_map's map's indices. */ > +struct perf_cpu { > + int cpu; > +}; should we use 'int val' or 'int v' instead, so we don't have cpu.cpu ? jirka SNIP _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel