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=-3.8 required=3.0 tests=BAYES_00, 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 20F41C2D0E4 for ; Sun, 15 Nov 2020 13:05:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D7DAB22447 for ; Sun, 15 Nov 2020 13:05:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727080AbgKONF1 (ORCPT ); Sun, 15 Nov 2020 08:05:27 -0500 Received: from mga01.intel.com ([192.55.52.88]:45656 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726795AbgKONF0 (ORCPT ); Sun, 15 Nov 2020 08:05:26 -0500 IronPort-SDR: TvmTn46vySo7pcxa47A5u9mYhZuP+Xc79DOOsTZ3zInTPUYNsSONV354cKhgb0Hlm1KaEJA3CD dBKb/x2o+VBg== X-IronPort-AV: E=McAfee;i="6000,8403,9805"; a="188686986" X-IronPort-AV: E=Sophos;i="5.77,480,1596524400"; d="scan'208";a="188686986" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2020 05:05:25 -0800 IronPort-SDR: M5fUKI7iZIgMhYqL/ymWNDzdoK+ygXYGPr0w85UP00EhfFJDNnrMpgKWtZ2CF8LdNg41YT1NV+ /fHa66mBenjQ== X-IronPort-AV: E=Sophos;i="5.77,480,1596524400"; d="scan'208";a="475234796" Received: from tassilo.jf.intel.com ([10.54.74.11]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2020 05:05:25 -0800 Date: Sun, 15 Nov 2020 05:05:24 -0800 From: Andi Kleen To: Namhyung Kim Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Ingo Molnar , Peter Zijlstra , Mark Rutland , Alexander Shishkin , LKML , Stephane Eranian , Ian Rogers Subject: Re: [PATCH] perf stat: Take cgroups into account for shadow stats Message-ID: <20201115130524.GL894261@tassilo.jf.intel.com> References: <20201114023643.211313-1-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201114023643.211313-1-namhyung@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > @@ -57,6 +59,9 @@ static int saved_value_cmp(struct rb_node *rb_node, const void *entry) > if (a->ctx != b->ctx) > return a->ctx - b->ctx; > > + if (a->cgrp != b->cgrp) > + return (char *)a->cgrp < (char *)b->cgrp ? -1 : +1; This means the sort order will depend on heap randomization, which will make it harder to debug. Better use something stable like the inode number of the cgroup. Do we have the same problem with other filters? The rest of the patch looks good to me. -Andi