Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4293406pxk; Tue, 22 Sep 2020 15:57:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5RmBxL8iLRfyRPXHP2jsKM/tYMvgoUXp54wiqFqiw6GcYwR3rBWx/+f1h8k3ti3yNRknK X-Received: by 2002:a05:6402:3105:: with SMTP id dc5mr6635612edb.105.1600815427164; Tue, 22 Sep 2020 15:57:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600815427; cv=none; d=google.com; s=arc-20160816; b=ZOgHJPJhLrC9CcjO2+8pMve2g3uXXJmFm9IGzajWivmJvKF0d6Ig5NLSXw4Ijnrfni /6uscEnEhhLZPtkqRLG2ZXxCrFKGvoc31OBdbQU4T5MQqLqQqQj3B961u0Cw+oTUig0l DJesxCQ1vZCD2+iE8jvAG5o58zZ3PXRm5VmmuR0jWOZascj2vk+9++UebVW41fnAnbDb EYDmoK5DXI7I+DaDC2eEYGbT+MEvrI6OfavCyh5Lx4FbjQzq/E1BDhvFUBfbcvj3HfEW LFb6QJDJGs9yN2Cs60LVRgnISK9PLXeraE38U6AkZzKqGW+tCfJLMJsO04bhrs5euL8Q c6og== 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=4NROQY74ZndOZ+p5fr+GaaolzsVSn9rBnu2dnFCtdNs=; b=mjq9cIq1jRjDVY69QMePJDV+WsIQ/mC6h7vKDA54LMnAxBKbpuHybgf9de33+v1kiv KgYmoBW3H/AL5NXGKhUb+AeKtPEnYmwegw25tL0YYzts2dR5oH7cXSrBtLY8Htrd+lyd cVPy3CoagIhDUTqoUhO0MyKUQNHK54PpKK/UnGp6Tzf1438Z3riC2bb4jhuRlBZupkRm latyRqkgasYnPgYaXU70wHvJ/5YdGmjP4nWKhvL7p6q449x4txX5nA5dfl0h8uB+u8/2 SYiKifwqDuU9iGZClqDaQTEgunk4kL9EZrtItrKYKZyjPDRxYoXBvsvVDg8KzVYl1oPC dbvw== 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 gf25si11359607ejb.428.2020.09.22.15.56.43; Tue, 22 Sep 2020 15:57:07 -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 S1726802AbgIVWzi (ORCPT + 99 others); Tue, 22 Sep 2020 18:55:38 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:53225 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726654AbgIVWzi (ORCPT ); Tue, 22 Sep 2020 18:55:38 -0400 Received: by mail-wm1-f65.google.com with SMTP id q9so5026601wmj.2 for ; Tue, 22 Sep 2020 15:55:37 -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=4NROQY74ZndOZ+p5fr+GaaolzsVSn9rBnu2dnFCtdNs=; b=AMPrFTgSF7GhwrmdjL09mTahY1GtGdM32f5t/ASVPZwTRGbHsEYZeFV4eFhSDZJCBM ZPKnac2a4qJAdKmB9qT+Vyjg41VkVAfP9SAg+bKzWnYWiWSKV5C6yJNZeyqgQQUpUTvp DpYDagwRl3QhlT7nfrf3PlEVPAzBwMguD6jTBzQ2JiSiG/uiJWCUpxF9RPmBANpdbl5q Jt+wlkeR7dyNAIK5JVj09aJO2/y2eNGK6x4HvepgQ1OgcUrPs1+uWqN3dK6oike4Nj1n RMa1x4Le7NE+koRv/g9P2z4YLopHpBT/lH20Cb2naBT/cOS/H2JruUqp4VFZ7oELNEBi ZbQw== X-Gm-Message-State: AOAM533ve/pFPuLkRn/FAjFOL3Z+FFowo9uoBsQjre9ALih+bfli4evt KQEdnVlZAFZzPPTFqdgiQYIbjen7FZ1LL2kmT7Y= X-Received: by 2002:a05:600c:4142:: with SMTP id h2mr3205019wmm.128.1600815337118; Tue, 22 Sep 2020 15:55:37 -0700 (PDT) MIME-Version: 1.0 References: <20200921094610.83736-1-namhyung@kernel.org> <20200921094610.83736-3-namhyung@kernel.org> In-Reply-To: From: Namhyung Kim Date: Wed, 23 Sep 2020 07:55:26 +0900 Message-ID: Subject: Re: [PATCH 2/5] perf stat: Add --for-each-cgroup option To: Stephane Eranian Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Ingo Molnar , Peter Zijlstra , Mark Rutland , Alexander Shishkin , LKML , Andi Kleen , Ian Rogers Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Stephane, On Wed, Sep 23, 2020 at 6:52 AM Stephane Eranian wrote: > > Hi, > > On Mon, Sep 21, 2020 at 2:46 AM Namhyung Kim wrote: > > > > The --for-each-cgroup option is a syntax sugar to monitor large number > > of cgroups easily. Current command line requires to list all the > > events and cgroups even if users want to monitor same events for each > > cgroup. This patch addresses that usage by copying given events for > > each cgroup on user's behalf. > > > > For instance, if they want to monitor 6 events for 200 cgroups each > > they should write 1200 event names (with -e) AND 1200 cgroup names > > (with -G) on the command line. But with this change, they can just > > specify 6 events and 200 cgroups with a new option. > > > > A simpler example below: It wants to measure 3 events for 2 cgroups > > ('A' and 'B'). The result is that total 6 events are counted like > > below. > > > > $ ./perf stat -a -e cpu-clock,cycles,instructions --for-each-cgroup A,B sleep 1 > > > You could also do it by keeping the -G option and providing > --for-each-cgroup as a modifier > of the behavior of -G: > > $ ./perf stat -a -e cpu-clock,cycles,instructions --for-each-cgroup -G > A,B sleep 1 > > That way, you do not have to handle the case where both are used. > And it makes transitioning to the new style simpler, i.e., the -G > option remains, just need > to trim the number of cgroups to 200 in your example. > > Just a suggestion. Thanks for the suggestion. Actually that's the approach I took in my v1 submission. And Jiri suggested the current way. Personally I'm fine with either. Thanks Namhyung