From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754385AbbJUL4m (ORCPT ); Wed, 21 Oct 2015 07:56:42 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:39301 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753914AbbJUL4l (ORCPT ); Wed, 21 Oct 2015 07:56:41 -0400 Date: Wed, 21 Oct 2015 13:56:30 +0200 From: Peter Zijlstra To: "Wangnan (F)" Cc: Alexei Starovoitov , Kaixu Xia , davem@davemloft.net, acme@kernel.org, mingo@redhat.com, masami.hiramatsu.pt@hitachi.com, jolsa@kernel.org, daniel@iogearbox.net, linux-kernel@vger.kernel.org, pi3orama@163.com, hekuang@huawei.com, netdev@vger.kernel.org Subject: Re: [PATCH V5 1/1] bpf: control events stored in PERF_EVENT_ARRAY maps trace data output when perf sampling Message-ID: <20151021115630.GO17308@twins.programming.kicks-ass.net> References: <1445325735-121694-1-git-send-email-xiakaixu@huawei.com> <1445325735-121694-2-git-send-email-xiakaixu@huawei.com> <5626C5CE.8080809@plumgrid.com> <20151021091254.GF2881@worktop.programming.kicks-ass.net> <56277844.9090201@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56277844.9090201@huawei.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 21, 2015 at 07:34:28PM +0800, Wangnan (F) wrote: > >If you want to actually disable the event: pmu->stop() will make it > >stop, and you can restart using pmu->start().xiezuo > > I also prefer totally disabling event because our goal is to reduce > sampling overhead as mush as possible. However, events in perf is > CPU bounded, one event in perf cmdline becomes multiple 'perf_event' > in kernel in multi-core system. Disabling/enabling events on all CPUs > by a BPF program a hard task due to racing, NMI, ... But eBPF perf events must already be local afaik. Look at the constraints perf_event_read_local() places on the events.