Michael Iatrou
2006-Jun-15 10:21 UTC
[dtrace-discuss] Translator from kthread_t * to psinfo_t * undefined
Hi, <p> I am trying to use AppCrash (described here: <a href="http://developers.sun.com/solaris/articles/app_crash/app_crash.html">Enabling User-Controlled Collection of Application Crash Data With DTrace</a>) but the following error pops up: </p> <p><tt> # ./app_crash_global.d<br> dtrace: failed to compile script ./app_crash_global.d: line 6: translator for args[1] from kthread_t * to psinfo_t * is not defined </tt></p> <p> app_crash_global.d: </p> <p><tt> 1 #!/usr/sbin/dtrace -qws<br> 2 #pragma D option strsize=512<br> 3<br> 4 proc:::signal-send<br> 5 /(args[2] == SIGBUS || args[2] == SIGSEGV || args[2] == SIGABRT) &&<br> 6 pid == args[1]->pr_lwpid/<br> 7 {<br> 8 stop();<br> 9<br> 10 system(<br> 11 "%s=%d; %s=%d; %s=%d; %s=%s; %s=%d; %s %s %s %s %s %s %s %s %s %s",<br> 12 "CRASH_PID", pid,<br> 13 "CRASH_UID", uid,<br> 14 "DTRACE_UID", $uid,<br> 15 "PROG", execname,<br> 16 "SIG", args[2],<br> 17 "[ $SIG -ne 6 ] && /bin/pldd $CRASH_PID|/bin/grep libjvm>/dev/null && exit 0;",<br> 18 "[ ! -r /etc/app_crash_global ] && exit 0;",<br> 19 "SCRIPT=`/bin/cat /etc/app_crash_global`;",<br> 20 "[ -z \"$SCRIPT\" -o ! -x \"$SCRIPT\" ] && exit 0;",<br> 21 "if [ $DTRACE_UID -eq 0 -a $CRASH_UID -ne 0 ] ; then",<br> 22 " USER_NAME=`/bin/getent passwd $CRASH_UID|/bin/cut -d: -f1`;",<br> 23 " /bin/su $USER_NAME -c \"$SCRIPT $CRASH_PID $PROG $SIG\";",<br> 24 "else ",<br> 25 " $SCRIPT $CRASH_PID $PROG $SIG; ",<br> 26 "fi"<br> 27 );<br> 28<br> 29 system("/bin/prun %d", pid);<br> 30 }<br> </tt></p> <p><tt> # uname -a<br> SunOS myhost 5.10 Generic_118844-28 i86pc i386 i86pc </tt></p> <p> Any ideas? </p> <p> TIA </p> This message posted from opensolaris.org
Jonathan Adams
2006-Jun-15 18:15 UTC
[dtrace-discuss] Translator from kthread_t * to psinfo_t * undefined
On Thu, Jun 15, 2006 at 03:21:01AM -0700, Michael Iatrou wrote:> Hi, > > <p> > I am trying to use AppCrash (described here: <a href="http://developers.sun.com/solaris/articles/app_crash/app_crash.html">Enabling User-Controlled Collection of Application Crash Data With DTrace</a>) but the following error pops up: > </p> > > <p><tt> > # ./app_crash_global.d<br> > dtrace: failed to compile script ./app_crash_global.d: line 6: translator for args[1] from kthread_t * to psinfo_t * is not defined > </tt></p> > > <p> > app_crash_global.d: > </p> > > <p><tt> > 1 #!/usr/sbin/dtrace -qws > 2 #pragma D option strsize=512 > 3 > 4 proc:::signal-send > 5 /(args[2] == SIGBUS || args[2] == SIGSEGV || args[2] == SIGABRT) && > 6 pid == args[1]->pr_lwpid/^^^^^^^^^^^^^^^^^^^^^^^^ First, this comparison doesn''t make any sense; lwpids and pids are in different namespaces. Secondly: # dtrace -lv -n proc:::signal-send ID PROVIDER MODULE FUNCTION NAME 263 proc genunix sigtoproc signal-send ... Argument Types args[0]: lwpsinfo_t * args[1]: psinfo_t * args[2]: int args[1] is a psinfo_t, not a lwpsinfo_t, so it doesn''t have a pr_lwpid field. So your predicate should look like: 5 /(args[2] == SIGBUS || args[2] == SIGSEGV || args[2] == SIGABRT) && 6 pid == args[1]->pr_pid/ But your error message is odd, so I''m not sure the above will work for you. Does it? Cheers, - jonathan> 7 { > 8 stop(); > 9 > 10 system( > 11 "%s=%d; %s=%d; %s=%d; %s=%s; %s=%d; %s %s %s %s %s %s %s %s %s %s", > 12 "CRASH_PID", pid, > 13 "CRASH_UID", uid, > 14 "DTRACE_UID", $uid, > 15 "PROG", execname, > 16 "SIG", args[2], > 17 "[ $SIG -ne 6 ] && /bin/pldd $CRASH_PID|/bin/grep libjvm>/dev/null && exit 0;", > 18 "[ ! -r /etc/app_crash_global ] && exit 0;", > 19 "SCRIPT=`/bin/cat /etc/app_crash_global`;", > 20 "[ -z \"$SCRIPT\" -o ! -x \"$SCRIPT\" ] && exit 0;", > 21 "if [ $DTRACE_UID -eq 0 -a $CRASH_UID -ne 0 ] ; then", > 22 " USER_NAME=`/bin/getent passwd $CRASH_UID|/bin/cut -d: -f1`;", > 23 " /bin/su $USER_NAME -c \"$SCRIPT $CRASH_PID $PROG $SIG\";", > 24 "else ", > 25 " $SCRIPT $CRASH_PID $PROG $SIG; ", > 26 "fi" > 27 ); > 28 > 29 system("/bin/prun %d", pid); > 30 } > </tt></p> > > <p><tt> > # uname -a<br> > SunOS myhost 5.10 Generic_118844-28 i86pc i386 i86pc > </tt></p> > > <p> > Any ideas? > </p> > > <p> > TIA > </p> > > > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Jonathan Adams, Solaris Kernel Development
Michael Iatrou
2006-Jun-16 11:14 UTC
[dtrace-discuss] Re: Translator from kthread_t * to psinfo_t *
Thanks for your reply, I made the recommended change but I still get the same error message. This message posted from opensolaris.org
Jonathan Adams
2006-Jun-16 20:34 UTC
[dtrace-discuss] Re: Translator from kthread_t * to psinfo_t *
On Fri, Jun 16, 2006 at 04:14:05AM -0700, Michael Iatrou wrote:> Thanks for your reply, I made the recommended change but I still get > the same error message.What is the output of: echo "::showrev -v" | mdb -k on your system? Cheers, - jonathan -- Jonathan Adams, Solaris Kernel Development
Michael Iatrou
2006-Jun-19 14:55 UTC
[dtrace-discuss] Re: Re: Translator from kthread_t * to psinfo_t *
# echo "::showrev -v" | mdb -k Patch: 118844-02 Objects: bl Patch: 118844-09 Objects: mm shmsys Patch: 118844-12 Objects: uppc rootnex pseudo isa pci pci-ide objmgr pci_pci pcmcia Patch: 118844-16 Objects: ehci usba Patch: 118844-19 Objects: dtrace doorfs profile fbt ctf lockstat systrace sdt Patch: 118844-20 Objects: ohci Patch: 118844-23 Objects: pcplusmp ata fasttrap Patch: 118844-24 Objects: unix krtld specfs ufs procfs pts Patch: 118844-28 Objects: icmp spdsock Patch: 118860-01 Objects: consconfig_dacf conskbd kbtrans consms Patch: 118993-03 Objects: scsi Patch: 119013-02 Objects: crypto Patch: 119013-03 Objects: kcf Patch: 119375-08 Objects: sd Patch: 119716-07 Objects: scsi_vhci Patch: 119833-02 Objects: gld Patch: 120035-01 Objects: mntfs Patch: 120081-02 Objects: bmc Patch: 120084-01 Objects: arp Patch: 120252-03 Objects: st Patch: 120538-06 Objects: md Patch: 120662-05 Objects: rpcmod Patch: 120665-01 Objects: tl Patch: 120666-01 Objects: busra Patch: 121338-01 Objects: tlimod Version: Generic Objects: devfs TS TS_DPTBL options clone sad fssnap_if pcihp hpcsvc cmdk snlb dadk gda strategy ctfs tmpfs objfs md5 swrand sha1 ip6 tcp tcp6 udp6 sctp sctp6 icmp6 timod wc iwscn elfexec random ldterm ttcompat asy ptsl ptc rts nca fifofs sysmsg cn pipe namefs intpexec rtls sysevent lofs dump fdfs devinfo cryptoadm log kstat sy sysacct IA RT RT_DPTBL semsys ipc msgsys ksyms pset pool ptm ptem fssnap lofi fdc fd poll zmod ramdisk ippctl ecpp winlock cpuid kmdb pem llc1 vni logindmux bufmod Version: Generic_118844-28 Objects: pci_autoconfig acpica mac dld dls vgatext terminal-emulator ibtl openeepr aggr kmdbmod Version: NWSC Objects: iscsi fp fcp fctl fcsm fcip Version: SunOS Development Objects: genunix sockfs ip udp ipsecesp ipsecah keysock portfs pfil ipf Version: Unknown Objects: emlxs qlc bmlic xsvc This message posted from opensolaris.org