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 D170FC4332F for ; Tue, 11 Oct 2022 23:33:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229561AbiJKXdL (ORCPT ); Tue, 11 Oct 2022 19:33:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbiJKXdL (ORCPT ); Tue, 11 Oct 2022 19:33:11 -0400 Received: from mail-oa1-f50.google.com (mail-oa1-f50.google.com [209.85.160.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0688A344F; Tue, 11 Oct 2022 16:33:10 -0700 (PDT) Received: by mail-oa1-f50.google.com with SMTP id 586e51a60fabf-1321a1e94b3so17780307fac.1; Tue, 11 Oct 2022 16:33:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc: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=i00Mjx5UPOf64nXnM7PPfFdX40HdBRwvXpSo63eHc6I=; b=Iv6x7loIYLaAEfiT+r0UCkeu1pQE9qd/6bFC6bIOcF2JnxDxs5TBrmV7sjfvF6eXRS WGcSWIjgHugnGX95V+T4GKDJh0wFbN3iDrJWgfqTGKOAL9Z/hV9+K6tybSAt5mDvw/D3 IrPyHrnAiFnusD2cy27n7KbS8lPAQchRk8vkMP5ncL9cnl0EBmT6qp2d0gNodNF7n57r TtfbOKMVclE1Q20CqORbPYyEjNY441KOLfJi/0A941ShNuDfAr3gFUBXQ56XJH+Uroh4 0Xh48DfIwWnnUu7OMHPt6MSPgwCWiN+KEKsydsihwmvWCJ00brWzaLh75lffp/oTKdjD gL8g== X-Gm-Message-State: ACrzQf3h+wqPCDhOQV8rOUu2EleVonnfPiyDr1xK6jjIIXQNi5ImxpYS 6v18FOe6npwVsQdxYoSkqRoZQcLcXI8FdT4vA0w= X-Google-Smtp-Source: AMsMyM73epZgrR0Tord5Uu16fo3N2awQemOMe+URL8pwAGJviTBiEiF0Rud3wrsjMPNfUfafwcl2eV1XquVO7godByQ= X-Received: by 2002:a05:6870:4184:b0:136:5e73:b40e with SMTP id y4-20020a056870418400b001365e73b40emr869068oac.209.1665531189975; Tue, 11 Oct 2022 16:33:09 -0700 (PDT) MIME-Version: 1.0 References: <20221010053600.272854-1-namhyung@kernel.org> <20221010053600.272854-7-namhyung@kernel.org> In-Reply-To: From: Namhyung Kim Date: Tue, 11 Oct 2022 16:32:58 -0700 Message-ID: Subject: Re: [PATCH 06/19] perf stat: Add 'needs_sort' argument to cpu_aggr_map__new() To: Ian Rogers Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Ingo Molnar , Peter Zijlstra , LKML , Adrian Hunter , linux-perf-users , Kan Liang , Leo Yan , Andi Kleen , Athira Rajeev , James Clark , Xing Zhengjun Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org On Mon, Oct 10, 2022 at 3:53 PM Ian Rogers wrote: > > On Sun, Oct 9, 2022 at 10:36 PM Namhyung Kim wrote: > > > > In case of no aggregation, it needs to keep the original (cpu) ordering > > in the aggr_map so that it can be in sync with the cpu map. This will > > make the code easier to handle AGGR_NONE similar to others. > > > > The CPU map is sorted and so sorting the aggr_map should be fine. If > the data is already sorted then it is O(n) to sort. I think this is > preferable to having additional complexity around whether the aggr_map > is sorted. The problem is that aggr_cpu_id__cmp() only checks socket, die and core so it will have CPUs in the same core together - like 0, 4, 1, 5, 2, 6, 3, 7. Thanks, Namhyung