Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp347767ybk; Wed, 20 May 2020 00:55:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxWElaSNy0j/Pt4dE1Duf6H8iOxZYdkAJZ3EIkuYDE+KxM1CLfxw5e+6ewkVam5pVjLAWS X-Received: by 2002:a17:906:49c7:: with SMTP id w7mr2851836ejv.402.1589961333732; Wed, 20 May 2020 00:55:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589961333; cv=none; d=google.com; s=arc-20160816; b=j4/mJrLEZ73l2QPIhasuhaY+ivO2oU4TJbEnNWg0ynSTQRLZUUkqKqj6pz9m/tR5ZO 9PTseNU7NDoTiJ73H2DaSeBNH9txkLBZKnqAY9CB7C+lCvwK1pQbPVLr6rTi7uvAK9Nz 1aPICmvEtK96B83aOwdK3/0zLEfbyDpiF/BKipb395xupUJ30FF6TGwD5mUYWLHYIo7J 5OFljvXRtuBLuSMIv3KgXFzgpkxMO/MhNLSdkDwPZ41vjF2dSqDCW8hBvKdV8aGUCjgG QwpandQq58GP2TA959oxsSo9bINC2Rak+gl4Wf6PRE6QEM/l8RCI2rdAbQ6Pd+bGdFmt w8hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=GcskknYh95Rq/Z6Azk62iLDMqUdVtj6gS2U77ZaIoIU=; b=K8kjsS6lK5e/6SBUTM9U7i+C2aFu8VtW6WGhMVthO8oYMdqBJYtURHy27Ge7E06YdM RWcJcFgVs/v71zbt60j+WTQhqi2b9NwgN12wSfy8z7dNUVJDEQAAV7CO8gM9M8wW0zNA JIcVSNrVGTs9cPhpTevGC2Mho6DBQr41tG6kZbx0vKUfsb9cSW/QNrSl1uQ5dFD0j/Na CGT3lGCvxnVwainb0V7xsGqvDTQrOx19Q8dGEFXBeJIahJwDUK25CyTSzIClEPkgyZUu 4/PaoXhmTCpWwkVnYMgfoIxOgdVdPq4vnRbq771FKeevzCNRQzs7ZKE2i+vtgk/geBTf NaXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=O44tJvlv; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c3si1159973edx.175.2020.05.20.00.55.11; Wed, 20 May 2020 00:55:33 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=O44tJvlv; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726570AbgETHxs (ORCPT + 99 others); Wed, 20 May 2020 03:53:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726403AbgETHxs (ORCPT ); Wed, 20 May 2020 03:53:48 -0400 Received: from mail-oo1-xc43.google.com (mail-oo1-xc43.google.com [IPv6:2607:f8b0:4864:20::c43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A802C061A0E for ; Wed, 20 May 2020 00:53:48 -0700 (PDT) Received: by mail-oo1-xc43.google.com with SMTP id c83so541176oob.6 for ; Wed, 20 May 2020 00:53:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GcskknYh95Rq/Z6Azk62iLDMqUdVtj6gS2U77ZaIoIU=; b=O44tJvlv/WeGAb2EUW5U1b7mccht+alKed3ccPJygFxfgOiFTPk1FratyivkGc09Lv xuzcQDqx5Hgm7ZErC5Ll1kGXoT8P4VVHw2p3iW54tOUCLs9CpnclbpknkrOPV24VSlU8 8wM2T9eqOBFTanPK5rnk4LgPYPh3A7PxoiRB+LYZH1PxDB41pN1I8QZSzz1UT02PB29S FjvcxIKv5zbe9M1/LHogO3Ebj+KEt43IIO0zhchKc2GKE3vBi+nJAUELFit5FR/l2A4Y WYHNbIuCWPW8qutZwXV/iekANN7iMF5zJZu9FWhBbj+NHjs7eUbFUsYfOb/oRT3x4FVC xh1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GcskknYh95Rq/Z6Azk62iLDMqUdVtj6gS2U77ZaIoIU=; b=qDx+N0WttQmpJBiQ6JpyyPfbNwlNcot5bZJxqkDN0ahUShvH0PUfyj9Zhud0Uq0OTv NSaSNza0qhQoNeNW9mIizJS1Z41Y4NQp/57zlSocKbbT1IHCitmmdMTeLUYOAmJSwsS3 KAVLTZMVKspyVTF1n3zO7Seb+wJ1opf09Bg8R2EHppVXHlwV9EJM+uF7+bYovdAfbsfA uzCZD6XTtTuhl2WrqBj2LroTTCibvECYnXwekXOC9Bj1XqE5yVK4sbTsaQi/zpR3qUe9 71r2/2M5X2VBp0t4oqvcEmulP+sG9/AZPJOuqG9hV2U+zTpmOapDm2x4AJRbuaW8tVP+ 2UOw== X-Gm-Message-State: AOAM531rdimHZWRPMLqOhV1mcdkBLMW8s2HZ4hvkLWw+1RisEDIWHOKY 3rvr4+jH3BjOVAwZzgvPkh6aMIP7kE8I+kotMYd9G1mVdtEbog== X-Received: by 2002:a25:7cc1:: with SMTP id x184mr5135676ybc.403.1589960793022; Wed, 20 May 2020 00:46:33 -0700 (PDT) MIME-Version: 1.0 References: <20200508053629.210324-1-irogers@google.com> <20200508053629.210324-13-irogers@google.com> <20200509002518.GF3538@tassilo.jf.intel.com> <20200509024019.GI3538@tassilo.jf.intel.com> In-Reply-To: <20200509024019.GI3538@tassilo.jf.intel.com> From: Ian Rogers Date: Wed, 20 May 2020 00:46:22 -0700 Message-ID: Subject: Re: [RFC PATCH v3 12/14] perf metricgroup: order event groups by size To: Andi Kleen 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 8, 2020 at 7:40 PM Andi Kleen wrote: > > > > 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? Hi Andi, I included this data in the latest cover-letter: https://lore.kernel.org/lkml/20200520072814.128267-1-irogers@google.com/ > 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 Agreed, and this relates to your comments about doing the algorithm as a separate pass outside of find_evsel_group. For that, I don't disagree but would like to land what we have and then follow up with improvements. Thanks, Ian