[Ltt-dev] adding markers in kernel modules.
ligeo george
ligeo_g at yahoo.com
Wed Aug 22 18:29:45 EDT 2007
To follow up after some more investigation..
I guess my question is ,
when I put MARK(..) in my kernel module and load it,
those markers does not appear in the iter->cmark->name list (kernel/module.c)
and so I am not able to load the probes for these markers.
If I add the same MARK(..) in the kernel code somewhere, it shows up in the
iter->cmark->name list and I can further load the probe for these markers.
So do I have to do something different to add MARK(..) into loadable kernel
modules?
You can see how my probe.c and mymodule.c looks like from the previous post. My xml file looks like this
<?xml version="1.0"?>
<facility name="hello">
<description>My test marker</description>
<event name="module_load">
<description>module loaded</description>
<field name="name"> <description>module name</description><string/></field>
</event>
</facility>
TIA
-Ligeo
ligeo george <ligeo_g at yahoo.com> wrote: 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
Ltt-dev at listserv.shafik.org
http://listserv.shafik.org/mailman/listinfo/ltt-dev
---------------------------------
Ready for the edge of your seat? Check out tonight's top picks on Yahoo! TV.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserv.shafik.org/pipermail/ltt-dev/attachments/20070822/b1eee207/attachment.htm
More information about the Ltt-dev
mailing list