hi folks i''m new to dtrace, so my apologies if this question is daft. i was wondering, would it be feasible (in the future) to somehow make mdb dcmds available to dtrace, so that dtrace could, say, printf a string''ified version of the result of applying a walker to an address? i''m thinking along the lines of something like this: printf("%<dcmd::dcmd_for_struct>", mystruct); (the motivation for asking is that i''d like to add some walkers to mdb and i''d love to have access to them within dtrace without having to write D scripts that have to pull them apart too - i.e. laziness ;-)...) as i say, probably a dumb question, but i thought i''d ask... thanks! alan This message posted from opensolaris.org
On Thu, 8 Jun 2006, Alan Maguire wrote:> hi folks > > i''m new to dtrace, so my apologies if this question is daft. i was wondering, would it be feasible (in the future) to somehow make mdb dcmds available to dtrace, so that dtrace could, say, printf a string''ified version of the result of applying a walker to an address? i''m thinking along the lines of something like this: > > printf("%<dcmd::dcmd_for_struct>", mystruct); > > (the motivation for asking is that i''d like to add some walkers to mdb and i''d love to have access to them within dtrace without having to write D scripts that have to pull them apart too - i.e. laziness ;-)...)That is a super good idea. As part of some of my recent work, I have wanted to dump a struct foo when a probe fires. If something like this does come to fruition, hopefully the DTrace folks will allow all types (including user defined types) to be displayed. - Ryan -- UNIX Administrator http://daemons.net/~matty
actually, digging around, it seems like translators will solve my particular problem: http://docs.sun.com/app/docs/doc/817-6223/6mlkidlo0?q=dtrace&a=view sorry for the noise! alan This message posted from opensolaris.org
Hi Alan, I can say with near certainty that it will never be possible to execute arbitrary mdb dcmds from probe context. However, a long standing RFE has been to support ::print-like functionality: 4968681 would like ::printf-like functionality in DTrace It''s doable, it''s just a ton of work. If anyone''s interested in giving it a shot, let me know and I''ll walk you through the necessary steps. Adam On Thu, Jun 08, 2006 at 05:28:14AM -0700, Alan Maguire wrote:> hi folks > > i''m new to dtrace, so my apologies if this question is daft. i was wondering, would it be feasible (in the future) to somehow make mdb dcmds available to dtrace, so that dtrace could, say, printf a string''ified version of the result of applying a walker to an address? i''m thinking along the lines of something like this: > > printf("%<dcmd::dcmd_for_struct>", mystruct); > > (the motivation for asking is that i''d like to add some walkers to mdb and i''d love to have access to them within dtrace without having to write D scripts that have to pull them apart too - i.e. laziness ;-)...) > > as i say, probably a dumb question, but i thought i''d ask... > > thanks! > > alan > > > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Solaris Kernel Development http://blogs.sun.com/ahl
hi Adam actually, the ::print functionality is exactly what i need! i''d certainly be interested in working on this but i doubt i could devote a massive amount of time. maybe we could discuss the details off-alias and i could blog about the topic so others could chip in too if they''re interested (and maybe we could spin off an OpenSolaris project to work on this down the line). thanks very much! alan This message posted from opensolaris.org