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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 DD61EC07E9B for ; Wed, 7 Jul 2021 10:21:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B54D86008E for ; Wed, 7 Jul 2021 10:21:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231300AbhGGKYA (ORCPT ); Wed, 7 Jul 2021 06:24:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231137AbhGGKX7 (ORCPT ); Wed, 7 Jul 2021 06:23:59 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60956C061574; Wed, 7 Jul 2021 03:21:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=8Bz/yO9KCbr0wl/w1meI8HRfwaKExJhduf42tQGjlNY=; b=jsE0yDDvkwoazgfq0gwSY0ybBX 8ZHB+cTjzhjEmQyInW9YCXgIC7AQ+7hnqZddXthRy2GooOIpqHFsWrPeLTHxQg5W4LQMDcE02gSxg 2LE4g0KH4/48rnFVv80EIo9JjyBZ8cc+xSyoRQognTwFFn4l+Q0levcQOtvtcTGVlefWFRnFWu2nq geNts06LEyQIpsV4BrUhgewFI88lKAjZ9PPyDqL3epENQQojKi+hS9KeK+xBBR2ltDwjogRK8+6LE jOCHSJr90fuK4hwu8OkkMAzFuIu9kEmBK1i2JfM1biT4c0MtL/jY9wDNa8WPfTaVL/r/QBA2Czr8i wdesLoEg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1m14fq-00FKCQ-Sm; Wed, 07 Jul 2021 10:20:59 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id CBD2530007E; Wed, 7 Jul 2021 12:20:57 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id B66D82019D9F8; Wed, 7 Jul 2021 12:20:57 +0200 (CEST) Date: Wed, 7 Jul 2021 12:20:57 +0200 From: Peter Zijlstra To: Masami Hiramatsu Cc: 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: References: <162399992186.506599.8457763707951687195.stgit@devnote2> <162400002631.506599.2413605639666466945.stgit@devnote2> <20210706004257.9e282b98f447251a380f658f@kernel.org> <20210706111136.7c5e9843@oasis.local.home> <20210707191510.cb48ca4a20f0502ce6c46508@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210707191510.cb48ca4a20f0502ce6c46508@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > 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.. :-) 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. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Date: Wed, 07 Jul 2021 10:20:57 +0000 Subject: Re: [PATCH -tip v8 11/13] x86/unwind: Recover kretprobe trampoline entry Message-Id: List-Id: References: <162399992186.506599.8457763707951687195.stgit@devnote2> <162400002631.506599.2413605639666466945.stgit@devnote2> <20210706004257.9e282b98f447251a380f658f@kernel.org> <20210706111136.7c5e9843@oasis.local.home> <20210707191510.cb48ca4a20f0502ce6c46508@kernel.org> In-Reply-To: <20210707191510.cb48ca4a20f0502ce6c46508@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Masami Hiramatsu Cc: 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 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. > 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.. :-) 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.