Eric Schrock wrote: > On Sat, Aug 25, 2007 at 10:45:10AM +0800, zhijun wrote: > >> I really appreciate your kindness to explain this for me. >> >> ::array ... p | ::eval '<p/Kn | =Kn' gives pure uintptr_t's so it works >> well with mdb pipeline. What I am suprized is that ::array ... p | /Kn >> *doesn't* give pure uintptr_t's, as its output has an address in the first >> line, so I expect it will break the mdb pipeline, but instead it works. Am >> I missing anything here? >> >> > > As mentioned in the original mail, dcmds have a way of 'knowing' when > they are in pipe context (DCMD_PIPE_OUT) and can alter their output > based on this. For the '/' operator, you can find this check in > print_arglist(): > > if (DCMD_HDRSPEC(flags) && (flags & DCMD_PIPE_OUT) == 0) { > Hi Eric,
Yes, after trying some dtrace scripts I now understand what you really mean here. > Are you just curious, or are you trying to solve a particular problem? > Mainly as I am curious, as I didn't even know about the different behaviour of dcmds with pipeline. > As Jonathan mentioned, there are more efficient ways to accomplish what > you have demonstrated thus far. > Yes, ::map is a good way to go. Thanks for the help all the way. BTW: I really wish the document for mdb ( or somewhere else) could include some examples for dcmds and walkers, it would make our lives easier than simply doing ::help eval and ::help map and wondering what are these dcmds for :-) Best regards, and have a good day Zhijun > - Eric > > -- > Eric Schrock, Solaris Kernel Development http://blogs.sun.com/eschrock > _______________________________________________ > mdb-discuss mailing list > mdb-discuss at opensolaris.org > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/mdb-discuss/attachments/20070826/058ff1e6/attachment.html>