Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2386075pxa; Fri, 7 Aug 2020 09:51:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1IPBzGa2QDCUHWIRKGmRCIdQUfxKSGI2sXiDrnYjEJw+Ncv48I09FXTpgpMpuo14pZkbU X-Received: by 2002:aa7:df8c:: with SMTP id b12mr9750713edy.263.1596819065719; Fri, 07 Aug 2020 09:51:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596819065; cv=none; d=google.com; s=arc-20160816; b=jLGU/Ghtwycap+DWU1dKYavXltJbwx70d0fdURAFbQS+Fhru9lLrG8KtYhTp/oxiwE FC1w5wohon7OWDzSOayQnraFOK4GH+xI//QVBCsMh1WBmTRPyMvAnEx2zQFl5AqIL5du podCjKw4L1c/6OPB18XdeXUJT+jW0UZbK9SFl/awGSNXRG+6KjgX1BAdL01PlxqSOw8m E2NIws7XD9LIk9NyRIMJP6SoFYi8kk/VTt+t6d5XkRcFYx2BSzMikKIh98yasxLyn9dy WtG/jESgM04PKC7Aiv9yEnRVA7SqaLYRjLjSkXAbl0UeutGiUnhsULKpBYTr7YOjzVkO vV/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=j0BZAjTcEHRnAJpickCPBvFUthkKbrlr3AsNLrp5yBU=; b=Xep6N6U+ekYjj3xoW8foErT0ecXOohpnZhJfwdI4Re2/EoTKClZV4/SzEm08Ox0Syr oDG/8xRuv++P0GBzPdrzPDmZZUexMNZtKgbBo97vTzV950bmE3TlW8tZLIyC2tscBaCm ROt+O0qXuogi271rUIPXqy2XwFDHmPY0M6oy9D8PxnC/Ez00Po2uyhjD24xoqU0iybnd zepEREBKqYa+RFVYHT1G57U6GVcTFgekhIvlXMTNVbGg2p6OI7yyQMsERtJrkHAk9Q5V Bav0BhQPgdYzlR5OOnspyNshAPM/995Zm9ZICfFlgV0QtFpKjQuHvZkEv/1mXAjw12Ua vA3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TL+CSt5X; 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 t15si5735385edi.243.2020.08.07.09.50.42; Fri, 07 Aug 2020 09:51:05 -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; dkim=pass header.i=@kernel.org header.s=default header.b=TL+CSt5X; 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 S1726058AbgHGQtq (ORCPT + 99 others); Fri, 7 Aug 2020 12:49:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:50744 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725893AbgHGQtm (ORCPT ); Fri, 7 Aug 2020 12:49:42 -0400 Received: from C02YQ0RWLVCF.internal.digitalocean.com (c-73-181-34-237.hsd1.co.comcast.net [73.181.34.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3B073221E2; Fri, 7 Aug 2020 16:49:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596818982; bh=KHVc4rrVB6GP4qW47T9z4oMwM3NEJSyq8XjBsOgInEM=; h=From:To:Cc:Subject:Date:From; b=TL+CSt5XVsQaa6jumRqvwFKl2fIOF64PnjWWi/oqjRlQWW82I5ft1LBIAyP1sq6R7 DdM/eUuAPhNDn9Ch9g953vj3qEM941trBZwcHvlDXHl8F1j57A/Q0afSpR9SvEyXdM s4nT1KnC5ovFX78Un0NGy12Y/I6A1oEFwThisobE= From: David Ahern To: acme@kernel.org Cc: namhyung@kernel.org, linux-kernel@vger.kernel.org, jolsa@kernel.org, David Ahern Subject: [PATCH 2/2] perf sched timehist: Fix use of CPU list with summary option Date: Fri, 7 Aug 2020 10:49:37 -0600 Message-Id: <20200807164937.44921-1-dsahern@kernel.org> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)) + continue; + t = idle_threads[i]; if (!t) continue; -- 2.17.1