adding markers in kernel modules.

ligeo george <[email protected]> Wed, 22 Aug 2007 15:02:20 -0700 (PDT)
Newsgroups gmane.linux.kernel.tracing
Message-ID <[email protected]>
Hi all, 

First, let me thank all the developers for doing a great job on LTT. Thank you!

I'm trying to understand the process of adding custom markers into a kernel module with the older version of LTT. 
I have LTTng - 0.6.47, LTTV - 0.8.79, LTT control - 0.32 and genevent - 0.31

>From what I could gather, I think I am supposed to:
1. create mymarker.xml 
2. run genevent on the xml to create source code.
3. copy the source code into the ltt/facilities directory and into include/ltt/ folder.
4. create probe.c and probe.h in ltt/probes by looking at other probe files.
5. I have compiled facilities into the kernel and the probe as a module.
6. In my kernel module, add markers corresponding the the one defined in XML.
7. load kernel with facilities, load my module, load probe
8. run trace (I think the xml file has to be in the share/ltt-control/facilities/ folder before starting the trace?)

I tried the above and the probe wouldnt load. It says Operation not permitted (-1). Looking through the code, I see that this is because the list of iter->cmark->name does not have my marker name. I looked at kallsyms and I find the marker there. 
So, next I add the marker in kernel/module.c right after the kernel_module_load marker. This time when I try to load my probe it loads it fine. Then I load my kernel module and after running the trace, I dont see any logs of the marker I have put in my kernel module. 

Can someone please advice on what is going on or what is the right way to do this. 

My kernel module looks like this 
init_module() { 
...
MARK(hello_module_load, "%s", "Init");
...
}
Along the code execution path, I have put the MARK again
new_thread() {
...
MARK(hello_module_load, "%s", "Thread");
...
}
My probe has 
result = marker_set_probe("hello_module_load",
            HELLO_LOAD_FORMAT,
            probe_hello_load);

I compile the kernel module and load it. Then when I try to load my probe, it says Operation not permitted (-1) although I can see hello_module_load in kallsyms.
So, I put MARK(hello_module_load, "%s", "module.c") in kernel/module.c and compile the kernel. Then I load the probe and it loads fine. But when I load my kernel module and the execution hits the MARK() in the path, I dont see anything in the trace logs. 

Hope that was not very confusing to you guys.

Confused,
-Ligeo.

       
---------------------------------
Got a little couch potato? 
Check out fun summer activities for kids.

_______________________________________________
Ltt-dev mailing list
[email protected]
http://listserv.shafik.org/mailman/listinfo/ltt-dev