Cross reference for ta/ta.c of index.

# File ta/ta.c

      $Revision: 1.11 $

      thread accounting (ta). ta.c - functions to keep track of activities
                                of threads within the server

      Status: NOT REVUED, TESTED, COMPLETE

      Design and implementation by: Marek Bukowy

## Included Files

- `#include "/home/shane/code/RIP/include/rip.h"`
  - `#include </home/shane/code/RIP/include/config.h>`
  - `#include <sys/param.h>`
  - `#include </ncc/dbwork/platforms/yucca-debug/glib-indep/include/glib-1.2/glib.h>`
  - `#include "/home/shane/code/RIP/include/AU_util.h"`
    - `#include <stdio.h>`
    - `#include <stdlib.h>`
    - `#include <string.h>`
    - `#include <sys/types.h>`
    - `#include <unistd.h>`
    - `#include <regex.h>`
    - `#include <glib.h>`
  - `#include "/home/shane/code/RIP/include/aa.h"`
    - `#include "/home/shane/code/RIP/include/iproutines.h"`
      - `#include <sys/types.h>`
      - `#include <glib.h>`
      - `#include </home/shane/code/RIP/include/inet6def.h>`
      - `#include </home/shane/code/RIP/include/erroutines.h>`
  - `#include "/home/shane/code/RIP/include/access_control.h"`
    - `#include "/home/shane/code/RIP/include/erroutines.h"`
    - `#include "/home/shane/code/RIP/include/iproutines.h"`
    - `#include "/home/shane/code/RIP/include/rxroutines.h"`
      - `#include <glib.h>`
      - `#include <pthread.h>`
      - `#include <stubs.h>`
      - `#include </home/shane/code/RIP/include/memwrap.h>`
      - `#include <stdio.h>`
      - `#include <iproutines.h>`
      - `#include <erroutines.h>`
      - `#include "/home/shane/code/RIP/include/sk.h"`
        - `#include "/home/shane/code/RIP/include/stubs.h"`
        - `#include <sys/time.h>`
        - `#include <unistd.h>`
        - `#include <sys/types.h>`
        - `#include <sys/socket.h>`
        - `#include <netinet/in.h>`
        - `#include <netdb.h>`
        - `#include <pthread.h>`
        - `#include <stdlib.h>`
        - `#include <errno.h>`
        - `#include <fcntl.h>`
        - `#include <signal.h>`
        - `#include <stdio.h>`
        - `#include "/home/shane/code/RIP/include/iproutines.h"`
      - `#include "/home/shane/code/RIP/include/thread.h"`
    - `#include "/home/shane/code/RIP/include/mysql_driver.h"`
      - `#include "/usr/local/mysql/include/mysql/mysql.h"`
        - `#include <sys/types.h>`
        - `#include "/usr/local/mysql/include/mysql/mysql_com.h"`
        - `#include "/usr/local/mysql/include/mysql/mysql_version.h"`
      - `#include "/usr/local/mysql/include/mysql/mysqld_error.h"`
      - `#include "/home/shane/code/RIP/include/erroutines.h"`
  - `#include "/home/shane/code/RIP/include/bitmask.h"`
  - `#include "/home/shane/code/RIP/include/ca_adminAttribs.h"`
  - `#include "/home/shane/code/RIP/include/ca_configFns.h"`
    - `#include "/home/shane/code/RIP/include/ca_defs.h"`
      - `#include <pthread.h>`
      - `#include <glib.h>`
    - `#include <memwrap.h>`
    - `#include <erroutines.h>`
  - `#include "/home/shane/code/RIP/include/ca_defs.h"`
  - `#include "/home/shane/code/RIP/include/ca_dictionary.h"`
  - `#include "/home/shane/code/RIP/include/ca_macros.h"`
    - `#include "/home/shane/code/RIP/include/ca_adminAttribs.h"`
  - `#include "/home/shane/code/RIP/include/ca_srcAttribs.h"`
  - `#include "/home/shane/code/RIP/include/comparisons.h"`
  - `#include "/home/shane/code/RIP/include/constants.h"`
    - `#include <glib.h>`
  - `#include "/home/shane/code/RIP/include/defs.h"`
    - `#include <glib.h>`
    - `#include "/home/shane/code/RIP/include/bitmask.h"`
    - `#include "/home/shane/code/RIP/include/DF_class_enum.def"`
    - `#include "/home/shane/code/RIP/include/DF_class_mask.def"`
    - `#include "/home/shane/code/RIP/include/DF_attribute_enum.def"`
    - `#include "/home/shane/code/RIP/include/DF_attribute_inv_attr_mask.def"`
    - `#include "/home/shane/code/RIP/include/which_keytypes.h"`
      - `#include "/home/shane/code/RIP/include/bitmask.h"`
    - `#include "/home/shane/code/RIP/include/iproutines.h"`
    - `#include "/home/shane/code/RIP/include/rxroutines.h"`
  - `#include "/home/shane/code/RIP/include/er_arrays.h"`
    - `#include "/home/shane/code/RIP/include/erroutines.h"`
  - `#include "/home/shane/code/RIP/include/er_aspects.h"`
  - `#include "/home/shane/code/RIP/include/er_facilities.h"`
  - `#include "/home/shane/code/RIP/include/er_formats.h"`
  - `#include "/home/shane/code/RIP/include/er_macro.h"`
    - `#include "/home/shane/code/RIP/include/sk.h"`
  - `#include "/home/shane/code/RIP/include/er_paths.h"`
    - `#include <sys/param.h>`
    - `#include <glib.h>`
  - `#include "/home/shane/code/RIP/include/er_yacc_helper.h"`
  - `#include "/home/shane/code/RIP/include/erroutines.h"`
  - `#include "/home/shane/code/RIP/include/fdwrap.h"`
    - `#include <stdio.h>`
  - `#include "/home/shane/code/RIP/include/mg_getopt.h"`
  - `#include "/home/shane/code/RIP/include/globaldefs.h"`
  - `#include "/home/shane/code/RIP/include/gpg.h"`
    - `#include <netdb.h>`
    - `#include <unistd.h>`
    - `#include "/home/shane/code/RIP/include/mail_parser.h"`
      - `#include "/home/shane/code/RIP/include/gpg.h"`
      - `#include "/home/shane/code/RIP/include/memwrap.h"`
  - `#include "/home/shane/code/RIP/include/inet6def.h"`
  - `#include "/home/shane/code/RIP/include/iproutines.h"`
  - `#include "/home/shane/code/RIP/include/mail_parser.h"`
  - `#include "/home/shane/code/RIP/include/memwrap.h"`
  - `#include "/home/shane/code/RIP/include/mm.h"`
    - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/mail.h"`
      - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/linkage.h"`
    - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/osdep.h"`
      - `#include <string.h>`
      - `#include <sys/types.h>`
      - `#include <stdlib.h>`
      - `#include <dirent.h>`
      - `#include <fcntl.h>`
      - `#include <unistd.h>`
      - `#include <time.h>`
      - `#include <utime.h>`
      - `#include <syslog.h>`
      - `#include <sys/file.h>`
      - `#include <ustat.h>`
      - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/env_unix.h"`
        - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/env.h"`
      - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/fs.h"`
      - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/ftl.h"`
      - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/nl.h"`
      - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/tcp.h"`
      - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/lockfix.h"`
    - `#include "/home/shane/code/RIP/include/gpg.h"`
    - `#include "/home/shane/code/RIP/include/mail_parser.h"`
    - `#include "/home/shane/code/RIP/include/memwrap.h"`
    - `#include "/ncc/dbwork/platforms/yucca-debug/glib-indep/include/glib-1.2/glib.h"`
  - `#include "/home/shane/code/RIP/include/mysql_driver.h"`
  - `#include "/home/shane/code/RIP/include/nh.h"`
    - `#include <mysql_driver.h>`
  - `#include "/home/shane/code/RIP/include/notification.h"`
    - `#include <stdarg.h>`
    - `#include <stdio.h>`
    - `#include <strings.h>`
    - `#include <unistd.h>`
    - `#include <stdlib.h>`
    - `#include <time.h>`
    - `#include <glib.h>`
    - `#include "/home/shane/code/RIP/include/UP_util.h"`
      - `#include "/home/shane/code/RIP/include/syntax_api.h"`
  - `#include "/home/shane/code/RIP/include/numconv.h"`
  - `#include "/home/shane/code/RIP/include/pc_commands.h"`
  - `#include "/home/shane/code/RIP/include/properties.h"`
  - `#include "/home/shane/code/RIP/include/protocol_config.h"`
  - `#include "/home/shane/code/RIP/include/protocol_mirror.h"`
    - `#include <glib.h>`
    - `#include "/home/shane/code/RIP/include/mysql_driver.h"`
    - `#include "/home/shane/code/RIP/include/iproutines.h"`
    - `#include "/home/shane/code/RIP/include/aa.h"`
      - `#include "/home/shane/code/RIP/include/iproutines.h"`
  - `#include "/home/shane/code/RIP/include/protocol_whois.h"`
    - `#include "/home/shane/code/RIP/include/query_command.h"`
      - `#include <glib.h>`
      - `#include "/home/shane/code/RIP/include/bitmask.h"`
      - `#include "/home/shane/code/RIP/include/sk.h"`
  - `#include "/home/shane/code/RIP/include/query_command.h"`
  - `#include "/home/shane/code/RIP/include/query_instructions.h"`
    - `#include "/home/shane/code/RIP/include/rxroutines.h"`
    - `#include "/home/shane/code/RIP/include/iproutines.h"`
    - `#include "/home/shane/code/RIP/include/mysql_driver.h"`
    - `#include "/home/shane/code/RIP/include/query_command.h"`
    - `#include "/home/shane/code/RIP/include/defs.h"`
    - `#include "/home/shane/code/RIP/include/which_keytypes.h"`
    - `#include "/home/shane/code/RIP/include/access_control.h"`
    - `#include "/home/shane/code/RIP/include/ca_configFns.h"`
    - `#include "/home/shane/code/RIP/include/ca_dictionary.h"`
    - `#include "/home/shane/code/RIP/include/ca_macros.h"`
    - `#include "/home/shane/code/RIP/include/ca_srcAttribs.h"`
  - `#include "/home/shane/code/RIP/include/rp.h"`
    - `#include <stddef.h>`
    - `#include <glib.h>`
    - `#include <pthread.h>`
    - `#include <defs.h>`
    - `#include <iproutines.h>`
    - `#include <erroutines.h>`
    - `#include <rxroutines.h>`
    - `#include <mysql_driver.h>`
    - `#include "/home/shane/code/RIP/include/ca_defs.h"`
    - `#include <thread.h>`
  - `#include "/home/shane/code/RIP/include/rxroutines.h"`
  - `#include "/home/shane/code/RIP/include/server.h"`
  - `#include "/home/shane/code/RIP/include/sk.h"`
  - `#include "/home/shane/code/RIP/include/stubs.h"`
  - `#include "/home/shane/code/RIP/include/syntax_api.h"`
  - `#include "/home/shane/code/RIP/include/ta.h"`
    - `#include <glib.h>`
    - `#include <pthread.h>`
    - `#include <stdio.h>`
    - `#include "/home/shane/code/RIP/include/stubs.h"`
    - `#include "/home/shane/code/RIP/include/memwrap.h"`
    - `#include "/home/shane/code/RIP/include/sk.h"`
    - `#include "/home/shane/code/RIP/include/timediff.h"`
      - `#include <sys/time.h>`
  - `#include "/home/shane/code/RIP/include/thread.h"`
  - `#include "/home/shane/code/RIP/include/timediff.h"`
  - `#include "/home/shane/code/RIP/include/ud.h"`
  - `#include "/home/shane/code/RIP/include/ud_int.h"`
    - `#include <stdio.h>`
    - `#include <strings.h>`
    - `#include <glib.h>`
    - `#include <stdlib.h>`
    - `#include <ctype.h>`
    - `#include <unistd.h>`
    - `#include "/home/shane/code/RIP/include/defs.h"`
    - `#include "/home/shane/code/RIP/include/mysql_driver.h"`
    - `#include "/home/shane/code/RIP/include/iproutines.h"`
    - `#include "/home/shane/code/RIP/include/erroutines.h"`
    - `#include "/home/shane/code/RIP/include/rp.h"`
    - `#include "/home/shane/code/RIP/include/nh.h"`
    - `#include "/home/shane/code/RIP/include/sk.h"`
    - `#include "/home/shane/code/RIP/include/memwrap.h"`
    - `#include "/home/shane/code/RIP/include/ca_configFns.h"`
    - `#include "/home/shane/code/RIP/include/ca_dictionary.h"`
    - `#include "/home/shane/code/RIP/include/ca_macros.h"`
    - `#include "/home/shane/code/RIP/include/ca_srcAttribs.h"`
    - `#include "/home/shane/code/RIP/include/globaldefs.h"`
    - `#include "/home/shane/code/RIP/include/bitmask.h"`
    - `#include "/home/shane/code/RIP/include/which_keytypes.h"`
  - `#include "/home/shane/code/RIP/include/ud_tr.h"`
    - `#include "/home/shane/code/RIP/include/ud_int.h"`
  - `#include "/home/shane/code/RIP/include/ut_string.h"`
  - `#include "/home/shane/code/RIP/include/wh_queries.h"`
    - `#include "/home/shane/code/RIP/include/sk.h"`
  - `#include "/home/shane/code/RIP/include/which_keytypes.h"`

