1td_ta_enable_stats(3C_DTBh)reads Debugging Library Functitodn_sta_enable_stats(3C_DB)
2
3
4

NAME

6       td_ta_enable_stats, td_ta_reset_stats, td_ta_get_stats - collect target
7       process statistics for libc_db
8

SYNOPSIS

10       cc [ flag... ] file... -lc_db [ library... ]
11       #include <proc_service.h>
12       #include <thread_db.h>
13
14       td_err_e td_ta_enable_stats(const td_thragent_t *ta_p, int on_off);
15
16
17       td_err_e_stats td_ta_reset(const td_thragent_t *ta_p);
18
19
20       td_err_e td_ta_get_stats(const td_thragent_t *ta_p, td_ta_stats_t *tstats);
21
22

DESCRIPTION

24       The controlling process can request the collection of  certain  statis‐
25       tics  about  a  target  process.   Statistics  gathering is disabled by
26       default. Each target process has a td_ta_stats_t  structure  that  con‐
27       tains current values when statistic gathering is enabled.
28
29
30       The  td_ta_enable_stats() function turns statistics gathering on or off
31       for the process identified by ta_p, depending on whether or not  on_off
32       is non-zero. When statistics gathering is turned on, all statistics are
33       implicitly reset as though td_ta_reset_stats() had been  called.   Sta‐
34       tistics  are not reset when statistics gathering  is turned off. Except
35       for nthreads and r_concurrency, the values do not change  further,  but
36       they remain available for inspection by way of td_ta_get_stats().
37
38
39       The   td_ta_reset_stats()   function   resets   all   counters  in  the
40       td_ta_stats_t structure to zero for the target process.
41
42
43       The td_ta_get_stats() function returns the structure for the process in
44       tstats.
45
46
47       The  td_ta_stats_t  structure  is defined in <thread_db.h> and contains
48       the following members:
49
50         typedef struct {
51            int nthreads;            /* total number of threads in use */
52            int r_concurrency;       /* requested concurrency level */
53            int nrunnable_num;       /* numerator of avg runnable threads */
54            int nrunnable_den;       /* denominator of avg runnable threads */
55            int a_concurrency_num;   /* numerator, avg achieved concurrency */
56            int a_concurrency_den;   /* denominator, avg achieved concurrency */
57            int nlwps_num;           /* numerator, avg number of LWPs in use */
58            int nlwps_den;           /* denominator, avg number of LWPs in use */
59            int nidle_num;           /* numerator, avg number of idling LWPs */
60            int nidle_den;           /* denominator, avg number of idling LWPs */
61         } td_ta_stats_t;
62
63
64
65       The nthreads member is the number of threads that are currently part of
66       the  target process.  The r_concurrency member is the current requested
67       concurrency level, such as would be returned by thr_setconcurrency(3C).
68       The  remaining  members  are  averages  over time, each expressed as  a
69       fraction with an integral numerator and denominator. The  nrunnable_num
70       and  nrunnable_den  members  represent  the  average number of runnable
71       threads.  The a_concurrency_num and a_concurrency_den members represent
72       the  average  achieved  concurrency,  the  number  of  actually running
73       threads.  The a_concurrency_num and a_concurrency_den members are  less
74       than  or  equal  to  nrunnable_num and nrunnable_den, respectively. The
75       nlwps_num and nlwps_den members represent the average number of  light‐
76       weight  processes   (LWPs)  participating in this process. They must be
77       greater than  or  equal  to  a_concurrency_num  and  a_concurrency_den,
78       respectively,  since  every  running thread is assigned to an  LWP, but
79       there can at times be additional idling LWPs with no thread assigned to
80       them.  The nidle_num and nidle_den members represent the average number
81       of idle LWPs.
82

RETURN VALUES

84       TD_OK        The call completed successfully.
85
86
87       TD_BADTA     An invalid internal process handle was passed in.
88
89
90       TD_DBERR     A call to one of the imported interface routines failed.
91
92
93       TD_ERR       Something else went wrong.
94
95

ATTRIBUTES

97       See attributes(5) for description of the following attributes:
98
99
100
101
102       ┌─────────────────────────────┬─────────────────────────────┐
103       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
104       ├─────────────────────────────┼─────────────────────────────┤
105       │MT Level                     │Safe                         │
106       └─────────────────────────────┴─────────────────────────────┘
107

SEE ALSO

109       libc_db(3LIB), thr_getconcurrency(3C), attributes(5)
110
111
112
113SunOS 5.11                        20 Oct 1998        td_ta_enable_stats(3C_DB)
Impressum