search for: copyinstr

Displaying 20 results from an estimated 31 matches for "copyinstr".

2006 Sep 06
3
Dtrace Snooping
...s like opensnoop and execsnoop etc. My interest is to write a simple script that can snoop the files which uses the 3 syscalls like open,create,unlink. I have gone through dtrace oneliners that can do the same : dtrace -n ''syscall::open*:entry { printf("%s %s",execname,copyinstr(arg0));}'' dtrace -n ''syscall::creat*:entry { printf("%s %s",execname,copyinstr(arg0));}'' dtrace -n ''syscall::unlink*:entry { printf("%s %s",execname,copyinstr(arg0));}'' But how to write a single script that can snoop & list...
2005 Sep 27
2
Invalid address error message
...cate at DIF offset 76 dtrace: error on enabled probe ID 6 (ID 14: syscall::open:entry): invalid address (0xff34e000) in predicate at DIF offset 28 I don''t know how to interpret these error messages. Below is some D-program codes: . . syscall::open:entry /!progenyof($pid) && copyinstr(arg0) == "/opt/SUNWvts/bin/sparcv9/../../lib/sparcv9/libvtstest.so.1"/ { stop(); system("qtracepid.d %d %s &", pid, basename(copyinstr(arg0))); } . . syscall::open:entry /!loaded[copyinstr(arg0)] && !progenyof($pid) && copyinstr(arg0) == "/opt/...
2006 Aug 08
9
Handling userland char ** pointers
I''ve been trying to get access to a userland string that''s behind a second level pointer using DTrace, but I can''t seem to get it to work. I started with the example on the Team DTrace Tips and Tricks slides: trace(copyinstr(*(uintptr_t *)copyin(arg0, curpsinfo->pr_dmodel == PR_MODEL_ILP32 ? 4 : 8))); And when I couldn''t get it to work, I started breaking it down into smaller pieces to see what was going on at each step. Here''s the "C" and "D" code: --- pt.c --- static in...
2008 May 20
6
Dtrace queries - predicates & func arg tracing
[1] Predicates in one-liners I would like to list the probe modules in my executable and then dynamically create a dscript to trace execution of those modules alone (by excluding the 3rd party and system libraries). I tried the below script without success. The conditional given in the predicate is not taking effect. Why is this so ? $ dtrace -ln ''pid$target:::
2005 Sep 08
3
DTrace typewriter
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]
2007 Jul 30
3
dtrace
hi fnds, i want to print the filenames on which the stat system call is acting when a stat system call is invoked. can anyone can help me this regard. Thanks jeevan
2008 Jul 07
2
copyin having secondary effects.
...teh h_alias array the other entries in the array get corrupted. So I have ended up with this script: #!/usr/bin/dtrace -CZs #include <netdb.h> pid$target::gethostbyname_r:return { self->r = (struct hostent *)copyin(arg1, sizeof (struct hostent)); printf("%d Host: %s", pid, copyinstr((uintptr_t)self->r->h_name)); printf(" h_aliases %p ", self->r->h_aliases); self->a = (char **)copyin((uintptr_t)self->r->h_aliases, 4*sizeof (char *)); } #define ALIAS(X) \ pid$target::gethostbyname_r:return \ / self->a[X] != 0 / \ { \ printf("%d h_alias...
2006 May 24
2
Reading external files with dtrace
I''d like to be able to dynamically read external configuration files within a dtrace script. I know dtrace allows inclusion of C header files but only at the preprocessing stage. What we need to do is dynamically enable/disable probes based on current application settings. I''d rather not have a bunch of independant scripts running and being started and killed whenever the
2006 Mar 24
3
Triggering on close of a written file.
...succesfull write of /etc/hosts ( I want to regenerate the nameserver zone files from /etc/hosts after it has changed) At the moment I have the following code: syscall::open*:entry, syscall::creat*:entry { self->file=arg0; } syscall::open*:return, syscall::creat*:return /basename(copyinstr(self->file)) == "hosts"/ { self->hostsfd=arg1; /* printf("Filename=%s fd=%d",basename(copyinstr(self- >file)),arg1); */ } syscall::write:entry /arg0==self->hostsfd/ { /* trace("Write hosts"); */ self->hostswritten=1;...
2006 Mar 16
0
Re: Can dtrace agent of JDK be used in IBM Websphere?
...when accessed the web page and admin console very slow, sometimes occured timeout error. When use ./java_method.d to trace the process of Websphere within the period of startup time. It occured below error: Content of java_method.d: #!/usr/sbin/dtrace -s dvm$target:::method-entry { self->ts[copyinstr(arg0),copyinstr(arg1)] = vtimestamp; } dvm$target:::method-return { @ts[copyinstr(arg0),copyinstr(arg1)] = sum(vtimestamp - self->ts[copyinstr(arg0),copyinstr(arg1)]); } Error message: .................. dtrace: error on enabled probe ID 1 (ID 5644: dvm2514:libdvmpi.so:cbMethodEntry: method-e...
2007 Oct 01
1
strange problem on SXDE3
...DE3. ] ./jpg1.d dtrace: failed to compile script ./jpg1.d: "/usr/lib/dtrace/iscsi.d", line 94: syntax error near "uiscsiproto_t" Doesn''t matter what script. Even classic oneliners such as: ] dtrace -n ''syscall::open*:entry { printf("%s % s",execname,copyinstr(arg0)); }'' bomb in this way... dtrace: invalid probe specifier syscall::open*:entry { printf("%s % s",execname,copyinstr(arg0)); }: "/usr/lib/dtrace/iscsi.d", line 94: syntax error near "uiscsiproto_t" Thing is, I have another machine (a laptop, 32 bit) tha...
2009 Aug 18
2
Change syslog output
...n web page, and i know i can ignore it. I thinking about how can i delete from console only these messages (here is my first version, what is not (so) elegant): #!/usr/sbin/dtrace -qs #pragma D option destructive syscall::write:entry / execname == "syslogd" && (self->class = copyinstr(arg1)) != NULL && 90 < strlen(self->class) / { self->addr = arg1; copyoutstr("Clear nxge_ipp_eccue_valid_check messages", self->addr, 100); } Problems with this script: 1. It change all syslog messages what is longer then 90 character. I can''t...
2009 Jul 24
9
getting extra characters with printf(copyin(a, b))
Hi, I have a situation where a DTrace script is printing out extra characters, despite the copyin() call giving a specific length. Can anyone think of why this might be? It''s fine the first time all of the probes fire, but on a second run of my generating operations, I get junk in there. For example: set setop length 5, FOUND KEY, STORED set setop length 5, FOUND KEY, STORED get
2008 Sep 30
12
dtrace missing ''unlinkat''? showing process stack?
everyone, Just out of curiosity, I did a dtrace -n ''syscall:::entry { @num[execname, probefunc] = count(); }'' and looked at the entries produced by ''rm''. I see everything that rm did, *except* the unlinkat - which is unfortunate because I want to trace which processes have deleted which files. So - does dtrace contain unlinkat as a probe for a system call?
2005 Jul 28
3
speculative tracing on nevada builds ?
...on nevada builds 14, 17 and 19 (the only builds I have access to). I set dtrace_err_verbose=1 but didn''t get any more information. #!/usr/sbin/dtrace -s syscall::open:entry { self->spec = speculation(); speculate(self->spec); printf("%s", stringof(copyinstr(arg0))); } syscall::open:return /self->spec && errno != 0/ { commit(self->spec); self->spec = 0; } syscall::open:return /self->spec && errno == 0/ { discard(self->spec); self->spec = 0; } Anyone got any ideas whats going on ? Ch...
2005 Aug 12
3
Funny output from write syscall
I have a clause that look like this: syscall::write:entry /execname == "ntpd" && self->recspec/ { speculate(self->recspec); printf(" fd=%d buf=%d\n%s",arg0,arg2, stringof(copyin(arg1,arg2-1))); } The ntpd program always write a \n trminated string in this context, so I used the "arg2-1" to drop the \n. This works
2007 Aug 09
8
Dtrace - Segmentation Fault
After building and bfu''in the lastest ON build, any time I run a dtrace script I get a Seg Fault. Is there a dtrace for dtrace :) Doug root at prae> dtrace -n ''syscall::open*:entry { printf("%s %s",execname,copyinstr(arg0)); }'' Segmentation Fault (core dumped) root at prae> pstack core core ''core'' of 101364: dtrace -n syscall::open*:entry { printf("%s %s",execname,copyinstr(arg fffffd7fff30826a dt_ident_cook () + 32 fffffd7fff31a011 dt_cook_func () + 21 fffffd7fff31d6...
2007 Jul 10
17
all open files
Hi All, Is there a simple way to list all currently open file descriptors ? TIA.. Regards, Venkat -- This message posted from opensolaris.org
2007 Apr 18
3
dtrace-discuss: cannot get a ''string'' to print...
hi, I''m using the PID provider to trace a 32-bit app, prtdiag. I''m trying to print the value of "propname" (arg1) in the following func: int picl_get_propval_by_name(picl_nodehdl_t nodeh, const char *propname, void *valbuf, size_t nbytes) ... i''ve tried many versions, but this is a representative one: 53 this string propname; 54 55
2008 Jul 11
1
hangs when doing open /pro/pid/psinfo
I got a system that is hung, unable to do most unix commands like ps/who etc... I did: dtrace -c /usr/bin/ps -n ''pid$target::open*:entry {printf("%s %s",execname,copyinstr(arg0)); }'' and it hangs here: 7 65277 open:entry ps /proc/19729/psinfo 7 65277 open:entry ps /proc/11687/psinfo ^C So, I tried to kill -9 11687, but that returns with nothing. If I do "ls /proc", I still see it. I am unable to...