## Preprocessor definitions

`#define TA_IMPL`

`#define TA_HEADER "%-8s %15s %4s %4s %5s %5s %4s %6s %s\n"`

`#define TA_FORMAT "%-8s %15s %4d %4lu %5.1f %5.1f %4d %6.3f %s\n"`

## Global Variable Lock

`pthread_mutex_t Lock`

Included from | /home/shane/code/RIP/include/ca_defs.h
Visible in: |  | aa/aa.c
|  | ac/access_control.c
|  | ca/ca_configFns.c
|  | ca/ca_initFn.c
|  | ca/ca_sanityCheck.c
|  | ca/ca_sourceLoader.c
|  | ca/ca_values.c
|  | co/constants.c
|  | df/defs.c
|  | er/er.c
|  | er/er_arrays.c
|  | er/er_macro.c
|  | er/er_paths.c
|  | er/er_print.c
|  | ip/ip.c
|  | ma/bitmask.c
|  | mm/mm.c
|  | nh/nh.c
|  | pa/gpg.c
|  | pa/spawn.c
|  | pc/pc_commands.c
|  | pc/protocol_config.c
|  | pm/pm_serials.c
|  | pm/protocol_mirror.c
|  | pr/properties.c
|  | pw/protocol_whois.c
|  | qc/mg_getopt.c
|  | qc/query_command.c
|  | qi/query_instructions.c
|  | rp/rp_convert.c
|  | rp/rp_load.c
|  | rp/rp_search.c
|  | rp/rp_tree.c
|  | rp/rp_update.c
|  | rx/rx_node.c
|  | rx/rx_print.c
|  | rx/rx_search.c
|  | rx/rx_tree.c
|  | sk/cd_socket.c
|  | sk/cd_watchdog.c
|  | sk/sk_socket.c
|  | sq/mysql_driver.c
|  | sv/server.c
|  | ta/ta.c
Used in: | ca_get_adminIntElement() | ca/ca_configFns.c
| ca_get_adminStrElement() | ca/ca_configFns.c
| ca_get_boolean() | ca/ca_configFns.c
| ca_get_dirlist() | ca/ca_configFns.c
| ca_get_int() | ca/ca_configFns.c
| ca_get_string() | ca/ca_configFns.c
| ca_set_boolean() | ca/ca_configFns.c
| ca_srchandle2Intelement() | ca/ca_configFns.c
| ca_srchandle2Strelement() | ca/ca_configFns.c

