Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3982857pxb; Mon, 4 Oct 2021 14:23:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjsGO8R+c9MVI2Nadg14JfkkXzeoYBm9qjJaOHK1yXJ8deSif2r6TRwDGyzhNC5H/3clKZ X-Received: by 2002:a17:90a:9f91:: with SMTP id o17mr19398500pjp.225.1633382601754; Mon, 04 Oct 2021 14:23:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633382601; cv=none; d=google.com; s=arc-20160816; b=n3cwg9WNm1yvfpctNGrwRSjwr2WMmOsioSsVnRkLBJMVC8hOwL7Zw+mt1ea3KNeVmL 41KZAsbMQxDEeVCQLWPIe/AHTbFXduyf+b69dCzf73sF3xh/HqtN39kV6+gpKAqGC49L u2/Iu6vsxKDHcFxuuCyStxndl8HfMn2H2kf8q2jAYz6UOwFpNI6o3BDBV8bR7JzWeQ76 rfwwHUzXLJmL/PKtWUpcBduRLC349uZo0hkX9Lz0Hyux0s3b/JQ7NVSgU1j4It0BgoB9 MnKxtrXfcbo/ClnNkSDN8xrYV8azZnuSC54OQuTyvGJkFkGGwcAZKqehVf2zBUj85fok 82qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/egGFBWNWj4tqI6nWJHTg+f+4cESRLyqmT6XFvHQ8oc=; b=jSOjGMzyOQJeIsNa4r8RLx6Dyw11Nw+LD+Iu4VMbmKmROPmnlKqz8pyEiS6eNqn6iY X35qi+SvrghYyAZN6aoIZRXgatBu+ma2xdQ/eefAV2nLj/SCM5vPxGpCU0or5giwPyCy CPgvSyosrdEoXGM3+1yNWW2HDKV5mBKS+vwC9PxVbyEmPHgDxgEJIvV/eKTItNFtdgtz WOZfT8FaTOPyJQabBE/XBjQG5x7uh/9lm91IHcvHGPu8hsN8YERzjTD6os3Ls+R7RlM4 dU3OsokECvLDdVSWA9lk7JWiGimTpi4mq/N9rtZVlsKMoUwSiFL8+123GtbtI31dkbdd ZDmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=K0CtpAij; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h3si21872854plk.427.2021.10.04.14.23.08; Mon, 04 Oct 2021 14:23:21 -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=@linuxfoundation.org header.s=korg header.b=K0CtpAij; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237001AbhJDNb0 (ORCPT + 99 others); Mon, 4 Oct 2021 09:31:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:42574 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237223AbhJDN30 (ORCPT ); Mon, 4 Oct 2021 09:29:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A845463156; Mon, 4 Oct 2021 13:13:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633353192; bh=syoi54lLnqYHCtaom7LtCHJmFpzpOzVVYJp+F4xZI9U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K0CtpAijW/9W6wP8JHwBNCNsOjNUqD64qIvME4/bRIlrU43skeuxBvGDx7MLzYTnf 4MLkHQl/RE2R06YZQ4mSNKFTBy07MgqwNx+y6AGETpYNjVJZwQ7iup3APXSQGZwpu7 7U8IYAzslUus7daZ6UXNhjyB0ByV3DtVqWmWUEa0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Like Xu , Alexander Antonov , Alexander Shishkin , Ian Rogers , Jiri Olsa , Mark Rutland , Namhyung Kim , Peter Zijlstra , Stephane Eranian , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 5.14 024/172] perf iostat: Use system-wide mode if the target cpu_list is unspecified Date: Mon, 4 Oct 2021 14:51:14 +0200 Message-Id: <20211004125045.744239612@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004125044.945314266@linuxfoundation.org> References: <20211004125044.945314266@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Like Xu [ Upstream commit e4fe5d7349e0b1c0d3da5b6b3e1efce591e85bd2 ] An iostate use case like "perf iostat 0000:16,0000:97 -- ls" should be implemented to work in system-wide mode to ensure that the output from print_header() is consistent with the user documentation perf-iostat.txt, rather than incorrectly assuming that the kernel does not support it: Error: The sys_perf_event_open() syscall returned with 22 (Invalid argument) \ for event (uncore_iio_0/event=0x83,umask=0x04,ch_mask=0xF,fc_mask=0x07/). /bin/dmesg | grep -i perf may provide additional information. This error is easily fixed by assigning system-wide mode by default for IOSTAT_RUN only when the target cpu_list is unspecified. Fixes: f07952b179697771 ("perf stat: Basic support for iostat in perf") Signed-off-by: Like Xu Cc: Alexander Antonov Cc: Alexander Shishkin Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20210927081115.39568-1-likexu@tencent.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/builtin-stat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 634375937db9..36033a7372f9 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -2406,6 +2406,8 @@ int cmd_stat(int argc, const char **argv) goto out; } else if (verbose) iostat_list(evsel_list, &stat_config); + if (iostat_mode == IOSTAT_RUN && !target__has_cpu(&target)) + target.system_wide = true; } if (add_default_attributes()) -- 2.33.0