Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp90122ybk; Fri, 8 May 2020 19:42:04 -0700 (PDT) X-Google-Smtp-Source: APiQypIVelQX8GhQK3uXzUyS5XzYh/qCrfVlpUuxyvDkRtYE4q4HL9+rKZwvUcutg7P0XQ7o33Qy X-Received: by 2002:a17:906:81d7:: with SMTP id e23mr4149027ejx.309.1588992124708; Fri, 08 May 2020 19:42:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588992124; cv=none; d=google.com; s=arc-20160816; b=die6YTSzt2BBW2U4MwDOP6Tcpir5YBKFgvJvohbg7/lmgueoLZfgT8yHye+kVyD6Ad 7oa/47wqcngAfKRjWRj9iMNbvtEJLPeFQ5kt93SXaf0SGJeDITijcKYiT7Jx4fB3Bk/A XUbiGlOpdrltEaX5PFSo0RSSk9JdkPB9DY8wKpzmA2/henVScaS0lj6MoLk3SkYBzCCe WzgLLv2yj9b+3bN3fjSwAr4gdMJpVIKEsejvWDuif+uRhcO0u2Jk7NQ69lgzpDJdQnCq 0jOVsux/RiuNL9lbVfXBqdOSVYO4qHUIhkzXYADp/uC3DgEXsrSqwqipvE6Towc0WnTG 8ERw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=037Amo3jcmPMAz8UuI1hSxPy8eWQHFmjJnJSH5rOi5k=; b=jVxkCVb3ppx2gS2v7Jx3WKzv573aBTnjoaRq3s+T2edLyl3lCY1K7hqQlPMIKwHif3 vuQCDWYP+KwDPZEEv0jsx1HPEnQGfdb4geGsQFmVD5r/4juZ+1Yjsm6jJhPf8wC5300s tbfMbslFlvxCkj4012Hv1L2wmEFd1gpS/sw+iPBrJezf1vEOb3TflpCiq4797NOTxTJf 4uraDz03Ahr5ZmayrVitggmyZWlggKjLYqDNmgl9OQt1/3auRBfBQa779D3ZA0LkUsTO xg0M0edKRR9d6QFlfbYSDcQsVsXENN5PCaAATMgsfgB3zKfXxIu4rzrodL98xMU5bTur 3vMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i12si2115895edx.421.2020.05.08.19.41.42; Fri, 08 May 2020 19:42:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728657AbgEICkU (ORCPT + 99 others); Fri, 8 May 2020 22:40:20 -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