G''Day Folks, I''ve found another use of dtrace, this makes your console keyboard sound like a typewriter. http://www.brendangregg.com/DTrace/typewriter-0.70.tar.gz I''ve only tested it on an UltraSPARC 5 and a Pentium laptop so far, more to follow. Ok, sorry, not actually a practical use of DTrace. :) Enjoy! Brendan [Sydney, Australia]
Ganesh Chaudhari
2005-Sep-30 07:59 UTC
[dtrace-discuss] error :invalid address (0x0) in action #2 at DIF offset 28
I executed following 2 small programs just to check the file open and close by a process. The process is running. ##for open dtrace -n ''syscall::open*:entry /execname == "esd"/ {printf("%s----> %s", execname,copyinstr(arg0)); }'' This works fine. ## for close dtrace -n ''syscall::close:entry /execname == "esd"/ {printf("%s----> %s", execname,copyinstr(arg0)); }'' for this i am getting following messages... dtrace: error on enabled probe ID 1 (ID 5677: syscall::close:entry): invalid address (0x0) in action #2 at DIF offset 28 dtrace: error on enabled probe ID 1 (ID 5677: syscall::close:entry): invalid address (0x0) in action #2 at DIF offset 28 dtrace: error on enabled probe ID 1 (ID 5677: syscall::close:entry): invalid address (0x0) in action #2 at DIF offset 28 ............. Did I go wrong somewhere in writing this small code. Thanks for any help, -Ganesh
Manoj Joseph
2005-Sep-30 08:02 UTC
[dtrace-discuss] error :invalid address (0x0) in action #2 at DIF offset 28
Ganesh, Ganesh Chaudhari wrote:> ## for close > > > dtrace -n ''syscall::close:entry > /execname == "esd"/ > {printf("%s----> %s", execname,copyinstr(arg0)); > }'' > > for this i am getting following messages... > > dtrace: error on enabled probe ID 1 (ID 5677: syscall::close:entry): > invalid address (0x0) in action #2 at DIF offset 28 > dtrace: error on enabled probe ID 1 (ID 5677: syscall::close:entry): > invalid address (0x0) in action #2 at DIF offset 28 > dtrace: error on enabled probe ID 1 (ID 5677: syscall::close:entry): > invalid address (0x0) in action #2 at DIF offset 28 > ............. > > > Did I go wrong somewhere in writing this small code.close, unlike open, takes as parameter a file descriptor. Trying to print it as a string will result in the above error. Try printing it as an integer. printf("%s----> %d", execname,arg0); Manoj
Michael Schuster - Sun Germany
2005-Sep-30 08:08 UTC
[dtrace-discuss] error :invalid address (0x0) in action #2 at DIFoffset 28
Ganesh Chaudhari wrote:> > I executed following 2 small programs just to check the file open and > close by a process. The process is running. > > ##for open > > dtrace -n ''syscall::open*:entry > /execname == "esd"/ > {printf("%s----> %s", execname,copyinstr(arg0)); > }'' > > This works fine. > > ## for close > > dtrace -n ''syscall::close:entry > /execname == "esd"/ > {printf("%s----> %s", execname,copyinstr(arg0)); > }'' > > for this i am getting following messages... > > dtrace: error on enabled probe ID 1 (ID 5677: syscall::close:entry): > invalid address (0x0) in action #2 at DIF offset 28 > dtrace: error on enabled probe ID 1 (ID 5677: syscall::close:entry): > invalid address (0x0) in action #2 at DIF offset 28 > dtrace: error on enabled probe ID 1 (ID 5677: syscall::close:entry): > invalid address (0x0) in action #2 at DIF offset 28while open()''s first argument is a path name: int open(const char *path, int oflag, /* mode_t mode */); close()''s isn''t int close(int fildes); you''re trying to copyin a "pointer" which is an int (1,2...), which is invalid. if you want to print the name being closed, you''d best do something like> dtrace -n ''syscall::open*:entry > /execname == "esd"/ > {printf("%s----> %s", execname,copyinstr(arg0));this->name = copyinstr(arg0);> }'' > > This works fine. > > ## for close > > dtrace -n ''syscall::close:entry > /execname == "esd" && this->name /{ printf ("%s----> %s", execname, this->name); this->name = 0;> }'' >or some such - check the documentation for syntactical details. HTH -- Michael Schuster (+49 89) 46008-2974 / x62974 visit the online support center: http://www.sun.com/osc/ Recursion, n.: see ''Recursion''