Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get command arguments with D-trace on OSX

Tags:

macos

dtrace

I'm trying to preview run commands with the args with D-trace. I tried something like this:

sudo dtrace -n 'syscall::execve:return {printf("%s\n", curpsinfo->pr_psargs);}'

But on OSX this code returns only commands names not their args.

I find this forum thread but code in last answer doesn't works for me.

like image 738
Maciek Sawicki Avatar asked Sep 26 '11 14:09

Maciek Sawicki


1 Answers

with a little help of my colleague we manage to fix script mentioned in question. This is correct one. The problem was that forum markup removed some * and _ chars.

like image 200
Maciek Sawicki Avatar answered Oct 31 '22 15:10

Maciek Sawicki