NAME | SYNOPSIS | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO
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);
The controlling process may request the collection of certain statistics about a target process. Statistics gathering 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 identified by ta_p depending on whether or not on_off is non-zero. When statistics gathering is turned on, all statistics are implicitly reset as though td_ta_reset_stats() had been called. Statistics are not reset when statistics gathering 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;
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 ( LWP s) participating 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 LWP s with no thread assigned to them. nidle is the average number of idle LWP s.
The call completed successfully.
An invalid internal process handle was passed in.
A call to one of the imported interface routines failed.
Something else went wrong.
See attributes(5) for description of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
MT Level | Safe |
NAME | SYNOPSIS | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO