summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples/general/keyhack.stp
blob: 23384a9a5cd27f77941bd794a226c90a59e0d79f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#! /usr/bin/env stap

# This is not useful, but it demonstrates that
# Systemtap can modify variables in a running kernel.

# Usage: ./keyhack.stp -g

probe kernel.function("kbd_event") {
  # Changes 'm' to 'b' .
  if ($event_code == 50) $event_code = 48
}

probe end {
  printf("\nDONE\n")
}