## Global Variable ta_list

`GList* ta_list`

Included from | /home/shane/code/RIP/include/ta.h
Visible in: |  | ta/ta.c
Used in: | TA_add() | ta/ta.c
| TA_delete() | ta/ta.c
| TA_increment() | ta/ta.c
| TA_reset_counters() | ta/ta.c
| TA_setactivity() | ta/ta.c
| TA_setcondat() | ta/ta.c
| TA_tostring() | ta/ta.c
| TA_trigger() | ta/ta.c

## Global Variable ta_mutex

`pthread_mutex_t ta_mutex`

Included from | /home/shane/code/RIP/include/ta.h
Visible in: |  | ta/ta.c
Used in: | TA_add() | ta/ta.c
| TA_delete() | ta/ta.c
| TA_increment() | ta/ta.c
| TA_reset_counters() | ta/ta.c
| TA_setactivity() | ta/ta.c
| TA_setcondat() | ta/ta.c
| TA_tostring() | ta/ta.c
| TA_trigger() | ta/ta.c

## Global Function TA_add()

      Public adding function - adds the current thread to the list,
      storing the given socket and type string along.

`void TA_add ( int sock, char* type )`

`int sock`
  associated socket (if any, or 0 if not)
`char* type`
  type string

Prototyped in: | /home/shane/code/RIP/include/ta.h
Calls: | ta_findcreate_l() | ta/ta.c
| ta_setactivity_l() | ta/ta.c
| UT_timeget(), pthread_mutex_lock(), pthread_mutex_unlock(), pthread_self(), snprintf()
Called by: | AC_decay() | ac/access_control.c
| PM_interact() | pm/protocol_mirror.c
| RP_sql_load_reg() | rp/rp_load.c
| SV_do_child() | sv/server.c
| main_loop() | sv/server.c
References Variables: | ta_list | ta/ta.c
| ta_mutex | ta/ta.c

