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


Groups > linux.kernel > #1531115

Re: [PATCH 3/6] dax: add tracepoint infrastructure, PMD tracing

From Jan Kara <jack@suse.cz>
Newsgroups linux.kernel
Subject Re: [PATCH 3/6] dax: add tracepoint infrastructure, PMD tracing
Date 2016-11-28 09:40 +0100
Message-ID <sIpDH-8b7-19@gated-at.bofh.it> (permalink)
References (4 earlier) <sHg9r-47K-1@gated-at.bofh.it> <sHiNY-5Tm-5@gated-at.bofh.it> <sHjh0-62o-27@gated-at.bofh.it> <sHuP8-4OI-15@gated-at.bofh.it> <sHwxz-5Zv-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri 25-11-16 16:48:40, Ted Tso wrote:
> On Fri, Nov 25, 2016 at 11:51:26AM -0800, Linus Torvalds wrote:
> > We do have filesystem code that is just disgusting. As an example:
> > fs/afs/ tends to have these crazy "_enter()/_exit()" macros in every
> > single function. If you want that, use the function tracer. That seems
> > to be just debugging code that has been left around for others to
> > stumble over. I do *not* believe that we should encourage that kind of
> > "machine gun spray" use of tracepoints.
> 
> There is a reason why people want to be able to do that, and that's
> because kprobes doesn't give you access to the arguments and return
> codes to the functions.  Maybe there could be a way to do this more
> easily using DWARF information and EBPF magic, perhaps?  It won't help
> for inlined functions, of course, but most of the functions where
> people want to do this aren't generally functions which are going to
> be inlined, but rather things like write_begin, writepages, which are
> called via a struct ops table and so will never be inlined to begin
> with.

Actually, you can print register & stack contents from a kprobe and you can
get a function return value from a kretprobe (see
Documentation/trace/kprobetrace.txt). Since calling convention is fixed
(arg 1 in RDI, arg 2 in RSI...) you can relatively easily dump function
arguments on entry and dump return value on return for arbitrary function
of your choice. I was already debugging issues like that several times (in
VFS actually because of missing trace points ;)). You can even create a
kprobe to dump register contents in the middle of the function (although
there it takes more effort reading the dissasembly to see what you are
interested in).

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

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


Thread

Re: [PATCH 3/6] dax: add tracepoint infrastructure, PMD tracing Linus Torvalds <torvalds@linux-foundation.org> - 2016-11-25 21:00 +0100
  Re: [PATCH 3/6] dax: add tracepoint infrastructure, PMD tracing Mike Marshall <hubcap@omnibond.com> - 2016-11-25 21:40 +0100
  Re: [PATCH 3/6] dax: add tracepoint infrastructure, PMD tracing Theodore Ts'o <tytso@mit.edu> - 2016-11-25 22:50 +0100
    Re: [PATCH 3/6] dax: add tracepoint infrastructure, PMD tracing Linus Torvalds <torvalds@linux-foundation.org> - 2016-11-26 00:40 +0100
    Re: [PATCH 3/6] dax: add tracepoint infrastructure, PMD tracing Jan Kara <jack@suse.cz> - 2016-11-28 09:40 +0100
  Re: [PATCH 3/6] dax: add tracepoint infrastructure, PMD tracing Dave Chinner <david@fromorbit.com> - 2016-11-27 23:50 +0100
    Re: [PATCH 3/6] dax: add tracepoint infrastructure, PMD tracing Linus Torvalds <torvalds@linux-foundation.org> - 2016-11-28 02:00 +0100
      Re: [PATCH 3/6] dax: add tracepoint infrastructure, PMD tracing Al Viro <viro@ZenIV.linux.org.uk> - 2016-11-28 03:10 +0100
      Re: [PATCH 3/6] dax: add tracepoint infrastructure, PMD tracing Dave Chinner <david@fromorbit.com> - 2016-11-28 10:10 +0100

csiph-web