From 2d11a259569dd510123f726b862edcbe2b3c6e93 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Wed, 16 Jan 2013 14:37:47 +0100 Subject: ps2 --- systemtap/dump-ps2/dump.stap | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 systemtap/dump-ps2/dump.stap (limited to 'systemtap') diff --git a/systemtap/dump-ps2/dump.stap b/systemtap/dump-ps2/dump.stap new file mode 100644 index 0000000..26a71c4 --- /dev/null +++ b/systemtap/dump-ps2/dump.stap @@ -0,0 +1,24 @@ +function timestamp:string() { + printf("[%012ld]\t", jiffies()); +} + + +probe module("psmouse").function("psmouse_process_byte") { + timestamp(); + for (i=0; i < $psmouse->pktsize; i++) { + printf("%02x ", $psmouse->packet[i]); + } + + btnLeft = ($psmouse->packet[0] >> 0) & 1; + btnRight = ($psmouse->packet[0] >> 1) & 1; + btnMiddle = ($psmouse->packet[0] >> 2) & 1; + + yOver = ($psmouse->packet[0] >> 7) & 1; + xOver = ($psmouse->packet[0] >> 6) & 1; + + moveX = (($psmouse->packet[0] >> 4) & 1) ? -1*(255-$psmouse->packet[1]) : $psmouse->packet[1]; + moveY = (($psmouse->packet[0] >> 5) & 1) ? -1*(255-$psmouse->packet[2]) : $psmouse->packet[2]; + + printf(" moveX=%04d moveY=%04d yOver=%d xOver=%d", moveX, moveY, yOver, xOver); + printf(" btnLeft=%d btnRight=%d btnMiddle=%d\n", btnLeft, btnRight, btnMiddle); +} -- cgit v1.2.1