Date: Sun, 09 Sep 2018 12:06:10 +0000 From: bugzilla-noreply@freebsd.org To: usb@FreeBSD.org Subject: [Bug 231264] libusb DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O done"); does not work in libusb10_do_transfer_cb() Message-ID: <bug-231264-19105@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D231264 Bug ID: 231264 Summary: libusb DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O done"); does not work in libusb10_do_transfer_cb() Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: usb Assignee: usb@FreeBSD.org Reporter: ludovic.rousseau+freebsd@gmail.com The _only_ use of DPRINTF(..., LIBUSB_DEBUG_TRANSFER, ...) is in the functi= on libusb10_do_transfer_cb of libusb10_io.c https://github.com/freebsd/freebsd/blob/master/lib/libusb/libusb10_io.c#L500 The function uses it as: ctx =3D GET_CONTEXT(NULL); DPRINTF(ctx, LIBUSB_DEBUG_TRANSFER, "sync I/O done"); Since the ctx context is fetched from NULL it has default values and ctx->d= ebug is 0. DPRINTF() definition uses ctx->debug to know the debug level. https://github.com/freebsd/freebsd/blob/master/lib/libusb/libusb10.h#L44 In the present case the debug level will be 0 so nothing is logged. I don't know how to get the libusb context from a libusb_transfer, the only parameter passed to libusb10_do_transfer_cb(). Another idea for improvement would be to use a bitmap for ctx->debug so it would be possible to enable both LIBUSB_DEBUG_TRANSFER and LIBUSB_DEBUG_FUNCTION at the same time. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-231264-19105>