From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BF98C07E9B for ; Wed, 7 Jul 2021 13:29:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 258F861C7B for ; Wed, 7 Jul 2021 13:29:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231757AbhGGNcL (ORCPT ); Wed, 7 Jul 2021 09:32:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:35498 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231357AbhGGNcJ (ORCPT ); Wed, 7 Jul 2021 09:32:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4C59160D07; Wed, 7 Jul 2021 13:29:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625664569; bh=5r0H24J6y+tSw0QazP/TcXzQ2gQzcMt1BZjeoEwGo2Y=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Qim8foHGFlqwraQb2h1SwhnqBL0PrPz55T05poQFYYFfBWDm8Efi/22zvSvzea3WI mh7aCRtegrQ2kX0MAvHRbRmXWif3E6OPX4ju1ugXLfrAembNgxRnsgTPQ+b7TarGsG W++BfjV0kgY2VFOapCrQWfg/FkRCa0HTi7Cki9cB5gNtJMJAipww8FVXsKu3bJVhUG 2siWtnfFxS7a7XZhpvdbbWiySiCac1MWWALto4kNGm3Q7+3UQdSMnFpuSBJatrFHLV w52vBtWrhpdQPokt+sbWSYtNlEpgMKdMpbrw4sUB0hZP6rySvZXX9GpFjjaikLsDp+ 3vzC7Uv/8ChCQ== Date: Wed, 7 Jul 2021 22:29:25 +0900 From: Masami Hiramatsu To: Masami Hiramatsu Cc: Peter Zijlstra , Steven Rostedt , Josh Poimboeuf , Ingo Molnar , X86 ML , Daniel Xu , linux-kernel@vger.kernel.org, bpf@vger.kernel.org, kuba@kernel.org, mingo@redhat.com, ast@kernel.org, Thomas Gleixner , Borislav Petkov , kernel-team@fb.com, yhs@fb.com, linux-ia64@vger.kernel.org, Abhishek Sagar , Andrii Nakryiko , wuqiang.matt@bytedance.com Subject: Re: [PATCH -tip v8 11/13] x86/unwind: Recover kretprobe trampoline entry Message-Id: <20210707222925.87ecc1391d0ab61db3d8398e@kernel.org> In-Reply-To: <20210707194530.766a9c8364f3b2d7714ca590@kernel.org> References: <162399992186.506599.8457763707951687195.stgit@devnote2> <162400002631.506599.2413605639666466945.stgit@devnote2> <20210706004257.9e282b98f447251a380f658f@kernel.org> <20210706111136.7c5e9843@oasis.local.home> <20210707191510.cb48ca4a20f0502ce6c46508@kernel.org> <20210707194530.766a9c8364f3b2d7714ca590@kernel.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 7 Jul 2021 19:45:30 +0900 Masami Hiramatsu wrote: > On Wed, 7 Jul 2021 12:20:57 +0200 > Peter Zijlstra wrote: > > > On Wed, Jul 07, 2021 at 07:15:10PM +0900, Masami Hiramatsu wrote: > > > > > I actually don't want to keep this feature because no one use it. > > > (only systemtap needs it?) > > > > Yeah, you mentioned systemtap, but since that's out-of-tree I don't > > care. Their problem. Yeah, maybe it is not hard to update. > > > > > Anyway, if we keep the idea-level compatibility (not code level), > > > what we need is 'void *data' in the struct kretprobe_instance. > > > User who needs it can allocate their own instance data for their > > > kretprobes when initialising it and sets in their entry handler. > > > > > > Then we can have a simple kretprobe_instance. > > > > When would you do the alloc? When installing the retprobe, but that > > might be inside the allocator, which means you can't call the allocator > > etc.. :-) > > Yes, so the user may need to allocate a pool right before register_kretprobe(). > (whether per-kretprobe or per-task or global pool, that is user's choice.) > > > > > If we look at struct ftrace_ret_stack, it has a few fixed function > > fields. The calltime one is all that is needed for the kretprobe > > example code. > > kretprobe consumes 3 fields, a pointer to 'struct kretprobe' (which > stores callee function address in 'kretprobe::kp.addr'), a return > address and a frame pointer (*). Oops, I forgot to add "void *data" for storing user data. Thank you, -- Masami Hiramatsu