> Hello everyone:)
> 
> I've got a couple of questions and I'll be very thankful if someone can shed 
> a light on these.
> 
> 1) For example, I want to print proc_t structure of process "bc"
> I tried the following variant but stucked at the this stage
> 
> ::walk proc p |::print proc_t p_user.u_comm
> 
> After that I've got result :
> ...
> p_user.u_comm = [ "ttymon" ]
> p_user.u_comm = [ "bc" ]
> ....
> 
> What dcmd should I use to search for "bc" and then get the pointer to its 
> proc_t structure back?
> Or I have to use "|:: print -a proc_t p_user.u_comm" and then use sed or awk 
> to extract address and then pipe it again? 
> 
> I think of using then ::eval<p=K to get back to "p" variable after the search.

You can use the ::pgrep dcmd for this purpose: it will give you back the
same type of output as ::ps but only for the matching names. 
 
> 2) Can someone explain the ::map syntax to me or point me when some examples
> of this dcmd's usage can be found?

::map takes the value of dot (.) on the left-hand side, evals an expression
that is its argument, and outputs the new value of dot.  This is useful
sometimes in pipelines (e.g. take a list of addresses and add offset 20 to
them).  Here's a contrived example just to show you what it looks like:

> 100,5=Kn4+
                100             
                104             
                108             
                10c             
                110             

> 100,5=Kn4+ | ::map '. + 200'
300
304
308
30c
310

-Mike

-- 
Mike Shapiro, Solaris Kernel Development. blogs.sun.com/mws/

Reply via email to