Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp666435pxf; Thu, 8 Apr 2021 10:21:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuxGPUdp5TcIiA1QR/aFessHqo0pCRDdEIYSfgWZI8hq+/52I9p6qFnPecM4j0rjDC5hIS X-Received: by 2002:a17:90b:4a50:: with SMTP id lb16mr9329031pjb.229.1617902494953; Thu, 08 Apr 2021 10:21:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617902494; cv=none; d=google.com; s=arc-20160816; b=oZa9DqcwpvycxYIUYCihZ+lq9+xXZzapQ/zKNClUxKPyqkHe6HDgNNQf4o8fR10NhS NA8F2BlbDKGX38Pqh7xwh/Qfyr6un6s0iz7crPNLQ+ut3Z9GQ1RV0CV8xxfhrzh1NYB4 9fBK7/mWABV3hya4IIlHpfG/ew2x88gK6OYXYq7xnHGSQmlAduS0Tz/mjZLWtoUbhxiN q99zV3bL5m7TivL6ijn/+2IWK/m+Fita+bavAqQ5pCE6WukuGzUUCrhm25mLAsCJASDS 2+CqibGZWyyMSexnJ/Es+vKyYmhb1sMpEKVfBumb61+PVJWOuSAlwQ8ppimMd7TXbrGv nvfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6jeo6RKyoMM+BFp8BXR0dyWtTRsTbouoZgex95KJOQY=; b=T4SQw9ynrpbSta1gXJRQ0NX1p5Lzijle85vpdMHboeiDqe4qLm1u1RJ3et0kl5s0l7 lIaHMgUZWOP0E0WcOUli0LdCAE0cKw0ct8GObi0mpNkZ8qIVHMTqhYSVwztExVU4fiut smPJosCt+8QVTOKAs9z1BEFYMplwrfzOSLNZ5yHissmUUHJLrJHUIlGXvnCOPw1ql4M2 VjCHBMFIx8jAHM1XiCv/dNbdjyDomCS6B2VOU8VT1mOb1frgsoOE9LWCQUblnFwAiWEh cSpDT8hqPgDvTFMFtZx+22q90v8dE/mXXh5jHrdFyHRamEr0WvpLdl51H4k+x4dU8kHC jx/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XV2RFJu0; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c17si28502386pgw.87.2021.04.08.10.21.21; Thu, 08 Apr 2021 10:21:34 -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=@redhat.com header.s=mimecast20190719 header.b=XV2RFJu0; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232636AbhDHRUr (ORCPT + 99 others); Thu, 8 Apr 2021 13:20:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:51230 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232377AbhDHRUl (ORCPT ); Thu, 8 Apr 2021 13:20:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617902429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6jeo6RKyoMM+BFp8BXR0dyWtTRsTbouoZgex95KJOQY=; b=XV2RFJu0Dv2M4pK+gJUh6LURnz2fUwf1LhZLfXRIrx5G1pvNtgxvX+FIA7UzZpqtQ9dw0D BSy0TxnsS6tVkeSbPT0AA1WOO1VbUlZH3kUeO7UcaZemX/W+ytZlSrZzkYjy4BMe1Lva2B c1CPyvVK1EClJLvTsc4+F+0FHPBa1Sw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-196-ZGcIYKeXPiCkehacnwyJSA-1; Thu, 08 Apr 2021 13:20:25 -0400 X-MC-Unique: ZGcIYKeXPiCkehacnwyJSA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8535D1B18BC0; Thu, 8 Apr 2021 17:20:23 +0000 (UTC) Received: from krava (unknown [10.40.192.110]) by smtp.corp.redhat.com (Postfix) with SMTP id D15F510013C1; Thu, 8 Apr 2021 17:20:21 +0000 (UTC) Date: Thu, 8 Apr 2021 19:20:20 +0200 From: Jiri Olsa To: Song Liu Cc: Song Liu , open list , Kernel Team , Arnaldo Carvalho de Melo , Arnaldo Carvalho de Melo , Namhyung Kim , "jolsa@kernel.org" Subject: Re: [PATCH v2 3/3] perf-stat: introduce config stat.bpf-counter-events Message-ID: References: <20210407003601.619158-1-song@kernel.org> <20210407003601.619158-4-song@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 08, 2021 at 04:39:33PM +0000, Song Liu wrote: > > > > On Apr 8, 2021, at 4:47 AM, Jiri Olsa wrote: > > > > On Tue, Apr 06, 2021 at 05:36:01PM -0700, Song Liu wrote: > >> Currently, to use BPF to aggregate perf event counters, the user uses > >> --bpf-counters option. Enable "use bpf by default" events with a config > >> option, stat.bpf-counter-events. This is limited to hardware events in > >> evsel__hw_names. > >> > >> This also enables mixed BPF event and regular event in the same sesssion. > >> For example: > >> > >> perf config stat.bpf-counter-events=instructions > >> perf stat -e instructions,cs > >> > > > > so if we are mixing events now, how about uing modifier for bpf counters, > > instead of configuring .perfconfig list we could use: > > > > perf stat -e instructions:b,cs > > > > thoughts? > > > > the change below adds 'b' modifier and sets 'evsel::bpf_counter', > > feel free to use it > > I think we will need both 'b' modifier and .perfconfig configuration. > For systems with BPF-managed perf events running in the background, hum, I'm not sure I understand what that means.. you mean there are tools that run perf stat so you don't want to change them? > .perfconfig makes sure perf-stat sessions will share PMCs with these > background monitoring tools. 'b' modifier, on the other hand, is useful > when the user knows there is opportunity to share the PMCs. > > Does this make sense? if there's reason for that then sure.. but let's not limit that just on HARDWARE events only.. there are RAW events with the same demand for this feature.. why don't we let user define any event for this? jirka