From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH v3 perf, bpf-next 1/4] perf, bpf: Introduce PERF_RECORD_BPF_EVENT Date: Thu, 13 Dec 2018 16:25:51 +0100 Message-ID: <20181213152551.GL5289@hirez.programming.kicks-ass.net> References: <20181211233351.4036381-1-songliubraving@fb.com> <20181211233351.4036381-2-songliubraving@fb.com> <20181212131549.GZ5289@hirez.programming.kicks-ass.net> <20181212180553.GC5289@hirez.programming.kicks-ass.net> <3D79DAF3-0746-41A2-B902-E1D99F098AF9@fb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: lkml , "netdev@vger.kernel.org" , "ast@kernel.org" , "daniel@iogearbox.net" , Kernel Team , "acme@kernel.org" , Steven Rostedt To: Song Liu Return-path: Content-Disposition: inline In-Reply-To: <3D79DAF3-0746-41A2-B902-E1D99F098AF9@fb.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Wed, Dec 12, 2018 at 06:56:11PM +0000, Song Liu wrote: > > > > On Dec 12, 2018, at 10:05 AM, Peter Zijlstra wrote: > > > > On Wed, Dec 12, 2018 at 05:09:17PM +0000, Song Liu wrote: > >>> And while this tracks the bpf kallsyms, it does not do all kallsyms. > >>> > >>> .... Oooh, I see the problem, everybody is doing their own custom > >>> kallsym_{add,del}() thing, instead of having that in generic code :-( > >>> > >>> This, for example, doesn't track module load/unload nor ftrace > >>> trampolines, even though both affect kallsyms. > >> > >> I think we can use PERF_RECORD_MMAP(or MMAP2) for module load/unload. > >> That could be separate sets of patches. > > > > So I would actually like to move bpf_lock/bpf_kallsyms/bpf_tree + > > bpf_prog_kallsyms_*() + __bpf_address_lookup() into kernel/kallsyms.c > > and also have ftrace use that. > > > > Because currently the ftrace stuff is otherwise invisible. > > > > A generic kallsym register/unregister for any JIT. > > I guess this is _not_ a requirement for this patchset? BPF program has > special data (id, sub_id, tag) that we need PERF_RECORD_BPF_EVENT. So > this patchset should be orthogonal to the generic kallsym framework? Well, it is a question of ABI. I don't like mixing the kallsym updates with the BPF updates.