From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7AD35EBE for ; Tue, 17 Oct 2023 12:43:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Lmp1O4NO" Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EBE7F7; Tue, 17 Oct 2023 05:43:50 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-507bd19eac8so987435e87.0; Tue, 17 Oct 2023 05:43:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697546628; x=1698151428; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=dU8fcBg2qfnHqJfD8YzF7HjBo3pGHCr4x5VKwo1eLr0=; b=Lmp1O4NOqIU8AnkHQlwWrizbq1nY+neJpVLQbaY9wQaHDR//++bLnJt+uaq7Xautmy nZeofmYtz0GXMTVKdgPgfU71rAbFNZoxUrNpZHlNfNcvZL7Yxmu0VdeGQtov6aoLdHrC ANx16fzn5E2UfFabUhFGRoYid6PeDv7RTSxaJCcwvwt9n9rUudgsTUZ9yC3oHnimYlji jw+nDJitu3NeT3Es2izROC8cBJNM/e8HuIES/7ZVyOgCAaAjQr3AJUgAGUyNMUG/kDSg UXBpIQ7oSXUn/x1N4/2gA31Z5CLTvsHupUb+5iEmbHiHLt23x8UPrR59WKQKVkN+4ueV dJag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697546628; x=1698151428; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dU8fcBg2qfnHqJfD8YzF7HjBo3pGHCr4x5VKwo1eLr0=; b=Gz+OAqNCTjIdF0/kq503lvGe3vG0QxLqIGa2P/y5XQF9uOwTMvkLPrzIC/uXQkSHmT J3bLlkjc3wWSCQxJiakXHLmeNCCCJXbtDi7dcrrXnVFjSflYK+HGiNPFVag5EUCrKTVt +IHRtM4/BoArQt2/MJILj7u5roaNrWgojSi8f2A/AJy+FWXk4nxdKGUovxqYmV/oxY1B FItaDKRJoGWUxYxUc9CDkKaXJvw2x/8sekG4yW7QJvJRs9Kx3SWwded5dOipUg99O8pq s4aG+RUSuv5vgmEDP00TYcVXoIuR1eQum82xup411eXiTf87Ao2vFl1fX7C99vxK82YY TUbw== X-Gm-Message-State: AOJu0YyudOfIu0XxS8eccvWaEGccBhTMdNqiawhJd1DCWYGYC3TSWtaH E/PpFANXsHozFxfBW7hQTKI= X-Google-Smtp-Source: AGHT+IHvWVUF0JDmvlQh2xBjxEDBsuMN0cpQVq3rhVOa4Mis6fhC7TgE6BIM4XSfgwVi7PlUnIKM5g== X-Received: by 2002:a05:6512:2387:b0:503:8fa:da22 with SMTP id c7-20020a056512238700b0050308fada22mr2072367lfv.22.1697546627970; Tue, 17 Oct 2023 05:43:47 -0700 (PDT) Received: from gmail.com (1F2EF7B2.nat.pool.telekom.hu. [31.46.247.178]) by smtp.gmail.com with ESMTPSA id a6-20020aa7cf06000000b0053e625da9absm1158420edy.41.2023.10.17.05.43.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 05:43:47 -0700 (PDT) Sender: Ingo Molnar Date: Tue, 17 Oct 2023 14:43:45 +0200 From: Ingo Molnar To: Arnaldo Carvalho de Melo Cc: Namhyung Kim , Jiri Olsa , Ian Rogers , Adrian Hunter , Peter Zijlstra , LKML , linux-perf-users@vger.kernel.org Subject: Re: [perf stat] Extend --cpu to non-system-wide runs too? was Re: [PATCH v3] perf bench sched pipe: Add -G/--cgroups option Message-ID: References: <20231016044225.1125674-1-namhyung@kernel.org> Precedence: bulk X-Mailing-List: linux-perf-users@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net * Arnaldo Carvalho de Melo wrote: > Em Tue, Oct 17, 2023 at 01:40:07PM +0200, Ingo Molnar escreveu: > > Side note: it might make sense to add a sane cpumask/affinity setting > > option to perf stat itself: > > > > perf stat --cpumask > > > > ... or so? > > > > We do have -C: > > > > -C, --cpu list of cpus to monitor in system-wide > > > > ... but that's limited to --all-cpus, right? > > > > Perhaps we could extend --cpu to non-system-wide runs too? > > Maybe I misunderstood your question, but its a list of cpus to limit the > counting: Ok. So I thought that "--cpumask mask/list/etc" should simply do what 'taskset' is doing: using the sched_setaffinity() syscall to make the current workload and all its children. There's impact on perf stat itself: it could just call sched_setaffinity() early on, and not bother about it? Having it built-in into perf would simply make it easier to not forget running 'taskset'. :-) Thanks, Ingo