Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ td_ta_enable_stats(3T) — SunOS 5.6

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

libthread_db(3T)

thr_getconcurrency(3T)

libthread_db(4)

attributes(5)

td_ta_enable_stats(3T)

NAME

td_ta_enable_stats, td_ta_reset_stats, td_ta_get_stats − collect target process statistics for libthread_db

SYNOPSIS

cc [ flag ... ] file ... /lib/libthread_db.so.1 [ 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 td_ta_reset_stats(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 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 LWP’s in use ∗/
   int  nlwps_den;/∗ denominator, avg. number of LWP’s in use ∗/
   int  nidle_num;/∗ numerator, avg. number of idling LWP’s ∗/
   int  nidle_den;/∗ denominator, avg. number of idling LWP’s ∗/
} 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(3T).  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. 

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 attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
MT Level Safe

SEE ALSO

libthread_db(3T), thr_getconcurrency(3T), libthread_db(4), attributes(5)

SunOS 5.6  —  Last change: 7 Jan 1997

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026