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 X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B182AC38A2A for ; Sat, 9 May 2020 02:40:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 932E424960 for ; Sat, 9 May 2020 02:40:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728670AbgEICkV (ORCPT ); Fri, 8 May 2020 22:40:21 -0400 Received: from mga18.intel.com ([134.134.136.126]:30259 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728158AbgEICkU (ORCPT ); Fri, 8 May 2020 22:40:20 -0400 IronPort-SDR: TuSkhEVgjw0jHxHBD9QScBk7J/rCtKt4ZkNIeig2YBvvrbY2mvWsTagCfPbh8bayvZkRcl+w7y YO1sUpswspVg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2020 19:40:19 -0700 IronPort-SDR: otJ5RVTFD0D3ZcvB0S2H/Pn/WnlUlu/sS3X9/nqs7F9fN59s0mjHnss6MGr3Lr04NP7idNs4CT xw3SG3Z12uaQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,370,1583222400"; d="scan'208";a="261184041" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.21]) by orsmga003.jf.intel.com with ESMTP; 08 May 2020 19:40:19 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id 8BF11301C4C; Fri, 8 May 2020 19:40:19 -0700 (PDT) Date: Fri, 8 May 2020 19:40:19 -0700 From: Andi Kleen To: Ian Rogers Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , John Fastabend , KP Singh , Kajol Jain , John Garry , Jin Yao , Kan Liang , Cong Wang , Kim Phillips , LKML , Networking , bpf , linux-perf-users , Vince Weaver , Stephane Eranian Subject: Re: [RFC PATCH v3 12/14] perf metricgroup: order event groups by size Message-ID: <20200509024019.GI3538@tassilo.jf.intel.com> References: <20200508053629.210324-1-irogers@google.com> <20200508053629.210324-13-irogers@google.com> <20200509002518.GF3538@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > I'm not sure if size is that great an heuristic. The dedup algorithm should > > work in any case even if you don't order by size, right? > > Consider two metrics: > - metric 1 with events {A,B} > - metric 2 with events {A,B,C,D} > If the list isn't sorted then as the matching takes the first group > with all the events, metric 1 will match {A,B} and metric 2 {A,B,C,D}. > If the order is sorted to {A,B,C,D},{A,B} then metric 1 matches within > the {A,B,C,D} group as does metric 2. The events in metric 1 aren't > used and are removed. Ok. It's better for the longer metric if they stay together. > > The dedup algorithm is very naive :-) I guess what matters is that it gives reasonable results on the current metrics. I assume it does? How much deduping is happening if you run all metrics? For toplev on my long term todo list was to compare it against a hopefully better schedule generated by or-tools, but I never got around to coding that up. -Andi