[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20220112200840.a035b3b001d2e207e6a2d885@kernel.org>
Date: Wed, 12 Jan 2022 20:08:40 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: Masami Hiramatsu <mhiramat@...nel.org>
Cc: Alexei Starovoitov <alexei.starovoitov@...il.com>,
Jiri Olsa <jolsa@...hat.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>, netdev@...r.kernel.org,
bpf@...r.kernel.org, lkml <linux-kernel@...r.kernel.org>,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...omium.org>,
Steven Rostedt <rostedt@...dmis.org>,
"Naveen N . Rao" <naveen.n.rao@...ux.ibm.com>,
Anil S Keshavamurthy <anil.s.keshavamurthy@...el.com>,
"David S . Miller" <davem@...emloft.net>
Subject: Re: [RFC PATCH 0/6] fprobe: Introduce fprobe function entry/exit
probe
On Wed, 12 Jan 2022 16:33:53 +0900
Masami Hiramatsu <mhiramat@...nel.org> wrote:
> Hi Alexei,
>
> On Tue, 11 Jan 2022 14:39:44 -0800
> Alexei Starovoitov <alexei.starovoitov@...il.com> wrote:
>
> > On Wed, Jan 12, 2022 at 12:00:17AM +0900, Masami Hiramatsu wrote:
> > > Hi Jiri,
> > >
> > > Here is a short series of patches, which shows what I replied
> > > to your series.
> > >
> > > This introduces the fprobe, the function entry/exit probe with
> > > multiple probe point support. This also introduces the rethook
> > > for hooking function return, which I cloned from kretprobe.
> > >
> > > I also rewrite your [08/13] bpf patch to use this fprobe instead
> > > of kprobes. I didn't tested that one, but the sample module seems
> > > to work. Please test bpf part with your libbpf updates.
> > >
> > > BTW, while implementing the fprobe, I introduced the per-probe
> > > point private data, but I'm not sure why you need it. It seems
> > > that data is not used from bpf...
> > >
> > > If this is good for you, I would like to proceed this with
> > > the rethook and rewrite the kretprobe to use the rethook to
> > > hook the functions. That should be much cleaner (and easy to
> > > prepare for the fgraph tracer integration)
> >
> > What is the speed of attach/detach of thousands fprobes?
>
> I've treaked my example module and it shows below result;
>
> /lib/modules/5.16.0-rc4+/kernel/samples/fprobe # time insmod ./fprobe_example.ko
> symbol='btrfs_*'
> [ 187.095925] fprobe_init: 1028 symbols found
> [ 188.521694] fprobe_init: Planted fprobe at btrfs_*
> real 0m 1.47s
> user 0m 0.00s
> sys 0m 1.36s
>
> I think using ftrace_set_filter_ips() can make it faster.
> (maybe it needs to drop per-probe point private data, that
> prevents fprobe to use that interface)
OK, I've updated fprobes to use the ftrace_set_filter_ips()
and got below result.
/lib/modules/5.16.0-rc4+/kernel/samples/fprobe # time insmod fprobe_example.ko s
ymbol='btrfs_*'
[ 36.130947] fprobe_init: 1028 symbols found
[ 36.177901] fprobe_init: Planted fprobe at btrfs_*
real 0m 0.08s
user 0m 0.00s
sys 0m 0.07s
Let me update the series :)
Thank you,
--
Masami Hiramatsu <mhiramat@...nel.org>
Powered by blists - more mailing lists