## Global Function TA_delete()

      Public deletion function - deletes the current thread from the list.

`void TA_delete ( void )`

Prototyped in: | /home/shane/code/RIP/include/ta.h
Calls: | ta_remove_l() | ta/ta.c
| pthread_mutex_lock(), pthread_mutex_unlock(), pthread_self()
Called by: | AC_decay() | ac/access_control.c
| PM_interact() | pm/protocol_mirror.c
| RP_sql_load_reg() | rp/rp_load.c
| SV_do_child() | sv/server.c
| main_loop() | sv/server.c
References Variables: | ta_list | ta/ta.c
| ta_mutex | ta/ta.c

## Global Function TA_increment()

       increments the event counter for the current thread.

`void TA_increment ( void )`

Prototyped in: | /home/shane/code/RIP/include/ta.h
Calls: | ta_findcreate_l() | ta/ta.c
| UT_timeget(), pthread_mutex_lock(), pthread_mutex_unlock(), pthread_self()
Called by: | PC_interact() | pc/protocol_config.c
| PW_interact() | pw/protocol_whois.c
| RP_sql_load_attr_space() | rp/rp_load.c
| main_loop() | sv/server.c
References Variables: | ta_list | ta/ta.c
| ta_mutex | ta/ta.c

## Global Function TA_reset_counters()

      resets the time and event counter of a specified thread.

