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 382C3C433EF for ; Sat, 11 Dec 2021 19:26:43 +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=PjyXcbD6Yc37Kz5xAgb04MmWteJMUhUOTW04i44TDuU=; b=RkeCY2UYPRuOpD E3zJexA9RUDZUEJ0nBYKNLOGwI8BxUHN+OPcD9GJWNPqhcQe+2KgJ3aGa1UjObI+off7t1HVpXtxW zifAEQqXr/Z6OYzoweBaRiLOM3i/qK1CjZmJOaRMZh+0gkSH+6dOudzfkdi5IMEvKIE70vH5tJCx6 uzDUcvhiasHbXGKaGnpnPOj87trxL3J0OIVc4RH4iWNrwen32+h2gbO+sJgiOSIPgEGaWEtkaH+WB IkT5E2U7cTQcKmdQEFOP0vdjUY+2ghpPrR+f/v2z36JahzN0ottExbeCtW2npayjGvhOjTRHwljTD Mf7hqs1RCg+hGe95l2AA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mw7zj-005RPi-Ty; Sat, 11 Dec 2021 19:25:20 +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 1mw7za-005RN8-L7 for linux-arm-kernel@lists.infradead.org; Sat, 11 Dec 2021 19:25:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639250709; 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=Sg3tYegBcr8a1PhGekugtBk97+3Tj4pLXTNqM52G2ak=; b=ikhNu38O3GfbPECNyQ5D7gwfXzZDvAstGwnc0EbMhMkc20feCe88X9hXtxe/90g48yVhLs C+zb27lj6jkcgEJrfCrsvfsZ9HaAYVBdBfZKFDWqHQppgVo2/+PYvx2nyWNA2soKLrK4Og jyfp7MUQ+L/aDITKVGR56BJQv71jv7k= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-580-ZzvVS-BJOTyOE_dnd63KkA-1; Sat, 11 Dec 2021 14:25:06 -0500 X-MC-Unique: ZzvVS-BJOTyOE_dnd63KkA-1 Received: by mail-wm1-f70.google.com with SMTP id r129-20020a1c4487000000b00333629ed22dso8876451wma.6 for ; Sat, 11 Dec 2021 11:25:06 -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=Sg3tYegBcr8a1PhGekugtBk97+3Tj4pLXTNqM52G2ak=; b=RvaO5HWsR6nrxIdRpDXv7yxtHhtvHp01Zw82+GrZq7Pjvwzy+WzRhH+5JFTK2dNeeC EYS/5pJ1fAHVeu9fVh1IDYOPJ/JDoXFnpYUCMa0xo9eWT/aMgvFv+XywiaNx7o2U3WCw RTNkkQDRjyhnFIU8spQX7ldHQUYXklOZV9GkycZZLbpaWEnGoaVlmHqTqleDHJWmDZ+W 3g1lmKqxBiNLfkTZ6hCN0OY57wxW3pfZmZ1GdUWL5uelLVS5PxLWB1PPZdqz85XYfZb1 H8MJFZB1/zvrWrPgVttysrU2AeVJLtnQ0J1c0k4x8AIVt74ikTHeMTIWS8pUa+jf6cn0 61nw== X-Gm-Message-State: AOAM531LCdY5coGi1yy+a4L9qzelDfojqEGln02tkC8URMkjU5/xbCLd 578xJWkvETOowU9Ck14aBOgTKnXJdf0AAWIJQ50Es1pId0gEHGbmIJUvndtIk3ggWNKoRtdL0ba 0DxUGxR4a/fnGi/eunvil5mvN4rdkHQLqVmQ= X-Received: by 2002:a05:6000:1625:: with SMTP id v5mr21433889wrb.196.1639250705496; Sat, 11 Dec 2021 11:25:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTpjMNfovA5xcjOrwxzt06x14rvtSJ8nONeyisARxOvdFpDA0WXOOEF8zSOsDUhDjheMvD9w== X-Received: by 2002:a05:6000:1625:: with SMTP id v5mr21433881wrb.196.1639250705330; Sat, 11 Dec 2021 11:25:05 -0800 (PST) Received: from krava (nat-pool-brq-u.redhat.com. [213.175.37.12]) by smtp.gmail.com with ESMTPSA id e24sm5893514wra.78.2021.12.11.11.25.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Dec 2021 11:25:04 -0800 (PST) Date: Sat, 11 Dec 2021 20:25:02 +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, eranian@google.com Subject: Re: [PATCH 06/22] perf cpumap: Remove map+index get_socket Message-ID: References: <20211208024607.1784932-1-irogers@google.com> <20211208024607.1784932-7-irogers@google.com> MIME-Version: 1.0 In-Reply-To: <20211208024607.1784932-7-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-20211211_112510_822273_0C76B104 X-CRM114-Status: GOOD ( 20.84 ) 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, Dec 07, 2021 at 06:45:51PM -0800, Ian Rogers wrote: > Migrate final users to appropriate cpu variant. > > Signed-off-by: Ian Rogers > --- > tools/perf/tests/topology.c | 2 +- > tools/perf/util/cpumap.c | 9 --------- > tools/perf/util/cpumap.h | 1 - > tools/perf/util/stat.c | 2 +- > 4 files changed, 2 insertions(+), 12 deletions(-) > > diff --git a/tools/perf/tests/topology.c b/tools/perf/tests/topology.c > index 869986139146..69a64074b897 100644 > --- a/tools/perf/tests/topology.c > +++ b/tools/perf/tests/topology.c > @@ -150,7 +150,7 @@ static int check_cpu_topology(char *path, struct perf_cpu_map *map) > > // Test that socket ID contains only socket > for (i = 0; i < map->nr; i++) { > - id = cpu_map__get_socket(map, i, NULL); > + id = cpu_map__get_socket_aggr_by_cpu(perf_cpu_map__cpu(map, i), NULL); you could also use the perf_cpu_map__for_each_cpu in here? same for the following changes jirka > TEST_ASSERT_VAL("Socket map - Socket ID doesn't match", > session->header.env.cpu[map->map[i]].socket_id == id.socket); > > diff --git a/tools/perf/util/cpumap.c b/tools/perf/util/cpumap.c > index feaf34b25efc..342a5eaee9d3 100644 > --- a/tools/perf/util/cpumap.c > +++ b/tools/perf/util/cpumap.c > @@ -136,15 +136,6 @@ struct aggr_cpu_id cpu_map__get_socket_aggr_by_cpu(int cpu, void *data __maybe_u > return id; > } > > -struct aggr_cpu_id cpu_map__get_socket(struct perf_cpu_map *map, int idx, > - void *data) > -{ > - if (idx < 0 || idx > map->nr) > - return cpu_map__empty_aggr_cpu_id(); > - > - return cpu_map__get_socket_aggr_by_cpu(map->map[idx], data); > -} > - > static int cmp_aggr_cpu_id(const void *a_pointer, const void *b_pointer) > { > struct aggr_cpu_id *a = (struct aggr_cpu_id *)a_pointer; > diff --git a/tools/perf/util/cpumap.h b/tools/perf/util/cpumap.h > index 9648816c4255..a53af24301d2 100644 > --- a/tools/perf/util/cpumap.h > +++ b/tools/perf/util/cpumap.h > @@ -32,7 +32,6 @@ size_t cpu_map__snprint_mask(struct perf_cpu_map *map, char *buf, size_t size); > size_t cpu_map__fprintf(struct perf_cpu_map *map, FILE *fp); > int cpu_map__get_socket_id(int cpu); > struct aggr_cpu_id cpu_map__get_socket_aggr_by_cpu(int cpu, void *data); > -struct aggr_cpu_id cpu_map__get_socket(struct perf_cpu_map *map, int idx, void *data); > int cpu_map__get_die_id(int cpu); > struct aggr_cpu_id cpu_map__get_die_aggr_by_cpu(int cpu, void *data); > struct aggr_cpu_id cpu_map__get_die(struct perf_cpu_map *map, int idx, void *data); > diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c > index 09ea334586f2..9eca1111fa52 100644 > --- a/tools/perf/util/stat.c > +++ b/tools/perf/util/stat.c > @@ -328,7 +328,7 @@ static int check_per_pkg(struct evsel *counter, > if (!(vals->run && vals->ena)) > return 0; > > - s = cpu_map__get_socket(cpus, cpu, NULL).socket; > + s = cpu_map__get_socket_id(cpu); > if (s < 0) > return -1; > > -- > 2.34.1.400.ga245620fadb-goog > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel