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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCC74C433EF for ; Sat, 11 Dec 2021 19:25:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231856AbhLKTZJ (ORCPT ); Sat, 11 Dec 2021 14:25:09 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:30405 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231862AbhLKTZI (ORCPT ); Sat, 11 Dec 2021 14:25:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639250707; 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=eVDp95t131I1gHwbTlAlNMG4X8ARYOJ4l0ORGQ3/znZt076prurwTrMU4//yQrgpSoLc4G nrOTdEQSryain59a9mzAJSmLKdvkGcDMbQPDMHplDGPL9a3f0oeoJSVD3VF/ee5yNz8S4Y d3HGMmuQiQuW9TduQNn0XYDt9C/qHY4= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-580-N7l3LJ0TN_mfNJUuv4S3Xw-1; Sat, 11 Dec 2021 14:25:06 -0500 X-MC-Unique: N7l3LJ0TN_mfNJUuv4S3Xw-1 Received: by mail-wm1-f71.google.com with SMTP id a85-20020a1c7f58000000b0033ddc0eacc8so8864290wmd.9 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=KEV4PNE8JcEmB3S4UT4HvCvmC1VjlsCM3mc2dbc0wTdXcqfsbGyFzZoPp10jt5b20n 9oecOhIB8vYaX3OOfH4MXn+P+j/KIiLQLhM5PexzfH3Ak3FlwLOpjhZrX+t63AyL1f1B nXrkwx77fJI5B0KAA96yoGluT/oJhkSpuoDCJM0RagrIiJkpJ9k+zL+7X0X4Te4qV/rV br/YFdEKLmALBIguHhk+5xCvHoyp77OgKyqC1yDvSkrSro4yxe8uHQQzlpun9Gnibxm9 bHhm1iNN1Je4N1OMXLDIgJQL3ttrs7zH1GVRTd3fQsoielKoeXegKXJP1IPiF6k+00Yt PhXA== X-Gm-Message-State: AOAM533kJ2zmvWbedMqBHHjA4MM7182dgwlI8qMxWf/UNbiPyMX4/qr0 d8VLycMxA52MmBi/ICtXG8Hk6knoY+P39spaApw9ztYrDmLjdeH1GM8rCNQppyG9U7GezU0+2Eg jmt/0vpaG01N0JkstNHW2HMPcD1ssew== X-Received: by 2002:a05:6000:1625:: with SMTP id v5mr21433907wrb.196.1639250705499; 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211208024607.1784932-7-irogers@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.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 >