`void TA_reset_counters ( pthread_t thread_id )`

`pthread_t thread_id`
  thread_id

Prototyped in: | /home/shane/code/RIP/include/ta.h
Calls: | ta_findonly_l() | ta/ta.c
| UT_timeget(), pthread_mutex_lock(), pthread_mutex_unlock()
References Variables: | ta_list | ta/ta.c
| ta_mutex | ta/ta.c

## Global Function TA_setactivity()

      Public activity-setting function - sets the current activity string
      for the current thread.

`void TA_setactivity ( char* activity )`

`char* activity`
  new value

Prototyped in: | /home/shane/code/RIP/include/ta.h
Calls: | ta_findcreate_l() | ta/ta.c
| ta_setactivity_l() | ta/ta.c
| pthread_mutex_lock(), pthread_mutex_unlock(), pthread_self()
Called by: | AC_decay() | ac/access_control.c
| PC_interact() | pc/protocol_config.c
| PM_interact() | pm/protocol_mirror.c
| PW_interact() | pw/protocol_whois.c
| RP_sql_load_attr_space() | rp/rp_load.c
| main_loop() | sv/server.c
References Variables: | ta_list | ta/ta.c
| ta_mutex | ta/ta.c

## Global Function TA_setcondat()

      Public condat-setting function - associates a connection data
      structure with the current thread.

`void TA_setcondat ( sk_conn_st* condat )`

`sk_conn_st* condat`
  pointer to a connection data structure

Prototyped in: | /home/shane/code/RIP/include/ta.h
Calls: | ta_findcreate_l() | ta/ta.c
| pthread_mutex_lock(), pthread_mutex_unlock(), pthread_self()
Called by: | PW_interact() | pw/protocol_whois.c
References Variables: | ta_list | ta/ta.c
| ta_mutex | ta/ta.c

## Global Function TA_tostring()

      Compiles a list of the threads' data records as text.

`char* TA_tostring ( void )`

`char* TA_tostring`
  returns an allocated text, must be freed after use.

Prototyped in: | /home/shane/code/RIP/include/ta.h
Calls: | ta_print_header() | ta/ta.c
| ta_printone_l() | ta/ta.c
| UT_malloc_real(), UT_realloc_real(), UT_timeget(), g_list_first(), pthread_mutex_lock(), pthread_mutex_unlock(), strcat(), strcpy(), strlen()
Called by: | show_threads() | pc/pc_commands.c
References Variables: | ta_list | ta/ta.c
| ta_mutex | ta/ta.c

## Global Function TA_trigger()

      Finds a thread of the matching type, socket file descriptor and thread id
      and executes the watchdog's triggers if it's defined.

`void TA_trigger ( char* type, int sock, pthread_t thread_id )`

`char* type`
  thread type string
`int sock`
  socket #
`pthread_t thread_id`
  thread id

