Skip to content

Instantly share code, notes, and snippets.

@bisco
Last active May 21, 2017 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bisco/3506708c2dbd7ae9fed3025449e9fd2e to your computer and use it in GitHub Desktop.
Save bisco/3506708c2dbd7ae9fed3025449e9fd2e to your computer and use it in GitHub Desktop.
systemtap test
#!/usr/bin/stap -gv
probe begin {
printf("force stop warning short TX\n")
}
probe end {
printf("stop probe\n")
}
global changed = 0
probe kernel.statement("handle_tx_event@drivers/usb/host/xhci-ring.c:2380") {
$xhci->quirks = $xhci->quirks | (1 << 10) # XHCI_TRUST_TX_LENGTH = (1<<10)
changed = 1
# printf("NO QUIRK OK\n");
}
global g_trb_comp_code = 0
probe kernel.statement("handle_tx_event@drivers/usb/host/xhci-ring.c:2477") {
if(changed) {
changed = 0
$trb_comp_code = 1
}
next_addr = @cast(&$ep_ring->td_list, "list_head", "kernel")->next
list_addr = &$ep_ring->td_list
if(next_addr == list_addr) {
g_trb_comp_code = $trb_comp_code
$trb_comp_code = 26 # COMP_STOP
}
}
probe kernel.statement("handle_tx_event@drivers/usb/host/xhci-ring.c:2493") {
if(g_trb_comp_code) {
$trb_comp_code = g_trb_comp_code
g_trb_comp_code = 0
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment