> index bef1f03c42..624dc2c447 100644 > --- a/hw/usb/dev-smartcard-reader.c > +++ b/hw/usb/dev-smartcard-reader.c > @@ -54,9 +54,25 @@ do { \ > #define D_INFO 2 > #define D_MORE_INFO 3 > #define D_VERBOSE 4 > +#define D_TRACE 5 > +#define D_REMOTEIO 10
Considered converting all DPRINTFs into tracepoints instead? Then you can turn then on/off individually as needed. > #define CCID_DEV_NAME "usb-ccid" > #define USB_CCID_DEV(obj) OBJECT_CHECK(USBCCIDState, (obj), > CCID_DEV_NAME) > + > +static void usb_packet_dump(int lvl, const char *dir, uint8_t *buf, > size_t len) > +{ > + int i; > + if (lvl < D_TRACE) { > + return; > + } > + printf("usb-ccid: usb packet(%s/%zd):", dir, len); > + for (i = 0; i < len; ++i) { > + printf(" %02x", buf[i]); > + } > + printf("\n"); > +} There is qemu_hexdump() ... cheers, Gerd