Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3527623pxb; Mon, 16 Nov 2020 17:55:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwlAsVfu7os2eTAg4bHNGJ9qYMUU71n/lr6Ko5S47IySNBnEQ3eIbhjwDROi1IKtNwrvK3S X-Received: by 2002:a05:6402:c8d:: with SMTP id cm13mr17863761edb.340.1605578149847; Mon, 16 Nov 2020 17:55:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605578149; cv=none; d=google.com; s=arc-20160816; b=PXUXVlmA7br5bRHuPio6eEUpK1Tm/RROb5qhM0K+DBDKI1X/6CdsVo1AmGNJE1iJpr 3Dlv9lXp8+hBFDhgCf/k22AG6hAEh1lNFz7kInJW2petI6EEACJp7LACXXiBLI0NYs8c x9ZGnJ9WQqUxGXCuaBfkt6VcYZv6tUDkmVNntSYO4oyfqXoCuCNVCQ6zdiJJylevj+cF Yaf70YmVclP+N4gHGIPhPoes2iiPBd7LJtxa9M2D9uuCTZWEgEjIgDqJrTQ2G39CSZGM N3M5DGnwxtWJCz2q4DjVRLKtFRwvKu3lY68t/igKqAq5aLUspwgtd4J4MlG/OSdjuP/g fDYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=FB51splDv5Z/I0NlyhmgZmN3jlvj8opC+lx5Kt6wuk0=; b=iiBNt+P+RojZyQwsTdPoWvsfLXDuljBmCF0RfW0GjRH+WHYX7ZdlpBfg54z8M9i33V fWrzeiBZYRoNl6jp73q7ttOruorJm9/5yV51XSHjM1EIAxv/em5azN+aReL+vWYnkX9A +NJoB2UrOOH3egMRqKn51RqZd/TlRrvbPXuRZDDJ7Qt0Rf/1AIhueo9zX6pTIS13pOLr iFhcYB9oPFfFA4d7kpB3ZLgKtqcqR8KTtEKNthc2aQbDv7HU/88kttzQLMHoddPQG1kj E0HWfvJ4f8vDYJkmgjJhgMs7TUhjgxBU219jTy1o38rt3g0jdeWiC4tuQotTF9VWQMm6 sx4Q== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y10si2448209ejh.425.2020.11.16.17.55.27; Mon, 16 Nov 2020 17:55:49 -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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730661AbgKPQk6 (ORCPT + 99 others); Mon, 16 Nov 2020 11:40:58 -0500 Received: from mail-qk1-f194.google.com ([209.85.222.194]:34034 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728433AbgKPQk5 (ORCPT ); Mon, 16 Nov 2020 11:40:57 -0500 Received: by mail-qk1-f194.google.com with SMTP id n132so17382501qke.1 for ; Mon, 16 Nov 2020 08:40:57 -0800 (PST) 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=FB51splDv5Z/I0NlyhmgZmN3jlvj8opC+lx5Kt6wuk0=; b=mb+EStYBRs8Fm7tYE4b9g5AbniI+9QoZwQDJQmQfVEyetsBenyXwfdYos17bgsjJmA TYBo8KqpA7r6Mp49H9upZOUdO59DFasRA5celGzb2ucAeDUaDUsnXEGIbScslpvQ3zXN 8WYS4HklzXn0LhzIwei1hB6HLGZ7Iku7KYI1mM/VxYNTc6f+QGMlsWg7rQ34lMxSPgpP q3Gm6EeavynZL17Za2f6BFouMYyrBTSmKH50UVjHS6rWKJSbIw1yOGRDa/PzQme43vnS OecuSqLLvB7txk3FnjSw4XyOEmbs7QhN/LoepXyRRV8L5TEr5CTPUQld51Cs97RgwOR9 Emvg== X-Gm-Message-State: AOAM531/njiP+qsQ3O+3krtvHF6JaNycKbjqg7wT3Hw5rR8JWsXddD3e MI4BzPLQR/qX0Uwmqw8SFCUG9O8KyahO9t9rxJI= X-Received: by 2002:a37:a855:: with SMTP id r82mr9385136qke.132.1605544856367; Mon, 16 Nov 2020 08:40:56 -0800 (PST) MIME-Version: 1.0 References: <20201114023643.211313-1-namhyung@kernel.org> <20201115130524.GL894261@tassilo.jf.intel.com> In-Reply-To: <20201115130524.GL894261@tassilo.jf.intel.com> From: Namhyung Kim Date: Tue, 17 Nov 2020 01:40:45 +0900 Message-ID: Subject: Re: [PATCH] perf stat: Take cgroups into account for shadow stats To: Andi Kleen Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Ingo Molnar , Peter Zijlstra , Mark Rutland , Alexander Shishkin , LKML , Stephane Eranian , Ian Rogers Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andi, On Sun, Nov 15, 2020 at 10:05 PM Andi Kleen wrote: > > > @@ -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. I don't think they are used for sorting. It's just to compare to find a matching event value. For heap randomization, we already used the same technique for evsel and runtime_stat pointers. I can make it use cgroup id but not sure it is really worth it. > > Do we have the same problem with other filters? I'm not aware of it. > > The rest of the patch looks good to me. Thanks for the review! Namhyung