Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1611583

[RFC PATCH tip/master 0/3] kprobes: tracing: kretprobe_instance dynamic allocation

From Masami Hiramatsu <mhiramat@kernel.org>
Newsgroups linux.kernel
Subject [RFC PATCH tip/master 0/3] kprobes: tracing: kretprobe_instance dynamic allocation
Date 2017-03-29 07:30 +0200
Message-ID <tqelb-2ha-3@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View 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>

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[RFC PATCH tip/master 0/3] kprobes: tracing: kretprobe_instance dynamic allocation Masami Hiramatsu <mhiramat@kernel.org> - 2017-03-29 07:30 +0200
  [RFC PATCH tip/master 3/3] kprobes: Limit kretprobe maximum instances Masami Hiramatsu <mhiramat@kernel.org> - 2017-03-29 07:30 +0200
  [RFC PATCH tip/master 2/3] kprobes: Allocate kretprobe instance if its free list is empty Masami Hiramatsu <mhiramat@kernel.org> - 2017-03-29 07:30 +0200
    Re: [RFC PATCH tip/master 2/3] kprobes: Allocate kretprobe instance  if its free list is empty Ingo Molnar <mingo@kernel.org> - 2017-03-29 08:40 +0200
      Re: [RFC PATCH tip/master 2/3] kprobes: Allocate kretprobe instance  if its free list is empty Masami Hiramatsu <mhiramat@kernel.org> - 2017-03-29 10:30 +0200
        Re: [RFC PATCH tip/master 2/3] kprobes: Allocate kretprobe instance  if its free list is empty Josh Stone <jistone@redhat.com> - 2017-03-29 19:30 +0200
          Re: [RFC PATCH tip/master 2/3] kprobes: Allocate kretprobe instance  if its free list is empty Masami Hiramatsu <mhiramat@kernel.org> - 2017-03-30 02:40 +0200
        Re: [RFC PATCH tip/master 2/3] kprobes: Allocate kretprobe instance  if its free list is empty Ingo Molnar <mingo@kernel.org> - 2017-03-30 09:00 +0200
          Re: [RFC PATCH tip/master 2/3] kprobes: Allocate kretprobe instance  if its free list is empty Masami Hiramatsu <mhiramat@kernel.org> - 2017-03-30 15:10 +0200
          Re: [RFC PATCH tip/master 2/3] kprobes: Allocate kretprobe instance  if its free list is empty Alban Crequy <alban@kinvolk.io> - 2017-03-30 15:10 +0200
  Re: [RFC PATCH tip/master 0/3] kprobes: tracing: kretprobe_instance dynamic allocation fche@redhat.com (Frank Ch. Eigler) - 2017-03-29 15:30 +0200

csiph-web