From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from www62.your-server.de ([213.133.104.62]:43533 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750779AbeCNRj2 (ORCPT ); Wed, 14 Mar 2018 13:39:28 -0400 Subject: Re: [PATCH bpf-next v6 1/2] bpf: extend stackmap to save binary_build_id+offset instead of address To: Song Liu , "netdev@vger.kernel.org" , "ast@kernel.org" , "peterz@infradead.org" Cc: Kernel Team , "hannes@cmpxchg.org" , Teng Qin References: <20180314172323.3957483-1-songliubraving@fb.com> <20180314172323.3957483-2-songliubraving@fb.com> <15D381AB-87EE-4056-A5E1-9BF588710801@fb.com> From: Daniel Borkmann Message-ID: <1f960b89-e8ef-7117-ac48-ec9a4159db84@iogearbox.net> Date: Wed, 14 Mar 2018 18:39:26 +0100 MIME-Version: 1.0 In-Reply-To: <15D381AB-87EE-4056-A5E1-9BF588710801@fb.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org List-ID: On 03/14/2018 06:36 PM, Song Liu wrote: >> On Mar 14, 2018, at 10:23 AM, Song Liu wrote: >> >> Currently, bpf stackmap store address for each entry in the call trace. >> To map these addresses to user space files, it is necessary to maintain >> the mapping from these virtual address to symbols in the binary. Usually, >> the user space profiler (such as perf) has to scan /proc/pid/maps at the >> beginning of profiling, and monitor mmap2() calls afterwards. Given the >> cost of maintaining the address map, this solution is not practical for >> system wide profiling that is always on. >> >> This patch tries to solve this problem with a variation of stackmap. This >> variation is enabled by flag BPF_F_STACK_BUILD_ID. Instead of storing >> addresses, the variation stores ELF file build_id + offset. >> >> Build_id is >> only meaningful for user stack. If a kernel stack is added to a stackmap >> with BPF_F_STACK_BUILD_ID, it will automatically fallback to only store >> ip (status == BPF_STACK_BUILD_ID_IP). > > I forgot to delete the paragraph above. Please let me know if I should > resend (or it can be removed when you apply it). We can fix it up when applying, no problem. Thanks, Daniel