提交 1c76551f 编写于 作者: G Gerd Hoffmann

usb: mtp: replace debug printfs with trace points

Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
Reviewed-by: NPeter Wu <peter@lekensteyn.nl>
Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
上级 69e25d26
...@@ -294,7 +294,7 @@ static MTPObject *usb_mtp_object_alloc(MTPState *s, uint32_t handle, ...@@ -294,7 +294,7 @@ static MTPObject *usb_mtp_object_alloc(MTPState *s, uint32_t handle,
goto ignore; goto ignore;
} }
fprintf(stderr, "%s: 0x%x %s\n", __func__, o->handle, o->path); trace_usb_mtp_object_alloc(s->dev.addr, o->handle, o->path);
QTAILQ_INSERT_TAIL(&s->objects, o, next); QTAILQ_INSERT_TAIL(&s->objects, o, next);
return o; return o;
...@@ -310,7 +310,7 @@ static void usb_mtp_object_free(MTPState *s, MTPObject *o) ...@@ -310,7 +310,7 @@ static void usb_mtp_object_free(MTPState *s, MTPObject *o)
{ {
int i; int i;
fprintf(stderr, "%s: 0x%x %s\n", __func__, o->handle, o->path); trace_usb_mtp_object_free(s->dev.addr, o->handle, o->path);
QTAILQ_REMOVE(&s->objects, o, next); QTAILQ_REMOVE(&s->objects, o, next);
for (i = 0; i < o->nchildren; i++) { for (i = 0; i < o->nchildren; i++) {
...@@ -843,8 +843,7 @@ static void usb_mtp_command(MTPState *s, MTPControl *c) ...@@ -843,8 +843,7 @@ static void usb_mtp_command(MTPState *s, MTPControl *c)
res0 = data_in->length; res0 = data_in->length;
break; break;
default: default:
fprintf(stderr, "%s: unknown command code 0x%04x\n", trace_usb_mtp_op_unknown(s->dev.addr, c->code);
__func__, c->code);
usb_mtp_queue_result(s, RES_OPERATION_NOT_SUPPORTED, usb_mtp_queue_result(s, RES_OPERATION_NOT_SUPPORTED,
c->trans, 0, 0, 0); c->trans, 0, 0, 0);
return; return;
...@@ -892,6 +891,7 @@ static void usb_mtp_handle_control(USBDevice *dev, USBPacket *p, ...@@ -892,6 +891,7 @@ static void usb_mtp_handle_control(USBDevice *dev, USBPacket *p,
static void usb_mtp_cancel_packet(USBDevice *dev, USBPacket *p) static void usb_mtp_cancel_packet(USBDevice *dev, USBPacket *p)
{ {
/* we don't use async packets, so this should never be called */
fprintf(stderr, "%s\n", __func__); fprintf(stderr, "%s\n", __func__);
} }
......
...@@ -453,6 +453,9 @@ usb_mtp_op_get_object_handles(int dev, uint32_t handle, const char *path) "dev % ...@@ -453,6 +453,9 @@ usb_mtp_op_get_object_handles(int dev, uint32_t handle, const char *path) "dev %
usb_mtp_op_get_object_info(int dev, uint32_t handle, const char *path) "dev %d, handle 0x%x, path %s" usb_mtp_op_get_object_info(int dev, uint32_t handle, const char *path) "dev %d, handle 0x%x, path %s"
usb_mtp_op_get_object(int dev, uint32_t handle, const char *path) "dev %d, handle 0x%x, path %s" usb_mtp_op_get_object(int dev, uint32_t handle, const char *path) "dev %d, handle 0x%x, path %s"
usb_mtp_op_get_partial_object(int dev, uint32_t handle, const char *path, uint32_t offset, uint32_t length) "dev %d, handle 0x%x, path %s, off %d, len %d" usb_mtp_op_get_partial_object(int dev, uint32_t handle, const char *path, uint32_t offset, uint32_t length) "dev %d, handle 0x%x, path %s, off %d, len %d"
usb_mtp_op_unknown(int dev, uint32_t code) "dev %d, command code 0x%x"
usb_mtp_object_alloc(int dev, uint32_t handle, const char *path) "dev %d, handle 0x%x, path %s"
usb_mtp_object_free(int dev, uint32_t handle, const char *path) "dev %d, handle 0x%x, path %s"
# hw/usb/host-libusb.c # hw/usb/host-libusb.c
usb_host_open_started(int bus, int addr) "dev %d:%d" usb_host_open_started(int bus, int addr) "dev %d:%d"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册