Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp874953pxb; Tue, 1 Feb 2022 12:12:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJzsr2IKqlFCzY8KVVXaYHsQRA8DLyuzPlRcMtykca5C2s61f+5zYbgfoDLkMJ/YMrC6S9J2 X-Received: by 2002:a05:6a00:140d:: with SMTP id l13mr26340217pfu.22.1643746360881; Tue, 01 Feb 2022 12:12:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643746360; cv=none; d=google.com; s=arc-20160816; b=M4PPC5ifk6uciX7vdnBQLt2nuneoiVZ1hbB7TZLoksMcE0srK7UCySFWGg8j8o+Fbh M9APwbfYDv0DrGteQYSPOlEboaB9TL5vLQMLDQb+uKqKbdjLP3/vRtvi9rd315TufWbo wfU9+dE2FbPCdNU3XncNda7WUBySLAdgFIx1z1aTrxUt1J7ztjyH0N+CrkOGL9i+Frv/ 6mwlBs+WSP5+ta5kGRRtGaZsyJw4IFDmeX4/1JMOpOsS3UIope8wPZYRxPuHU3Ra4B6K rHuMhAdgoR2RLO6I2bnAIUhoErkLsxUkasQvf9YnWbmm6NfqWHLwmOdgGop8gubKTHXN 3H1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hoFYGfluPusdpIx0z7ulqarblavPkRMbOpbOY+hsnMc=; b=uNA1ZafEzjVyhTMTn3YiIj9/ZUIXVz5RwA0ON4txb52L0svtnIlMvOb//PstBAS3NB grjx39qavLut7NiGOZAaWtJdnzwDSOI1s+gKUgqFUxq1DKSre9nVJfvC24gGwEohotLo o85HmGuO7JC7FYKz3LDM4KZVk/ICM4V1JMHQJhgQSs2CCRqSP7p9SgCf/1yGnOXaStZ2 DAC/anQHU7ZZHpgeUAWrsevYqzxKyso3JQ43N78rfTEN/NRoc8YOYnPFPLVkmBkPE/jg KVoYdnHCi06Bc8/e4Q0ocTm5vizCy87KKTUDMKSqI2G7ATntZb+XcrB1llcAKy6WxZjC 5jJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MV737yRD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d9si16911521pgd.841.2022.02.01.12.12.29; Tue, 01 Feb 2022 12:12:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MV737yRD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377963AbiAaLwL (ORCPT + 99 others); Mon, 31 Jan 2022 06:52:11 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:20535 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380480AbiAaLpe (ORCPT ); Mon, 31 Jan 2022 06:45:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643629533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hoFYGfluPusdpIx0z7ulqarblavPkRMbOpbOY+hsnMc=; b=MV737yRD1x/d8P8JQ1cDvzQJ6y0CKGxZMuhHOQwDKfvhfWoNTa+1KdU0p8czjKWh7kkLuq mXFURA07tN6Qzrnumv7/QY2qQLx9/NxBMRogFPUQ+yJ9NPPpQ4GAlxgd4Yuq+YFtUsTwN/ Bkk4GsMl4wpGEFXdzyt7+djx4kb8cI0= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-662-mWmEK7ZDOFKaiZvBFMUGqQ-1; Mon, 31 Jan 2022 06:45:32 -0500 X-MC-Unique: mWmEK7ZDOFKaiZvBFMUGqQ-1 Received: by mail-ej1-f70.google.com with SMTP id k16-20020a17090632d000b006ae1cdb0f07so4884380ejk.16 for ; Mon, 31 Jan 2022 03:45:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=hoFYGfluPusdpIx0z7ulqarblavPkRMbOpbOY+hsnMc=; b=x+eBjHeOSLETEF6DstVLVf8RLofzU9S4dYZqnkq0h4AAp7Okw9IKwyufGZ8rSQGMmN 1ysp+Y3XFcwTK0EzRMawScaJdF2zGD1m5Ty2aY5Xu6gpAgHX7GmQwohexiusMo+8miUa 7SwlPKXFQqPkb/Oxl06x31bAxobGXm8Aav+I5/PYDiD/39Kzfd/1TYVlRK7mKaMVcGBP VOG/3ymeogg9dFO1oh/HWApvKeiyTO252eaLm2cQQO5oICzg/6iHTSbTbj0J0u0Mlx24 DTngEwLjyLdAEoVrZbbq/OXdNshVa7ksWv4/irHQiQMk5tVnTDWz0aakBB08xWt3u34V QkAQ== X-Gm-Message-State: AOAM530rVz/eCbWPAL8AXUUzg06xQAPB7wy78dIS2lL79rMaTCuTYGV9 ckRlexn8aHn/UPJPMJTI3gIR75LBrg76OA37Kgq7TcWnTg09HpNqBPOJoJ5wIT1b858cxE0/Rp8 fMrx3V1Zun3w3UxjWqN5cmSxw X-Received: by 2002:a17:907:3da8:: with SMTP id he40mr16485024ejc.146.1643629530793; Mon, 31 Jan 2022 03:45:30 -0800 (PST) X-Received: by 2002:a17:907:3da8:: with SMTP id he40mr16485014ejc.146.1643629530591; Mon, 31 Jan 2022 03:45:30 -0800 (PST) Received: from krava ([83.240.63.12]) by smtp.gmail.com with ESMTPSA id y23sm13375678ejp.116.2022.01.31.03.45.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 03:45:30 -0800 (PST) Date: Mon, 31 Jan 2022 12:45:28 +0100 From: Jiri Olsa To: Masami Hiramatsu Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , netdev@vger.kernel.org, bpf@vger.kernel.org, lkml , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Steven Rostedt , "Naveen N . Rao" , Anil S Keshavamurthy , "David S . Miller" Subject: Re: [PATCH v7 00/10] fprobe: Introduce fprobe function entry/exit probe Message-ID: References: <164360522462.65877.1891020292202285106.stgit@devnote2> <20220131183642.aba575006314b3988110a7e5@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220131183642.aba575006314b3988110a7e5@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 31, 2022 at 06:36:42PM +0900, Masami Hiramatsu wrote: > Hi Jiri, > > On Mon, 31 Jan 2022 14:00:24 +0900 > Masami Hiramatsu wrote: > > > Hi, > > > > Here is the 7th version of fprobe. This version fixes unregister_fprobe() > > ensures that exit_handler is not called after returning from the > > unregister_fprobe(), and fixes some comments and documents. > > > > The previous version is here[1]; > > > > [1] https://lore.kernel.org/all/164338031590.2429999.6203979005944292576.stgit@devnote2/T/#u > > > > This series introduces the fprobe, the function entry/exit probe > > with multiple probe point support. This also introduces the rethook > > for hooking function return as same as the kretprobe does. This > > abstraction will help us to generalize the fgraph tracer, > > because we can just switch to it from the rethook in fprobe, > > depending on the kernel configuration. > > > > The patch [1/10] is from Jiri's series[2]. > > > > [2] https://lore.kernel.org/all/20220104080943.113249-1-jolsa@kernel.org/T/#u > > > > And the patch [9/10] adds the FPROBE_FL_KPROBE_SHARED flag for the case > > if user wants to share the same code (or share a same resource) on the > > fprobe and the kprobes. > > If you want to work on this series, I pushed my working branch on here; > > https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git/ kprobes/fprobe great, I was going to ask for that ;-) thanks jirka > > Thank you, > > > > > Thank you, > > > > --- > > > > Jiri Olsa (1): > > ftrace: Add ftrace_set_filter_ips function > > > > Masami Hiramatsu (9): > > fprobe: Add ftrace based probe APIs > > rethook: Add a generic return hook > > rethook: x86: Add rethook x86 implementation > > ARM: rethook: Add rethook arm implementation > > arm64: rethook: Add arm64 rethook implementation > > fprobe: Add exit_handler support > > fprobe: Add sample program for fprobe > > fprobe: Introduce FPROBE_FL_KPROBE_SHARED flag for fprobe > > docs: fprobe: Add fprobe description to ftrace-use.rst > > > > > > Documentation/trace/fprobe.rst | 171 +++++++++++++ > > Documentation/trace/index.rst | 1 > > arch/arm/Kconfig | 1 > > arch/arm/include/asm/stacktrace.h | 4 > > arch/arm/kernel/stacktrace.c | 6 > > arch/arm/probes/Makefile | 1 > > arch/arm/probes/rethook.c | 71 +++++ > > arch/arm64/Kconfig | 1 > > arch/arm64/include/asm/stacktrace.h | 2 > > arch/arm64/kernel/probes/Makefile | 1 > > arch/arm64/kernel/probes/rethook.c | 25 ++ > > arch/arm64/kernel/probes/rethook_trampoline.S | 87 ++++++ > > arch/arm64/kernel/stacktrace.c | 7 - > > arch/x86/Kconfig | 1 > > arch/x86/include/asm/unwind.h | 8 + > > arch/x86/kernel/Makefile | 1 > > arch/x86/kernel/kprobes/common.h | 1 > > arch/x86/kernel/rethook.c | 115 ++++++++ > > include/linux/fprobe.h | 97 +++++++ > > include/linux/ftrace.h | 3 > > include/linux/kprobes.h | 3 > > include/linux/rethook.h | 100 +++++++ > > include/linux/sched.h | 3 > > kernel/exit.c | 2 > > kernel/fork.c | 3 > > kernel/trace/Kconfig | 26 ++ > > kernel/trace/Makefile | 2 > > kernel/trace/fprobe.c | 341 +++++++++++++++++++++++++ > > kernel/trace/ftrace.c | 58 ++++ > > kernel/trace/rethook.c | 313 +++++++++++++++++++++++ > > samples/Kconfig | 7 + > > samples/Makefile | 1 > > samples/fprobe/Makefile | 3 > > samples/fprobe/fprobe_example.c | 120 +++++++++ > > 34 files changed, 1572 insertions(+), 14 deletions(-) > > create mode 100644 Documentation/trace/fprobe.rst > > create mode 100644 arch/arm/probes/rethook.c > > create mode 100644 arch/arm64/kernel/probes/rethook.c > > create mode 100644 arch/arm64/kernel/probes/rethook_trampoline.S > > create mode 100644 arch/x86/kernel/rethook.c > > create mode 100644 include/linux/fprobe.h > > create mode 100644 include/linux/rethook.h > > create mode 100644 kernel/trace/fprobe.c > > create mode 100644 kernel/trace/rethook.c > > create mode 100644 samples/fprobe/Makefile > > create mode 100644 samples/fprobe/fprobe_example.c > > > > -- > > Masami Hiramatsu (Linaro) > > > -- > Masami Hiramatsu >