From: Masami Hiramatsu <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>, Ingo Molnar <mingo@redhat.com>
Cc: Alban Crequy <alban.crequy@gmail.com>,
Alban Crequy <alban@kinvolk.io>,
Alexei Starovoitov <ast@kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Omar Sandoval <osandov@fb.com>,
linux-doc@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, iago@kinvolk.io,
michael@kinvolk.io, Dorau Lukasz <lukasz.dorau@intel.com>,
systemtap@sourceware.org
Subject: [RFC PATCH tip/master 0/3] kprobes: tracing: kretprobe_instance dynamic allocation
Date: Wed, 29 Mar 2017 14:20:51 +0900 [thread overview]
Message-ID: <149076484118.24574.7083269903420611708.stgit@devbox> (raw)
Here is a correction of patches to introduce kretprobe_instance
dynamic allocation for avoiding kretprobe silently miss-hits.
Original issue was reported by Lukasz on linux-trace ml.
https://www.spinics.net/lists/linux-trace/msg00448.html
Also Alban is working on kprobe-tracer side because of
iovisor's issue.
https://www.spinics.net/lists/netdev/msg427149.html
(Note that this series is independently applicable, no conflict)
This series is a kind of complementary patches for
Alban's patch. So I think both of them are needed.
[1/3]: Add kretprobe's miss-hit counter to miss-hit
column on kprobe_profile. This helps user to
see what happened.
[2/3]: Introduce kretprobe_instance dynamic allocation.
This will help user not to miss the ret probes
even it has low number of maxactive.
[3/3]: Set maximum limitation for pre-allocated maxactive.
This can avoid miss configuration of struct kretprobe.
The downside of this patch is, dynamic allocation will
involve memory allocation, which sometimes traced by
kprobes. In that case those nested kprobes are missed.
To avoid this kind of miss-hit, user may need to make
maxactive enough large when registering kretprobes.
However, in other case, this can reduce the possibility
of miss-hit of kretprobes. Since the maxactive increased
automatically, user will not need to retry tracing with
larger maxactive.
Alban, you can reuse KRETPROBE_MAXACTIVE_ALLOC for checking
upper limiation in trace_kprobe.c too.
Thank you,
---
Masami Hiramatsu (3):
trace: kprobes: Show sum of probe/retprobe nmissed count
kprobes: Allocate kretprobe instance if its free list is empty
kprobes: Limit kretprobe maximum instances
Documentation/kprobes.txt | 25 +++++++++++++++---------
include/linux/kprobes.h | 2 ++
kernel/kprobes.c | 44 +++++++++++++++++++++++++++++++------------
kernel/trace/trace_kprobe.c | 2 +-
4 files changed, 50 insertions(+), 23 deletions(-)
--
Masami Hiramatsu (Linaro) <mhiramat@kernel.org>
next reply other threads:[~2017-03-29 5:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-29 5:20 Masami Hiramatsu [this message]
2017-03-29 5:22 ` [RFC PATCH tip/master 1/3] trace: kprobes: Show sum of probe/retprobe nmissed count Masami Hiramatsu
2017-03-31 9:45 ` Alban Crequy
2017-03-29 5:23 ` [RFC PATCH tip/master 2/3] kprobes: Allocate kretprobe instance if its free list is empty Masami Hiramatsu
2017-03-29 6:30 ` Ingo Molnar
2017-03-29 8:25 ` Masami Hiramatsu
2017-03-29 17:18 ` Josh Stone
2017-03-30 0:39 ` Masami Hiramatsu
2017-03-30 6:53 ` Ingo Molnar
2017-03-30 13:01 ` Masami Hiramatsu
2017-04-12 6:42 ` Ingo Molnar
2017-03-30 13:03 ` Alban Crequy
2017-03-29 5:24 ` [RFC PATCH tip/master 3/3] kprobes: Limit kretprobe maximum instances Masami Hiramatsu
2017-03-29 13:27 ` [RFC PATCH tip/master 0/3] kprobes: tracing: kretprobe_instance dynamic allocation Frank Ch. Eigler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=149076484118.24574.7083269903420611708.stgit@devbox \
--to=mhiramat@kernel.org \
--cc=acme@redhat.com \
--cc=alban.crequy@gmail.com \
--cc=alban@kinvolk.io \
--cc=ast@kernel.org \
--cc=corbet@lwn.net \
--cc=iago@kinvolk.io \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukasz.dorau@intel.com \
--cc=michael@kinvolk.io \
--cc=mingo@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=osandov@fb.com \
--cc=rostedt@goodmis.org \
--cc=systemtap@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).