Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp950408ybg; Mon, 1 Jun 2020 19:49:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcQt5DxqAq7t5nXGmiVDl2BQRM1vCBqb9oV7dXpfPzKGbi/X1SrN/BpaotsIdOT6mKmNCP X-Received: by 2002:a17:906:670d:: with SMTP id a13mr18872798ejp.290.1591066199238; Mon, 01 Jun 2020 19:49:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591066199; cv=none; d=google.com; s=arc-20160816; b=OfqmnzK41MqnUjq70Z2EpccVxKlEBEeTAAUG8MQRgjtL6saVouCZWPGH6OzyZqNNjn dPBiCEkhcSu31GN1B7izsaOOFWnlvqrwUMx3/O+06JdqZAcCLOmr4USYsEUHJ7bboftU NvctDwqdzLQXwJ276DpHnr1oxkcL9huCzcUPDoN86UijZwJTp+zDqoLjBi5LI/G4HXBv +7nalzQeCo5q6tvCeecbv8Dkq0Gu+JwenWl7z/iEMbxL0YV8NJtNmEe9el+21WkVzv8m KW69xL3jWuLidqQ95gTElNO9YKjL/9JPsJ2uH8Zc4ZGE4bzTtbsL2Jg8cFUbbRBq+b/K FfWA== 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=erjAI2JPHijWEZ2WbZhv+07BB2LF2XoxFe7c2aYCT4U=; b=STn7Zw7NhmCEhGNQLwgykYnxxrMUqzR//ghgPiDg/AaOHU37GaJk6EA/XPuCo2jvSh hy5yUpR7DWosWZN/rBASSqjA5+VD92ArLf6mbgdrCh7sM2UVxCj5lV3tkgXcBTmLHyzf y8ydDudzraQ23hpqa+1qkOVByEUkzFYQDYbXbysDwAhjcF6PELIkRyFZzFWD1uutEXxU bV7N2nRhUcjfRSCbnYM0R7Rh/zuNX+RHl1nxG6HhylGVnqDuUbhFMaltuEnqVdgl1N3W 5EAusgk9r112ExIlLMnVzcFqCkl3eyMnITXVJFvU53+v6xBBZ6hw/UtavJw8YTJXCvu/ rkkQ== 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 a9si779954edm.76.2020.06.01.19.49.35; Mon, 01 Jun 2020 19:49:59 -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 S1725921AbgFBCrd (ORCPT + 99 others); Mon, 1 Jun 2020 22:47:33 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:38254 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725826AbgFBCrc (ORCPT ); Mon, 1 Jun 2020 22:47:32 -0400 Received: by mail-wm1-f65.google.com with SMTP id f185so1481711wmf.3 for ; Mon, 01 Jun 2020 19:47:31 -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=erjAI2JPHijWEZ2WbZhv+07BB2LF2XoxFe7c2aYCT4U=; b=jOW+x4tMOElPYA9j7v66vLCgsyW66FUxIBRlAOEHhDF8ZhRcKIp/8qo3ycYhQwNXld jZnXSyAl4siLRWQVDuMWtbvgJ2rr8DvdjEc7BidgmqHUtPaUaTsmBqyOA36zv0dUv6zQ kgRbQ7FMSyelOs8uhFsOWbQiHAbGJPuu90lGSqE+4RhsyLq6tu+sjRoqJnuZGJ3O7wki ZQkQ2jNC8cQUtmSCQb/msNvKYrdvvqhl3h/HILmNovAZYqE4jfxEZqV79WKJBCvLfkAA bJeEthEAfQpTCUhsoKnP2EhNch7qrYmHeULutkHg7dTiifwVY8AjZA0gtkJMXgADJjNF q7Zg== X-Gm-Message-State: AOAM532NtE0doyAgTctP7DBIRqpI3QYyksqZYQJZxfw+O8e8XU/V0Jm+ Bq1TepA+S2XslSKEIYVNge9HT+5EI7WhhcZdBzU= X-Received: by 2002:a05:600c:280c:: with SMTP id m12mr2089590wmb.92.1591066050876; Mon, 01 Jun 2020 19:47:30 -0700 (PDT) MIME-Version: 1.0 References: <20200531162206.911168-1-jolsa@kernel.org> <20200601082027.GF881900@krava> In-Reply-To: From: Namhyung Kim Date: Tue, 2 Jun 2020 11:47:19 +0900 Message-ID: Subject: Re: [PATCHv2] perf stat: Ensure group is defined on top of the same cpu mask To: Ian Rogers Cc: Jiri Olsa , Jiri Olsa , Arnaldo Carvalho de Melo , Jin Yao , lkml , Ingo Molnar , Alexander Shishkin , Peter Zijlstra , Michael Petlan , Stephane Eranian , Andi Kleen 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 Tue, Jun 2, 2020 at 1:21 AM Ian Rogers wrote: > > On Mon, Jun 1, 2020 at 1:20 AM Jiri Olsa wrote: > > > > Jin Yao reported the issue (and posted first versions of this change) > > with groups being defined over events with different cpu mask. > > > > This causes assert aborts in get_group_fd, like: > > > > # perf stat -M "C2_Pkg_Residency" -a -- sleep 1 > > perf: util/evsel.c:1464: get_group_fd: Assertion `!(fd == -1)' failed. > > Aborted > > > > All the events in the group have to be defined over the same > > cpus so the group_fd can be found for every leader/member pair. > > > > Adding check to ensure this condition is met and removing the > > group (with warning) if we detect mixed cpus, like: > > > > $ sudo perf stat -e '{power/energy-cores/,cycles},{instructions,power/energy-cores/}' > > WARNING: event cpu maps do not match, disabling group: > > anon group { power/energy-cores/, cycles } > > anon group { instructions, power/energy-cores/ } > > > > Ian asked also for cpu maps details, it's displayed in verbose mode: > > > > $ sudo perf stat -e '{cycles,power/energy-cores/}' -v > > WARNING: group events cpu maps do not match, disabling group: > > anon group { power/energy-cores/, cycles } > > power/energy-cores/: 0 > > cycles: 0-7 > > anon group { instructions, power/energy-cores/ } > > instructions: 0-7 > > power/energy-cores/: 0 > > This is great! A nit, would 'grouped events cpus do not match' read > better? I think the cpu map is more of an internal naming convention. Allowed cpus? Thanks Namhyung