From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757355AbdJKQkz (ORCPT ); Wed, 11 Oct 2017 12:40:55 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:59220 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752077AbdJKQkx (ORCPT ); Wed, 11 Oct 2017 12:40:53 -0400 Date: Wed, 11 Oct 2017 18:40:48 +0200 From: Peter Zijlstra To: zhouchengming Cc: rostedt@goodmis.org, mingo@kernel.org, linux-kernel@vger.kernel.org, jolsa@kernel.org Subject: Re: [PATCH 2/4] perf/ftrace: Fix function trace events Message-ID: <20171011164048.v6fxp56kofzb4hfb@hirez.programming.kicks-ass.net> References: <20171011074528.764500836@infradead.org> <20171011080224.257804988@infradead.org> <59DDDE24.5050909@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <59DDDE24.5050909@huawei.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 11, 2017 at 05:02:28PM +0800, zhouchengming wrote: > On 2017/10/11 15:45, Peter Zijlstra wrote: > > + if (!(flags& PERF_EF_START)) > > + p_event->hw.state = PERF_HES_STOPPED; > > Don't we need to check the flags for ftrace perf_event? > So if we should put this outside the if (!tp_event->class->reg()) ? Oh, right you are, that's independent of the hlist nonsense. > > + list = this_cpu_ptr(pcpu_list); > > + hlist_add_head_rcu(&p_event->hlist_entry, list); > > + } > > Now we don't add perf_event to the pcpu_list, so we also can avoid > to alloc pcpu_list for function tp_event in perf_trace_event_reg(). Yeah that allocation is superfluous, Not entirely sure how to cleanly get rid of that though; that's another web to untangle.