> I would like to see how the number of concurrent jobs in cron queue  
> changes. I have located the piece of code I would be interested in:
> http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/cron/cron.c#2057
>
> Can you please tell me how could I get the current value of qp->nrun?

You'll want to instrument the entry probe for the ex() function:

   pidXXX::ex:entry

The qp variable comes from an index into a global array. You'll need  
to use
another tool like mdb to determine the location of that variable,  
embed that
location in the code, and use arg0 to determine e->etype as the index  
into
the global array. Bear in mind, DTrace doesn't yet support types from  
user
processes, so you'll need to either include those header files or define
the types yourself.

Take a look at the chapter on user-land tracing to get started:

   http://wikis.sun.com/display/DTrace/User+Process+Tracing

> I tried:
> dtrace -n 'pid27208:cron:: '
> dtrace: description 'pid27208:cron:: ' matched 324 probes
> CPU ID FUNCTION:NAME
> 0 55937 main:37c
> 0 55938 main:380
> 0 55939 main:384
> 0 55940 main:388
> 0 55941 main:38c
> 0 55942 main:390
> 0 55943 main:394
> A lot more...
>
> but I do not get the functions names...

What you've done there is instrument every instruction in the cron  
binary --
probably not what you had in mind :-)

> Is DTRACE the correct tool to get such values?

It might be easier to use mdb(1).

Adam

--
Adam Leventhal, Fishworks                        http://blogs.sun.com/ahl

_______________________________________________
dtrace-discuss mailing list
[email protected]

Reply via email to