Re: adding markers in kernel modules.

ligeo george <[email protected]> Wed, 22 Aug 2007 17:36:13 -0700 (PDT)
Newsgroups gmane.linux.kernel.tracing
Message-ID <[email protected]>
Mathieu, 

Thanks for the reply. But like I have mentioned, that is what I am doing. 

The facilities are compiled into the kernel, the target module is then loaded and then the probe module. But the probe module refuses to load. Somehow the MARK(...) in the target module does not get registered I think. Like I mentioned the mark is not there in the iter->cmark->name list which prevents the probe module from loading.

Thanks


Mathieu Desnoyers <[email protected]> wrote: I think that you had to first load the target module (module which has
the marker) before you load the probe module in those old LTTng
versions. It is fixed now.

Therefore, it was impossible to instrument module init...

Mathieu

* ligeo george ([email protected]) 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
> [email protected]
> http://listserv.shafik.org/mailman/listinfo/ltt-dev


-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68


       
---------------------------------
Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when.

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