Robert Milkowski
2005-Dec-22 07:30 UTC
[dtrace-discuss] Problem with USDT and not faulted-in pages
Hi. We''re putting USDT probes into our application. What we have just encountered is that sometimes when we want to get string from an address given by our probe we get error. Thanks to Bryan who explained that it''s due to page not being faulted-in. We put probes in our code which looks like: DTRACE_PROBE5(ZZZZ, WWWW, s->path, "RETR", fd, size, YYYYYY); So arg1 for this probe is just a constant string "RETR". Now if we enable that probe sometimes we get errors like: bash-3.00# dtrace -n ZZZZ:AAA::WWWW''{printf("%x %d %s\n",arg1,pid,copyinstr(arg1));}'' dtrace: description ''QQQQQQQ'' matched 3 probes dtrace: error on enabled probe ID 1 (ID 28939:QQQQQQQQQQQQ):invalid address (0xffffffff7d304000) in action #3 at DIF offset 28 As this system is doing a lot of IOs I assume that sometimes page containing "RETR" is on faulted-in. Any ideas how to best guarantee that probe will work all the time properly (I mean we can do copyinstr(arg1))? And another one small thing - pointer xffffffff7d304000 which is printed in an error message is an page address not an actual pointer to "RETR" - at least on SPARC. I assume there''s a reason why DTrace can''t give you actual pointer - but maybe there''s other way to get it? I was also thinking - if copyinstr() can''t be performed then whole probe actions aren''t executed - sometimes (special marker/option?) it would be useful if actions which can be performed were executed (in this case printf would work except for copyinstr(arg1) argument - "<INVALID>" value?). This message posted from opensolaris.org