0

This dtrace script will fire every time any function is called in libx by process 12345.

dtrace -q -n 'pid12345:libx::entry { printf("probe fired"); }'

But what I really want is to detect function calls in several libraries, say libx, liby, and libz... something like:

dtrace -q -n 'pid12345:libx,liby,libz::entry { printf("probe fired"); }'

Does anyone know if this is possible using the pid provider - or any other provider?

Thanks!

user2048466
  • 185
  • 3
  • 13

2 Answers2

0

I think I found the answer to my own question, but would welcome any other suggestions. The solution I found is to add multiple comma-separated probes:

dtrace -q -n 'pid12345:libx::entry, pid12345:liby::entry, pid12345:libz::entry { printf("probe fired"); }'
user2048466
  • 185
  • 3
  • 13
0

You can use globbing in the probe description, e.g.

dtrace -q -n 'pid12345:lib[xyz].so::entry { printf("probe fired"); }'
Robert Harris
  • 1,522
  • 9
  • 11