Re: [PATCH/RFC] samples/: move kprobes sources to samples

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Ananth N Mavinakayanahalli <ananth@...>
Cc: Randy Dunlap <randy.dunlap@...>, lkml <linux-kernel@...>, <prasanna@...>, <anil.s.keshavamurthy@...>, <hch@...>, <mathieu.desnoyers@...>, akpm <akpm@...>, <sam@...>, <davem@...>
Date: Tuesday, September 25, 2007 - 4:57 am

On Tue, Sep 25, 2007 at 02:13:33PM +0530, Ananth N Mavinakayanahalli wrote:

I don't think we should have this type of comment in any of the files.


I don't think you'll need uio,h here.



I'd rather write this as:

	/* Always end with a call to jprobe_return(). */
	jprobe_return();
	return 0;
}

Also a a note not to these example but general kprobes code I've
bee wondering whether jprobe_return() should just include the return.
Yes, macros including a return are ugly, but in this case jprobe_return
actually handles the return anyway through deep magic.


Shouldn't this be simply done in the static initialization, ala:

static struct jprobe my_jprobe = {
	.entry			= jdo_fork,
	.kp = {
		.symbol_name	= "do_fork",
	},
};

(same for the other examples)


Now this is really ugly.  We should really have macros for the interesting
registers (instruction pointer, frame pointer, stack pointer) in kdebug.h.
systemtap runtime already has them for supported architectures, any care
to port them over?

(note that this is not an objection to the patch as-is, but rather a
 suggestion for later improvement of the whole thing)



Thanks a lot for moving this in the right place!
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH/RFC] samples/: move kprobes sources to samples, Randy Dunlap, (Mon Sep 24, 5:58 pm)
Re: [PATCH/RFC] samples/: move kprobes sources to samples, Ananth N Mavinakayanahalli..., (Tue Sep 25, 4:43 am)
Re: [PATCH/RFC] samples/: move kprobes sources to samples, Christoph Hellwig, (Tue Sep 25, 4:57 am)
Re: [PATCH/RFC] samples/: move kprobes sources to samples, Ananth N Mavinakayanahalli..., (Tue Sep 25, 6:00 am)
Re: [PATCH/RFC] samples/: move kprobes sources to samples, Mathieu Desnoyers, (Mon Sep 24, 6:21 pm)
Re: [PATCH/RFC] samples/: move kprobes sources to samples, Mathieu Desnoyers, (Mon Sep 24, 6:45 pm)