This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: systemtap with USB


Hello,

tsjaseen wrote:
> Hello,
> 
> I am trying with the systemtap tool to understand the USB subsystem. I've
> written basic script where the probe point is set for usb_register_driver.
> 
> probe kernel.function("usb_register_driver")
> 
> {
> 
> print("Entering usb_register\n")
> 
> }
> 
> probe timer.ms(30000)
> 
> {
> 
> exit()
> 
> }
> 
> After executing this script i am inserting a USB flash due to which the
> usb-storage module gets loaded. Checked by doing lsmod.
> 
> But the hook i've set here in the kernel is not getting the event at all.

Would you had inserted (and had removed) a usb flash before doing that?

If so, I guess the reason why is that 'usb_storage' module has been loaded before
running that script.
usb_register_driver() is invoked when a usb "client" module (ex. usb_storage.ko)
is loaded. And the kernel loads usb_storage when inserting a usb flash, but
it does not unload usb_storage when removing it.
So, before running the script, could you unload usb_storage?
$ /sbin/rmmod usb_storage

Thank you,

-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]