用户态进程探针

  1. #
  2. probe process("/lib64/libc.so.6").function("*memcpy*") { /* scripts */ }
  3. #
  4. probe process(28888).function("*open*") { /* scripts */ }
  5. #
  6. probe process("/home/postgres/postgresql-12.1/bin/postgres").function("*memcpy*") {
  7. /* scripts */
  8. }
  9. #
  10. probe process("postgres").statement("GetNewTransactionId@varsup.c:76") {
  11. /* scripts */
  12. }

系统调用探针

  1. #
  2. probe.syscall.*
  3. #
  4. probe syscall.write
  5. #
  6. probe syscall.write.return

内核函数探针

  1. # function()和function.call是等价的
  2. probe kernel.function("SyS_execve@fs/exec.c:1764").call
  3. probe kernel.function("SyS_execve@fs/exec.c:1764").return
  4. # 语句
  5. probe kernel.statement("generic_make_request@block/blk-core.c:*")
  6. # 所以内核函数加探针,慎用
  7. probe kernel.function("*").call

systemtap内置探针

  1. probe ioblock.*
  2. probe ioscheduler.*
  3. probe ioscheduler_trace.*
  4. # 进入cpu时间片
  5. probe scheduler.cpu_on
  6. # 从cpu时间片切出
  7. probe scheduler.cpu_off