Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp190273pxa; Mon, 10 Aug 2020 23:44:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTi9SVfrBipAaZYYpYXDlUHU0AqDPMyuz0nHzV5WPwrHtkKtt86kz/rJM8psS/6roMiuyX X-Received: by 2002:a17:906:8389:: with SMTP id p9mr26167068ejx.391.1597128270704; Mon, 10 Aug 2020 23:44:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597128270; cv=none; d=google.com; s=arc-20160816; b=kUiMxEHtqOITdqA41D6Cpfutg0I9ckk2weWT53R37NlDPVTk8v5BjaHUY9sklD+h3e J5fbpVuuxhWWAUREYBMuyepBZHk/xFRcA8WGvpaR/gnvhmO3BXDFKKRXI2oYxiVGE4vz G723hCIFY8vXpfWfH1lBjqmm3xbHiukpdhyE7BAFbOOlvUo0XDVT6yxfWmYlPHetyAc+ pAXCzARST3+RncF5elFoJfA0pd3CzIhiYo/WoVRFyafiSonLseNmdDrhQ5ulqyiNYybS Df2O2h/uji8Kg/EnHZhhaTEkAXLhc4MRywTgyTs3JVj7PvnL3lc02aK5ELyQpiJd/mBh 6Kzg== 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=EW9UExPP4cCsEpySaao+QgP8WSaCGYFKB0QeZjeCUF8=; b=BhD4aXPI/I5sKCQsR8gg0w/+AhdL73hPfr1C5rlIbnDXrtbctxgq2BXy2RAltYovKL 7f0YbubFY/QGANIUUMw1G5b00ULZ/Mfdl+dILZrNZEww3phRQtLLh9AS0FZ+lcmYk7jv lWOJ3JaNGiwSMgC6yXlGbO6YooFH9NN80HbX4yboNn1On/IdgHaw6BYDOdXYzY67KNMp 5ukbbUVz8j+j56DLBf1oHkODGNIBVn6LIuSxn9Q+KymUN+0rVKHzYT0o7VrTiHVrXT41 PTOYhod9XYn7XPS7FsAgDSGRvykuPza41YeWjFYsQ8wNPFsCqM8/467fT2xiz2SZX5Kd bmOg== 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 n25si12454687ejs.131.2020.08.10.23.44.08; Mon, 10 Aug 2020 23:44:30 -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 S1728192AbgHKGnI (ORCPT + 99 others); Tue, 11 Aug 2020 02:43:08 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:52362 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727066AbgHKGnH (ORCPT ); Tue, 11 Aug 2020 02:43:07 -0400 Received: by mail-wm1-f65.google.com with SMTP id x5so1587989wmi.2 for ; Mon, 10 Aug 2020 23:43:06 -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=EW9UExPP4cCsEpySaao+QgP8WSaCGYFKB0QeZjeCUF8=; b=hBgIcBsX2F6h0kEYYH1Hzw8bz9HVY/YrA39ABWTD5wfJh18fpWSX4xExXxkXBBIBtO iLz7z1duvY4ex6e3yjmqptB8p1pFMKqfrvkGnyucXBg3K29HiorV6g/DfSMcWp5ye7lU r16XN+92EQV1Oj3xHn6sD/3anjlTikHkI3bAEz/V5F9UyLkSPBa0fxBOPLmGkWzpUyox MJWA+pZQUaiBX4hsM6W0UHuT2rWbopsTT6fs9GzwbPkkwo5r7DE92dEAuvKrwzwspD1Z woP+3A8zqjw96AeRYZIJ+EpL3mARrXqulz85ZyJAlIy2O0jI63INAwIovGRT1AgOKi76 3bFA== X-Gm-Message-State: AOAM532NL9KkNDQnDv44gTI4ZmtZneZCUqLdN8HbZDS9M3B9P8ds43+m +rYDSUePT4u7aOzDpk24BMj39W7FRfyyM49uTZk= X-Received: by 2002:a1c:7504:: with SMTP id o4mr1809076wmc.70.1597128185929; Mon, 10 Aug 2020 23:43:05 -0700 (PDT) MIME-Version: 1.0 References: <20200807164937.44921-1-dsahern@kernel.org> In-Reply-To: <20200807164937.44921-1-dsahern@kernel.org> From: Namhyung Kim Date: Tue, 11 Aug 2020 15:42:54 +0900 Message-ID: Subject: Re: [PATCH 2/2] perf sched timehist: Fix use of CPU list with summary option To: David Ahern Cc: Arnaldo Carvalho de Melo , linux-kernel , Jiri Olsa 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 On Sat, Aug 8, 2020 at 1:49 AM David Ahern wrote: > > Do not update thread stats or show idle summary unless CPU is in > the list of interest. > > Fixes: c30d630d1bcf ("perf sched timehist: Add support for filtering on CPU") > Signed-off-by: David Ahern > --- > tools/perf/builtin-sched.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c > index 0c7d599fa555..82ee0dfd1831 100644 > --- a/tools/perf/builtin-sched.c > +++ b/tools/perf/builtin-sched.c > @@ -2575,7 +2575,8 @@ static int timehist_sched_change_event(struct perf_tool *tool, > } > > if (!sched->idle_hist || thread->tid == 0) { > - timehist_update_runtime_stats(tr, t, tprev); > + if (!cpu_list || test_bit(sample->cpu, cpu_bitmap)) > + timehist_update_runtime_stats(tr, t, tprev); > > if (sched->idle_hist) { > struct idle_thread_runtime *itr = (void *)tr; > @@ -2848,6 +2849,9 @@ static void timehist_print_summary(struct perf_sched *sched, > > printf("\nIdle stats:\n"); > for (i = 0; i < idle_max_cpu; ++i) { > + if (!test_bit(i, cpu_bitmap)) Shouldn't it check cpu_list as well? Thanks Namhyung > + continue; > + > t = idle_threads[i]; > if (!t) > continue; > -- > 2.17.1 >