r342378: usbconfig takes 3-5 minutes to read the bus

Hans Petter Selasky hps at selasky.org
Thu Jan 3 10:05:50 UTC 2019


On 1/3/19 10:48 AM, Matthias Apitz wrote:
> Is there a way log log any init call to libusb.so to see which process
> is doing something with libusb.so after devd(8) started pcscd?

Hi,

You can add a print in the kernel sys/dev/usb/usb_generic.c in the function:

static int
ugen_open(struct usb_fifo *f, int fflags)


printf("USB opened by PID %d %s\n", curthread->td_proc->p_pid, 
curthread->td_proc->p_comm);


> Index: sys/dev/usb/usb_generic.c
> ===================================================================
> --- sys/dev/usb/usb_generic.c	(revision 342455)
> +++ sys/dev/usb/usb_generic.c	(working copy)
> @@ -185,6 +185,8 @@
>  
>  	DPRINTFN(6, "flag=0x%x\n", fflags);
>  
> +	printf("USB opened by PID %d %s\n", curthread->td_proc->p_pid, curthread->td_proc->p_comm);
> +
>  	mtx_lock(f->priv_mtx);
>  	switch (usbd_get_speed(f->udev)) {
>  	case USB_SPEED_LOW:


--HPS


More information about the freebsd-usb mailing list