Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1508411pxf; Fri, 19 Mar 2021 08:37:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDmn43S5B/FQwgmv+/qSQdFJ+YSHEdSz0gMvh/sN++1tSJMg6PeFqjYU+i5vhPhCVLgTJB X-Received: by 2002:a05:6402:3049:: with SMTP id bu9mr10467564edb.104.1616168219883; Fri, 19 Mar 2021 08:36:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616168219; cv=none; d=google.com; s=arc-20160816; b=zmpgx9Xr59xPYND93Aj5cCBzp2gBE4dTpaZv872UgSGLLzxWAjTbY/c+jsyxCHBMkj vW78F0ZMF3RNkSUCNP8CzPN895vVsbs3PbT4IyWryPE5reZjy0h4JbuhLWGWrf3K2vrR ul/xif8lWWzHHZEx+o5ot4I+u36zVIb2Okp/avv3jt1As0TBr4yS81enP1I6Dkj6kaHr NNkAn1JlmBsf14cyQpoBYud8yC32tiuGpwxbhnaMG10yw12Jn6bVqn70HB/NHW57mc5W upLxb5K89CR/Z3X6OVw2TGz1Z9gy7s+3RHL07gjk7ewTh1NUGmqk7sMbUdliEMc2AE9e 8t6w== 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=7tuI4mXL9arhCDhe1ms7Eloty/EnrnbuzDqr5IQ0zPg=; b=g0PSVZBI8NRpnVYG0+uLnwIBOf1MnAW0GuOXFlVRph8p59iDA16k9km+e7kL9loGJi 292RCUrGgHimBVbhQ0Hc+LTBHWYxDLFvsXJlTj9GhmHO5rqgEUQkm0nX6+eh6eDVQh3n I5XK0b2Hi/2P2L5H/D3hh7nSqdZZ1eHjep6iL5vGNBAYgrzIIGxGEM7k0pnoiOfHA245 SWOaJEcebS/TYizTriJW3EbG7FmuHa+kOIsrVpPHSmxuPGEBfJxkbAi2lput/3G8Ex/r qK+ew8F4Bs7jIt1p5lWLrD2SMrfFPD989VoQ5abSlZVUeOK6KtC422fTW5s/O+KezmRJ 6Qxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="XnJ/4Rxp"; 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 mm23si4400090ejb.540.2021.03.19.08.36.36; Fri, 19 Mar 2021 08:36: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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="XnJ/4Rxp"; 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 S230119AbhCSPfj (ORCPT + 99 others); Fri, 19 Mar 2021 11:35:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:52708 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230241AbhCSPfP (ORCPT ); Fri, 19 Mar 2021 11:35:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9977B61939; Fri, 19 Mar 2021 15:35:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616168114; bh=pgU2KS1nOWcO/GtvyYFLP0IuVFfh+X+AIjuK5boE+C0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XnJ/4RxpZp1LQPH/lkvi6MNu0KeHMQywtvsJzdKga46/nshuN37NoPuxSixQzC/mt R4k/qryfgGEdpJMQf0NZKVb14H7HAIVO9LzSGkkQZ490d+OoJIxMfj0+fw5sdmlTHW CUu5qZhXsOZaOxKOBObdtWEeAoZWfwMCtzHWYmLiB5IEhpqpbYGq9URLOIrUFMpaHJ 8WGCNGp+xkSwK/gfHOXdTV7GUhRkQudKW8yJwJWjNzUeVxdlGLeuZNsWBwkospGeus jYOVMpapZpX15LWFyWhKG+Gv08/MRlbbgyEmbUD8W3/C9qL/DQs7KdZMAeVbUw/5m1 o7AysMtOr1yjQ== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 22C8740647; Fri, 19 Mar 2021 12:35:12 -0300 (-03) Date: Fri, 19 Mar 2021 12:35:12 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Song Liu , Jiri Olsa , linux-kernel , Kernel Team , Jiri Olsa Subject: Re: [PATCH v2 0/3] perf-stat: share hardware PMCs with BPF Message-ID: References: <20210316211837.910506-1-songliubraving@fb.com> <7D48A756-C253-48DE-B536-826314778404@fb.com> <388AF530-5176-4DB9-93C4-6C302432CE12@gmail.com> <3E65B60E-B120-4E1A-BAF2-2FAEF136A4CD@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, Mar 19, 2021 at 09:54:59AM +0900, Namhyung Kim escreveu: > On Fri, Mar 19, 2021 at 9:22 AM Song Liu wrote: > > > On Mar 18, 2021, at 5:09 PM, Arnaldo wrote: > > > On March 18, 2021 6:14:34 PM GMT-03:00, Jiri Olsa wrote: > > >> On Thu, Mar 18, 2021 at 03:52:51AM +0000, Song Liu wrote: > > >>> perf stat -C 1,3,5 107.063 [sec] > > >>> perf stat -C 1,3,5 --bpf-counters 106.406 [sec] > > >> I can't see why it's actualy faster than normal perf ;-) > > >> would be worth to find out > > > Isn't this all about contended cases? > > Yeah, the normal perf is doing time multiplexing; while --bpf-counters > > doesn't need it. > Yep, so for uncontended cases, normal perf should be the same as the > baseline (faster than the bperf). But for contended cases, the bperf > works faster. The difference should be small enough that for people that use this in a machine where contention happens most of the time, setting a ~/.perfconfig to use it by default should be advantageous, i.e. no need to use --bpf-counters on the command line all the time. So, Namhyung, can I take that as an Acked-by or a Reviewed-by? I'll take a look again now but I want to have this merged on perf/core so that I can work on a new BPF SKEL to use this: https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/log/?h=tmp.bpf/bpf_perf_enable :-) - Arnaldo