Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1549791pxk; Thu, 10 Sep 2020 19:37:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxos5v5DkYP/kF+ldCasJuxY9dOjBcg5YZQkWaCRJeeHXWooWuCpjqRRoSjD07/HR+BGpoS X-Received: by 2002:a50:d7ca:: with SMTP id m10mr13000145edj.259.1599791848385; Thu, 10 Sep 2020 19:37:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599791848; cv=none; d=google.com; s=arc-20160816; b=xXxMwTTNReTnMQmlsjK6LRpDMKaIyrIk5lum13IT2F0zA0Gl6YEBV9swyad85vd0Hc rNoz35rZnsrPY5n2GLlLCyu3At0eRByqfcEYKX7Dz/hHyhqzciBMZ1vTcEXSkHYZMkNE 9AckP3Bu4cMTMVv1D5+KO/ZBwg4BQRUhvd7HoPsKfzKX1KjcRKeY4e81ZXhwriF6OEol QUHmItYMEzirynViqfOmLK9EVgnJJR1Mas6Xt6x41N7vJVCVNZWgSusuKv8Mc3zUylSj 56/vZgRuqgwhIExucRt7ajYYtLgolpmHpdxgIII1159GXMnBE2fhHXm7+YyMM7MRrtzT 5oMg== 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; bh=NP+TiSCjTbVjad+6yJemOyFTfTJE1uB03ssAuxqrXIQ=; b=xCwKbBHGvRg7oIOmatbD1whWgSAb1HGXHUOOEJB5B6N6739h7a73+AZ4tWlcV+04MD EtSjt2fX9YWQFYJdZKwszV4vbweTRzOwvYI32DBEcS+t0JuCmZXXuMZmvi9FS9+IRpT/ rZPwQ15PqDevMRwV4e+D+l5AZpIIaTYrqi8WyY/0K2W8tQm7Apib9zEV5xzp9p34uIkg MV/F0BzFfjCD4Ihh645pc7Ko+Ri+uSuD4Oqp/kr0Yq1LKZnZbfPI1frk0SJE7MWsxY/S t4VH6eYiHjEzDiAVOT376CnHNQ5Gtm6vyPV/2/2tWkkMk8q/UiWNgsvi5F1ZNcPNXINm mRqw== 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 s6si360863edi.427.2020.09.10.19.37.05; Thu, 10 Sep 2020 19:37:28 -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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725799AbgIKCfq (ORCPT + 99 others); Thu, 10 Sep 2020 22:35:46 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:40358 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725300AbgIKCfn (ORCPT ); Thu, 10 Sep 2020 22:35:43 -0400 Received: by mail-wr1-f66.google.com with SMTP id j2so9890228wrx.7 for ; Thu, 10 Sep 2020 19:35:42 -0700 (PDT) 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=NP+TiSCjTbVjad+6yJemOyFTfTJE1uB03ssAuxqrXIQ=; b=G+JRqgXZjY45tUu9anOy5pNx28TEtd8YyDwEAbY56psg/jPDQ37uIig+fncgdzTbRh 6nBRDE1h8LpQA70inOiPthxJ0p85EYIHRt4U7ulYsT8tlcHrZSLiuXDdMUbclzmX3aih 34Bd8aEP+0NBYxhAdKcA+QErTv+g1WfRjcvGGZQpW4MZYc1H0IjI7dKCcXAiCrlgKp5t iYum1A3JD7aXd2Ltkg/56b5t3wExJSB/4X+q4hOcBjlb9nIbkiO2iLmPd/pezqq4MVPu k31DGm0Y/v3PygR2TgaSElNDle4dbHywSkGI708nSI7ddB6H/55SKb/5Zy/N/VHK/WkL 0B+A== X-Gm-Message-State: AOAM531eiIKMOcICTyWlzTTga4psof8zH6isXatBz4tuBP9iAx/jJR0k 9/MP5WnACmf7c8s9pSwYyfAM/ELLf1bHMkSHfKE= X-Received: by 2002:adf:a3c9:: with SMTP id m9mr12039318wrb.80.1599791741741; Thu, 10 Sep 2020 19:35:41 -0700 (PDT) MIME-Version: 1.0 References: <20200908044228.61197-1-namhyung@kernel.org> <20200910155736.jadhmqvnqquammpn@two.firstfloor.org> In-Reply-To: <20200910155736.jadhmqvnqquammpn@two.firstfloor.org> From: Namhyung Kim Date: Fri, 11 Sep 2020 11:35:30 +0900 Message-ID: Subject: Re: [PATCHSET 0/4] perf stat: Add --multiply-cgroup option To: Andi Kleen Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Ingo Molnar , Peter Zijlstra , Mark Rutland , Alexander Shishkin , Stephane Eranian , LKML , Ian Rogers 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 Hi Andi, On Fri, Sep 11, 2020 at 1:05 AM Andi Kleen wrote: > > On Tue, Sep 08, 2020 at 01:42:24PM +0900, Namhyung Kim wrote: > > When we profile cgroup events with perf stat, it's very annoying to > > specify events and cgroups on the command line as it requires the > > mapping between events and cgroups. (Note that perf record can use > > cgroup sampling but it's not usable for perf stat). > > The problem is real, but I don't really like your solution. > The option is ugly. Should rather be solved with some suitable > syntax in the expression parser to express: apply to all, > instead of adding adhoc options like this. Yeah, I'd admit that I'm terrible at naming. :) I'm open to any suggestions as I'm also bad at making new syntax.. But as Ian said, my approach takes care of the common case without dealing with controversial syntax changes. > > There are some additional problems that really need to be eventually > solved too: > > - If you use the old syntax and some cgroups are not covered you don't > get any warning. At least that should be fixed too. I don't follow. Do you mean like when -G option and --multiply-cgroup option is used at the same time? Or when -G option doesn't match to -e option? > > - And of course if everything works it is still very slow for the kernel > because there are so many perf events to handle. Long term we probably > need some more flexible way to just specify for given perf events which set of > cgroups they should apply, so that sharing and low overhead monitoring > of many cgroups is possible I hate to say it, but maybe some eBPF filter > is the solution here. Yes, I'm also interested in improving that too. Thanks Namhyung