Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


Search this Thread
Old 04-28-2012, 11:11 PM   #1
Registered: Jul 2010
Posts: 126

Rep: Reputation: 4
TRACEPOINTs in Linux Kernel


I am trying to learn module development in Linux Kernel and I wanted to know how to use a tracepoint already defined in the linux kernel :

The tracepoint I am referring to is :

As per the documentation it says that trace_block_bio_complete() is called when the Block operation is completed :
This tracepoint indicates there is no further work to do on this block IO operation bio.

But when I write a KERNEL Module for the same, its not working. Here is the code :
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/blkdev.h>
#include <linux/blktrace_api.h>
#include <linux/percpu.h>
#include <linux/bio.h>
#include <linux/tracepoint.h>


int mymod_count = 0;

static void mymod_trace_bio_complete(struct request_queue *q, struct bio *bio)
	if(mymod_count < 10){
		printk(KERN_INFO "%d ... \n", mymod_count);

static int mymod_init(void) {
	int ret;

	printk("<1> Starting mymod kernel module ... \n");

	ret = register_trace_block_bio_complete(mymod_trace_bio_complete);


static void mymod_exit(void) {
	printk("<1> Stopping mymod kernel module ... \n");


Please let me know what I am doing wrong. Also I dont know if there is any dedicated forum or mailing list where I can ask questions about kernel development.

Looking forward to any input
Old 04-30-2012, 06:49 AM   #2
Registered: Jul 2010
Posts: 126

Original Poster
Rep: Reputation: 4
Can anyone guide me to any forum which is dedicated to linux kernel programming.
I would really appreciate any help on the problem I face with the kernel module programming.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: This week at LWN: On the value of static tracepoints LXer Syndicated Linux News 0 05-14-2009 02:50 AM
LXer: Howto: build Linux kernel module against installed kernel w/o full kernel source tree LXer Syndicated Linux News 0 09-03-2006 08:21 PM

All times are GMT -5. The time now is 07:33 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration