Skip to contentSkip to conversation

module for controlling kprobes with /proc

DISCUSSION Piotr Muszynski 1 participant 1 message Apr 4, 2005

lore
Share & tools
lore
#0 lore raw
Quoted 17 lines · Joel Becker
Quoted 2 lines

I have programmed a universal module to register/remove kprobes handlers by interacting with /proc with simple commands.

Looking at your code, I'm thinking you could really use
configfs. With configfs, kernelspace objects are created and controlled via regular filesystem operations. Instead of echoing a cryptic line to your proc file, a user could instead create objects in a directory:

To insert a handler:

	cd /config/kprobes
	mkdir myhandler
	cd myhandler
	echo 0x12345678 > handler_address
	echo 0x87654321 > breakpoint_address
	echo post > when
Quoted 8 lines

To remove one:
cd /config/kprobes
rmdir myhandler

If this interests you at all, see
http://oss.oracle.com/projects/ocfs2/src/trunk/fs/configfs/,
specifically configfs.txt and configfs_example.c. I'm going to be submitting this for mainline inclusion soon.

Joel, thank you very much - this looks like a Good Idea. I am going to try configfs as soon as my schedule permits.
(Will be grateful for any directions, as I'm new in kernelspace :-))

Piotr
PS Hope you don't mind me quoting your message here.