aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2012-03-23 12:35:55 +0100
committerGerd Hoffmann <kraxel@redhat.com>2012-04-17 10:23:27 +0200
commit19b89252a32e53aa8bd90a8d4c3e3dcc5f8fe46d (patch)
tree0d922ab4645aff51667a46290a23b7303cdb5eca
parent6aebe407968a0c7e0be2647391753471ed674c65 (diff)
usb-host: add usb packet to request tracepoints
Add pointer to USBPacket to all tracepoints tracking requests to make it easier to identify them when multiple requests are in flight. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r--hw/usb/host-linux.c26
-rw-r--r--trace-events10
2 files changed, 19 insertions, 17 deletions
diff --git a/hw/usb/host-linux.c b/hw/usb/host-linux.c
index 6ea59a7af5..8084fd941a 100644
--- a/hw/usb/host-linux.c
+++ b/hw/usb/host-linux.c
@@ -375,10 +375,10 @@ static void async_complete(void *opaque)
}
if (aurb->urb.type == USBDEVFS_URB_TYPE_CONTROL) {
- trace_usb_host_req_complete(s->bus_num, s->addr, p->result);
+ trace_usb_host_req_complete(s->bus_num, s->addr, p, p->result);
usb_generic_async_ctrl_complete(&s->dev, p);
} else if (!aurb->more) {
- trace_usb_host_req_complete(s->bus_num, s->addr, p->result);
+ trace_usb_host_req_complete(s->bus_num, s->addr, p, p->result);
usb_packet_complete(&s->dev, p);
}
}
@@ -392,7 +392,7 @@ static void usb_host_async_cancel(USBDevice *dev, USBPacket *p)
USBHostDevice *s = DO_UPCAST(USBHostDevice, dev, dev);
AsyncURB *aurb;
- trace_usb_host_req_canceled(s->bus_num, s->addr);
+ trace_usb_host_req_canceled(s->bus_num, s->addr, p);
QLIST_FOREACH(aurb, &s->aurbs, next) {
if (p != aurb->packet) {
@@ -847,12 +847,12 @@ static int usb_host_handle_data(USBDevice *dev, USBPacket *p)
uint8_t *pbuf;
uint8_t ep;
- trace_usb_host_req_data(s->bus_num, s->addr,
+ trace_usb_host_req_data(s->bus_num, s->addr, p,
p->pid == USB_TOKEN_IN,
p->ep->nr, p->iov.size);
if (!is_valid(s, p->pid, p->ep->nr)) {
- trace_usb_host_req_complete(s->bus_num, s->addr, USB_RET_NAK);
+ trace_usb_host_req_complete(s->bus_num, s->addr, p, USB_RET_NAK);
return USB_RET_NAK;
}
@@ -867,7 +867,7 @@ static int usb_host_handle_data(USBDevice *dev, USBPacket *p)
ret = ioctl(s->fd, USBDEVFS_CLEAR_HALT, &arg);
if (ret < 0) {
perror("USBDEVFS_CLEAR_HALT");
- trace_usb_host_req_complete(s->bus_num, s->addr, USB_RET_NAK);
+ trace_usb_host_req_complete(s->bus_num, s->addr, p, USB_RET_NAK);
return USB_RET_NAK;
}
clear_halt(s, p->pid, p->ep->nr);
@@ -922,11 +922,13 @@ static int usb_host_handle_data(USBDevice *dev, USBPacket *p)
switch(errno) {
case ETIMEDOUT:
- trace_usb_host_req_complete(s->bus_num, s->addr, USB_RET_NAK);
+ trace_usb_host_req_complete(s->bus_num, s->addr, p,
+ USB_RET_NAK);
return USB_RET_NAK;
case EPIPE:
default:
- trace_usb_host_req_complete(s->bus_num, s->addr, USB_RET_STALL);
+ trace_usb_host_req_complete(s->bus_num, s->addr, p,
+ USB_RET_STALL);
return USB_RET_STALL;
}
}
@@ -1033,22 +1035,22 @@ static int usb_host_handle_control(USBDevice *dev, USBPacket *p,
*/
/* Note request is (bRequestType << 8) | bRequest */
- trace_usb_host_req_control(s->bus_num, s->addr, request, value, index);
+ trace_usb_host_req_control(s->bus_num, s->addr, p, request, value, index);
switch (request) {
case DeviceOutRequest | USB_REQ_SET_ADDRESS:
ret = usb_host_set_address(s, value);
- trace_usb_host_req_emulated(s->bus_num, s->addr, ret);
+ trace_usb_host_req_emulated(s->bus_num, s->addr, p, ret);
return ret;
case DeviceOutRequest | USB_REQ_SET_CONFIGURATION:
ret = usb_host_set_config(s, value & 0xff);
- trace_usb_host_req_emulated(s->bus_num, s->addr, ret);
+ trace_usb_host_req_emulated(s->bus_num, s->addr, p, ret);
return ret;
case InterfaceOutRequest | USB_REQ_SET_INTERFACE:
ret = usb_host_set_interface(s, index, value);
- trace_usb_host_req_emulated(s->bus_num, s->addr, ret);
+ trace_usb_host_req_emulated(s->bus_num, s->addr, p, ret);
return ret;
}
diff --git a/trace-events b/trace-events
index 3e8da19fd8..e3b178767c 100644
--- a/trace-events
+++ b/trace-events
@@ -312,11 +312,11 @@ usb_host_set_config(int bus, int addr, int config) "dev %d:%d, config %d"
usb_host_set_interface(int bus, int addr, int interface, int alt) "dev %d:%d, interface %d, alt %d"
usb_host_claim_interfaces(int bus, int addr, int config, int nif) "dev %d:%d, config %d, nif %d"
usb_host_release_interfaces(int bus, int addr) "dev %d:%d"
-usb_host_req_control(int bus, int addr, int req, int value, int index) "dev %d:%d, req 0x%x, value %d, index %d"
-usb_host_req_data(int bus, int addr, int in, int ep, int size) "dev %d:%d, in %d, ep %d, size %d"
-usb_host_req_complete(int bus, int addr, int status) "dev %d:%d, status %d"
-usb_host_req_emulated(int bus, int addr, int status) "dev %d:%d, status %d"
-usb_host_req_canceled(int bus, int addr) "dev %d:%d"
+usb_host_req_control(int bus, int addr, void *p, int req, int value, int index) "dev %d:%d, packet %p, req 0x%x, value %d, index %d"
+usb_host_req_data(int bus, int addr, void *p, int in, int ep, int size) "dev %d:%d, packet %p, in %d, ep %d, size %d"
+usb_host_req_complete(int bus, int addr, void *p, int status) "dev %d:%d, packet %p, status %d"
+usb_host_req_emulated(int bus, int addr, void *p, int status) "dev %d:%d, packet %p, status %d"
+usb_host_req_canceled(int bus, int addr, void *p) "dev %d:%d, packet %p"
usb_host_urb_submit(int bus, int addr, void *aurb, int length, int more) "dev %d:%d, aurb %p, length %d, more %d"
usb_host_urb_complete(int bus, int addr, void *aurb, int status, int length, int more) "dev %d:%d, aurb %p, status %d, length %d, more %d"
usb_host_urb_canceled(int bus, int addr, void *aurb) "dev %d:%d, aurb %p"