Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp2490250pxb; Sun, 15 Nov 2020 06:38:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwnaODnDWhFlk6NZqDGDVEicxUfyEuAKm3mJ/3LwBhdOJY9fSN01Ka7FInvsCKIdnw2ay3a X-Received: by 2002:a17:906:bc46:: with SMTP id s6mr10428058ejv.456.1605451090063; Sun, 15 Nov 2020 06:38:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605451090; cv=none; d=google.com; s=arc-20160816; b=wRb9Pq2ZElqHtqQj92VH+ho61a2AgeqJKjawqvwLIBUkjESatHSmtRbGk/6n+GBsoX 8V+qnouTge5a51tRar0khW4kYD+Ir1oPbJtk0qln1n7NJ3O7ewjj5f2cYHCrRwfF8cKF 8TLKvuKTORNWPZPi5jVxkZDfMzHYl9bgIucPMT6Eiiqk8ROdtdjTel16SmczuaWFBOl+ ndyJNU1cP9ODCtvlhQ6i5XAQ3pZGGAaHaF+v57m0KzS+TEKKu7L5lahdiA/dDtg4qTyJ ge8NwK2qbGKTfEG3je47i7p9UJn+fVdX6NTzsBWJBWGjHDmoqzWqqgQQ+HRxMnb1yuBZ 3oGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:ironport-sdr :ironport-sdr; bh=XikJS8BTUwmN1DkT4l8p+eZGWDLMRyqqNwv6dbKhOwU=; b=b+JG5WK96jjSJrd8M27HzYZ3kBr9oytYu7SaAa5NzhJ8LmMYSdX7iZQ39nHiatRrJM IFiSK4AxAHwESNJNAFmKfIhe5Z3VZykd+81oY5I3mFSixfa78SIp2a9Vke0eK/de5Phd KODXlY/zfjNjT/9kJN35DWCO3suHRz38zKxCWXkUXg+iNOTz5E7Jz+oRcB2qqSx4wou3 clkeWjEwbpB9IXhQMHD9HdZYsQWsnbNv6RAurMkBSegq/3jUHRVQvOxlxZc9WrNsj5ei gksBheZ3Sb4HLpcDSvWNW4bJqIw/LOU3y+v9FVQnlN/tCJIv6Mn3PD1cmb1KOMNbp4Y5 +llQ== 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 u26si10632424edd.532.2020.11.15.06.37.47; Sun, 15 Nov 2020 06:38:10 -0800 (PST) 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 S1726944AbgKONF0 (ORCPT + 99 others); Sun, 15 Nov 2020 08:05:26 -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