SunOS man pages : td_ta_get_stats (3)
Threads Library Functions td_ta_enable_stats(3THR)
NAME
td_ta_enable_stats, td_ta_reset_stats, td_ta_get_stats -
collect target process statistics for libthread_db
SYNOPSIS
cc [ flag ... ] file ... -lthread_db [ library ... ]
#include <proc_service.h>
#include <thread_db.h>
td_err_e td_ta_enable_stats(const td_thragent_t *ta_p, int
on_off);
td_err_e _statstd_ta_reset(const td_thragent_t *ta_p);
td_err_e td_ta_get_stats(const td_thragent_t *ta_p,
td_ta_stats_t *tstats);
DESCRIPTION
The controlling process may request the collection of cer-
tain statistics about a target process. Statistics gather-
ing is disabled by default; however, each target process has
a td_ta_stats_t structure that contains up to date values
when statistic gathering is enabled. td_ta_enable_stats()
turns statistics gathering on or off for the process identi-
fied by ta_p depending on whether or not on_off is non-
zero. When statistics gathering is turned on, all statis-
tics are implicitly reset as though td_ta_reset_stats() had
been called. Statistics are not reset when statistics gath-
ering is turned off. Except for nthreads and
r_concurrency, the values do not change further, but they
remain available for inspection by way of td_ta_get_stats().
td_ta_reset_stats() resets all counters in the
td_ta_stats_t structure to zero for the target process.
td_ta_get_stats() returns the td_ta_stats_t structure for
the process in *stats_t . The td_ta_stats_t structure is
defined as follows:
typedef struct {
int nthreads; /* total number of threads in use */
int r_concurrency; /* requested concurrency level */
int nrunnable_num; /* numerator of avg. runnable threads */
int nrunnable_den; /* denominator of avg. runnable threads */
int a_concurrency_num; /* numerator, avg. achieved concurrency */
int a_concurrency_den; /* denominator, avg. achieved concurrency */
int nlwps_num; /* numerator, average number of LWPs in use */
int nlwps_den; /* denominator, avg. number of LWPs in use */
int nidle_num; /* numerator, avg. number of idling LWPs */
int nidle_den; /* denominator, avg. number of idling LWPs */
} td_ta_stats_t;
SunOS 5.8 Last change: 20 Oct 1998 1
Threads Library Functions td_ta_enable_stats(3THR)
nthreads is the number of threads that are currently part of
the target process. r_concurrency is the current requested
concurrency level, such as would be returned by
thr_setconcurrency(3THR) The remaining fields are averages
over time, each expressed as a fraction with an integral
numerator and denominator. nrunnable is the average number
of runnable threads. a_concurrency is the average achieved
concurrency, the number of actually running threads.
a_concurrency is less than or equal to nrunnable. nlwps is
the average number of lightweight processes ( LWPs) parti-
cipating in this process. It must be greater than or equal
to a_concurrency, as every running thread is assigned to an
LWP, but there may at times be additional idling LWPs with
no thread assigned to them. nidle is the average number of
idle LWPs.
RETURN VALUES
TD_OK The call completed successfully.
TD_BADTA
An invalid internal process handle was passed in.
TD_DBERR
A call to one of the imported interface routines
failed.
TD_ERR
Something else went wrong.
ATTRIBUTES
See attributes(5) for description of the following attri-
butes:
____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| MT Level | Safe |
|_____________________________|_____________________________|
SEE ALSO
libthread_db(3THR), thr_getconcurrency(3THR),
libthread_db(3LIB), attributes(5)
SunOS 5.8 Last change: 20 Oct 1998 2
|
 |
|
|