Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1333150pxx; Tue, 27 Oct 2020 14:11:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDm3p2HuPFllNZraBkM1vykzW5BuHPgfc3Kb/79w4VU+qFdJzdMm+x339UndF5h9OzAMty X-Received: by 2002:a05:6402:b72:: with SMTP id cb18mr4249388edb.129.1603833111418; Tue, 27 Oct 2020 14:11:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603833111; cv=none; d=google.com; s=arc-20160816; b=ePiaMCIrmJBl7DFMhlaDSR8srG7A+QYh6ExnGuTItiZMD1l1NuSJM6XfJI/HV1Qayz slTrUnaYFgI2vt3YOcclhXd8/7mBaZ63/07JLvHvxK4Jhu13h+CWXAJt0Z4cxQCc1p0j M0Sdzh4MyYYdZ2Vc1jz3fm2v+RdEdqHswk+fnjPAd3lEkm85Vy5K954qEihZGB0AxaTe QC3WkYCwqWLXUBvjb87gKOYfGvKx53Nw9QYZ+YzuSnN0lOhP4QsL7rELip0sBS1XD2dO nBn78l0TowEULq9t7iWp5sNEoJ8o26zPIfoJdI/rLs7LIYNyRIxkiKBMXD4i6ZQzQGqR Px2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=xmAyLEcR2tdPTiT4aGYBK9tERH8lFFNxrJCHCsIMZek=; b=x47jw2hCjlfKQ8nh+gUQXjwiYmPtbDsYxm8kGatgZQZUWxU6YgGO34ZhDs47J4DwXa DxIXtEJY4Jv5Iotki1MgZww8qbTViQD1kwnYvmUMvSG+lZM81qaYrXh3VJdJ226X7OaU lrDpeEv6H++xmTiHILa/6aU0uB0HaUgpV/gLUosDa9yq3QUDlQfMVklqs4MUmndMKXuk MI5AGn2kbNq/lsYBf5bJvSbaswxPyf2ka0isbX8CLiPtwNw7tVnC3Ova6dnAEx15EJMm vLdJEAqwowhX0DTz/BDEYHwosEOa4IwYUzJHn0xTbK1BEYkrsM0t458oode1E4mcVo75 6XFA== 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 sa27si1881481ejb.546.2020.10.27.14.11.29; Tue, 27 Oct 2020 14:11:51 -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 S2501998AbgJ0Ep4 (ORCPT + 99 others); Tue, 27 Oct 2020 00:45:56 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:44622 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2501914AbgJ0Epz (ORCPT ); Tue, 27 Oct 2020 00:45:55 -0400 Received: by mail-wr1-f67.google.com with SMTP id t9so326519wrq.11 for ; Mon, 26 Oct 2020 21:45:54 -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=xmAyLEcR2tdPTiT4aGYBK9tERH8lFFNxrJCHCsIMZek=; b=Oa4mAtCh715j6TkUy+/uY+u2lK3mewQqLVECqIWZiBXDVmSf757P+GmD9J1qKjPbPF hAZNWj3DalSNuczA2DxQ1L6RwHUyF11hFSU/Mm7nGUuuHn9A2HmXPbxg9c5jRjQaJPmK 9hfMSYT9MHu8vLNVpyRU9rHCZYMHRDZ/ujvzN/kSx9l6HhN4tNltim5V4rK0rXwjtSl9 VwU7qFvQc8u23nO1Qt1WLuoRMvBdX06wcn5c3gz4OCVXniG2Msj7Po+udSmHPWdfxs2t zf+rjYxt1TLTaOVMS8cU6qCKQFDO8cqoc1FkIkSgnQ/OmEyd0XGdCDW52czLctadHCKG QhkA== X-Gm-Message-State: AOAM531QufFh8XViyLP+/MS+rpCGtEfMuC6AObuBjpU9BIFF7ypqt2Ai iSgi6JGsw/Z805ozWl+O1FzCsJFAUAZDFZdbid4= X-Received: by 2002:adf:a553:: with SMTP id j19mr417267wrb.349.1603773953952; Mon, 26 Oct 2020 21:45:53 -0700 (PDT) MIME-Version: 1.0 References: <20201026141937.582087-1-namhyung@kernel.org> <20201026152108.GW466880@tassilo.jf.intel.com> <87y2jtq970.fsf@ashishki-desk.ger.corp.intel.com> In-Reply-To: <87y2jtq970.fsf@ashishki-desk.ger.corp.intel.com> From: Namhyung Kim Date: Tue, 27 Oct 2020 13:45:43 +0900 Message-ID: Subject: Re: [RFC] perf evlist: Warn if event group has mixed sw/hw events To: Alexander Shishkin Cc: Andi Kleen , Arnaldo Carvalho de Melo , Jiri Olsa , Peter Zijlstra , Ingo Molnar , Mark Rutland , LKML , Stephane Eranian , Ian Rogers Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tue, Oct 27, 2020 at 12:49 AM Alexander Shishkin wrote: > > Andi Kleen writes: > > > On Mon, Oct 26, 2020 at 11:19:37PM +0900, Namhyung Kim wrote: > >> This patch just added a warning before running it. I'd really want to > >> fix the kernel if possible but don't have a good idea. Thoughts? > > > > The easiest fix would be some multi threading in perf stat opening, then then > > extra latencies could be mostly hidden. One thread per group would probably > > be overkill, but just a few threads would lower the penalty significantly. > > > > I think that would be better than this patch and it's likely not that much > > more complicated, as this is already a lot of code. > > > >> +{ > >> + const char *known_sw_pmu[] = { > >> + "software", "tracepoint", "breakpoint", "kprobe", "uprobe", "msr" > > > > That's a non scalable approach. New pmus get added regularly. It would be better to > > indicate this in a generic way from the kernel. > > That, and also, intel_pt is a software PMU and a few of its features > depend on intel_pt/.../ being a group leader. Thanks for the info, that's good to know. So do you mean intel_pt requires other HW events in the same group? Thanks Namhyung