Threads Debugging Library Functions tdtaenablestats(3CDB)
NAME
tdtaenablestats, tdtaresetstats, tdtagetstats -
collect target process statistics for libcdb
SYNOPSIS
cc [ flag... ] file... -lcdb [ library... ]
#include
#include
tderre tdtaenablestats(const tdthragentt *tap, int onoff);
tderrestats tdtareset(const tdthragentt *tap);
tderre tdtagetstats(const tdthragentt *tap, tdtastatst *tstats);
DESCRIPTION
The controlling process can request the collection of cer-
tain statistics about a target process. Statistics gather-
ing is disabled by default. Each target process has a
tdtastatst structure that contains current values when
statistic gathering is enabled.
The tdtaenablestats() function turns statistics gathering
on or off for the process identified by tap, depending on
whether or not onoff is non-zero. When statistics gathering
is turned on, all statistics are implicitly reset as though
tdtaresetstats() had been called. Statistics are not
reset when statistics gathering is turned off. Except for
nthreads and rconcurrency, the values do not change
further, but they remain available for inspection by way of
tdtagetstats().
The tdtaresetstats() function resets all counters in the
tdtastatst structure to zero for the target process.
The tdtagetstats() function returns the structure for the
process in tstats.
The tdtastatst structure is defined in and
contains the following members:
typedef struct {
int nthreads; /* total number of threads in use */
int rconcurrency; /* requested concurrency level */
int nrunnablenum; /* numerator of avg runnable threads */
SunOS 5.11 Last change: 20 Oct 1998 1
Threads Debugging Library Functions tdtaenablestats(3CDB)
int nrunnableden; /* denominator of avg runnable threads */
int aconcurrencynum; /* numerator, avg achieved concurrency */
int aconcurrencyden; /* denominator, avg achieved concurrency */
int nlwpsnum; /* numerator, avg number of LWPs in use */
int nlwpsden; /* denominator, avg number of LWPs in use */
int nidlenum; /* numerator, avg number of idling LWPs */
int nidleden; /* denominator, avg number of idling LWPs */
} tdtastatst;
The nthreads member is the number of threads that are
currently part of the target process. The rconcurrency
member is the current requested concurrency level, such as
would be returned by thrsetconcurrency(3C). The remaining
members are averages over time, each expressed as a frac-
tion with an integral numerator and denominator. The
nrunnablenum and nrunnableden members represent the aver-
age number of runnable threads. The aconcurrencynum and
aconcurrencyden members represent the average achieved
concurrency, the number of actually running threads. The
aconcurrencynum and aconcurrencyden members are less
than or equal to nrunnablenum and nrunnableden, respec-
tively. The nlwpsnum and nlwpsden members represent the
average number of lightweight processes (LWPs) participat-
ing in this process. They must be greater than or equal to
aconcurrencynum and aconcurrencyden, respectively, since
every running thread is assigned to an LWP, but there can
at times be additional idling LWPs with no thread assigned
to them. The nidlenum and nidleden members represent the
average number of idle LWPs.
RETURN VALUES
TDOK The call completed successfully.
TDBADTA An invalid internal process handle was passed
in.
TDBER A call to one of the imported interface rou-
tines failed.
TDER Something else went wrong.
ATRIBUTES
See attributes(5) for description of the following attri-
butes:
SunOS 5.11 Last change: 20 Oct 1998 2
Threads Debugging Library Functions tdtaenablestats(3CDB)
ATRIBUTE TYPE ATRIBUTE VALUE
MT Level Safe
SEE ALSO
libcdb(3LIB), thrgetconcurrency(3C), attributes(5)
SunOS 5.11 Last change: 20 Oct 1998 3
|