This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# usdt - trace user statically defined tracepoints. User-level dynamic tracing. | |
# Written using Linux ftrace. Experimental. | |
# | |
# WARNING: This is a proof of concept for USDT tracing from Linux ftrace, and | |
# is not safe to use in production environments. In particular, the -i option | |
# sets memory semaphores by piping the output of printf through dd and then | |
# to process memory via /proc/PID/mem. Yes, this program pipes the output of | |
# the shell directly over top of live process memory. If you don't understand |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Here's the script I'll use to demonstrate - it just loops forever: | |
$ cat test.rb | |
#!/usr/bin/env ruby | |
loop do | |
sleep 1 | |
end | |
# Now, I'll start the script in the background, and redirect stdout and stderr |