Prototyped in: | /home/shane/code/RIP/include/ta.h
Calls: | SK_watchtrigger() | sk/cd_watchdog.c
| ta_findonly_l() | ta/ta.c
| pthread_mutex_lock(), pthread_mutex_unlock(), strcmp()
References Variables: | ta_list | ta/ta.c
| ta_mutex | ta/ta.c

## Local Function asctime_r()

`static char* asctime_r ( const struct tm* __tm, char* __buf )`

Included from: | /usr/include/time.h
Calls: | __posix_asctime_r()

## Local Function ctime_r()

`static char* ctime_r ( const time_t* __time, char* __buf )`

Included from: | /usr/include/time.h
Calls: | __posix_ctime_r()

## Local Function getlogin_r()

`static int getlogin_r ( char* __name, int __len )`

Included from: | /usr/include/unistd.h
Calls: | __posix_getlogin_r()

## Local Function readdir_r()

`static int readdir_r ( DIR* __dp, struct dirent* __ent, struct dirent** __res )`

Included from: | /usr/include/dirent.h
Calls: | __posix_readdir_r()

## Local Function sigwait()

`static int sigwait ( const sigset_t* __setp, int* __signo )`

Included from: | /usr/include/signal.h
Calls: | __posix_sigwait()

## Local Function ta_findcreate_l()

      Finds a thread by thread_id, or creates a new entry if there isn't one.
      Assumes locked list.

`static ta_str_t* ta_findcreate_l ( GList** list, pthread_t thread_id )`

`ta_str_t* ta_findcreate_l`
  returns a pointer to the thread's record
`GList** list`
  thread list
`pthread_t thread_id`
  thread id

Calls: | ta_findonly_l() | ta/ta.c
| UT_calloc_real(), g_list_append()
Called by: | TA_add() | ta/ta.c
| TA_increment() | ta/ta.c
| TA_setactivity() | ta/ta.c
| TA_setcondat() | ta/ta.c

## Local Function ta_findonly_l()

      Finds a thread by thread_id. Assumes locked list.

`static ta_str_t* ta_findonly_l ( GList** list, pthread_t thread_id )`

`ta_str_t* ta_findonly_l`
  returns a pointer to the thread's record
`GList** list`
  thread list
`pthread_t thread_id`
  thread id

Calls: | g_list_first()
Called by: | TA_reset_counters() | ta/ta.c
| TA_trigger() | ta/ta.c
| ta_findcreate_l() | ta/ta.c

## Local Function ta_print_header()

      prints a header for a list of threads to a specified buffer.
      The output is truncated if the buffer is too small.

`static void ta_print_header ( char* buf, unsigned length )`

`char* buf`
  pointer to the buffer
`unsigned length`
  buffer size

Calls: | snprintf()
Called by: | TA_tostring() | ta/ta.c

## Local Function ta_printone_l()

      Formats the data from one thread's record to an entry for a list of
      threads.  Prints to a specified buffer. Calculates the average time
      spent per event as well as the lifetime of the thread. Checks the
      address of the peer on the socket. The output is truncated if the
      buffer is too small.

`static void ta_printone_l ( ta_str_t* tas, char* buf, unsigned length, ut_timer_t* reftime )`

`ta_str_t* tas`
  pointer to the thread's record
`char* buf`
  pointer to the buffer
`unsigned length`
  buffer size
`ut_timer_t* reftime`
  current time

Calls: | SK_getpeername() | sk/sk_socket.c
| UT_free_real(), UT_timediff(), snprintf()
Called by: | TA_tostring() | ta/ta.c

## Local Function ta_remove_l()

      finds and removes an entry for a thread given by thread_id.
      Assumes locked list.

`static void ta_remove_l ( GList** list, pthread_t thread_id )`

`GList** list`
  thread list
`pthread_t thread_id`
  thread id

Calls: | g_list_first(), g_list_remove_link(), wr_real_clear_list()
Called by: | TA_delete() | ta/ta.c

## Local Function ta_setactivity_l()

      sets the activity field in the given thread's record.
      Truncates the string if too long.

`static void ta_setactivity_l ( ta_str_t* tas, char* activity )`

`ta_str_t* tas`
  pointer to the thread's record
`char* activity`
  new value for the activity field

Calls: | strncpy(), strrchr()
Called by: | TA_add() | ta/ta.c
| TA_setactivity() | ta/ta.c

## Local Function ttyname_r()

`static int ttyname_r ( int __fildes, char* __buf, size_t __size )`

Included from: | /usr/include/unistd.h
Calls: | __posix_ttyname_r()