threadinfo.h File Reference

Prototypes for getting thread information. More...

#include "os.h"
#include "service.h"

Go to the source code of this file.

Data Structures

struct  thread_info_t
struct  load_display_t

Defines

#define THREAD_NAME_LEN   15

Enumerations

enum  sort_t {
  SORT_NOTHING, SORT_TID, SORT_NAME, SORT_PRIO,
  SORT_LOAD, SORT_TIME
}
enum  timedisp_t { TIME_RELLOAD, TIME_ABSTIME, TIME_RELTIME, TIME_COUNT }

Functions

int check_list (thread_info_t **listp)
 Check that the ptr contains a valid list-element.
int check_array (int to_size, thread_info_t ***arrp, int *size)
int get_thread_info (thread_t tid, thread_info_t *thread, thread_t *next)
 Return prio and time of a given pid.
int get_thread_name (thread_info_t *thread)
 Return name of a thread.
int get_thread_values (load_display_t *disp)
 Read thread-values into load-display struct.


Detailed Description

Prototypes for getting thread information.

Date:
01/14/2004
Author:
Jork Loeser <jork.loeser@inf.tu-dresden.de>

Function Documentation

int check_list ( thread_info_t **  listp  ) 

Check that the ptr contains a valid list-element.

Return values:
0 ok
1 allocating memory failed

Referenced by get_thread_values().

int get_thread_info ( thread_t  pid,
thread_info_t *  thread,
thread_t *  next_pid 
)

Return prio and time of a given pid.

This function fills: tid, prio, abstime

Returns:
0 on success, !0 else
Return values:
next contains the next thread-id
The Linux version also returns the name of the thread. Therefore, get_thread_name() is a no-op.

This function fills: tid, prio, name, abstime

Parameters:
next_pid ignored
Returns:
-1 on error, 0 else

Referenced by get_thread_values(), and scope_update().

int get_thread_name ( thread_info_t *  thread  ) 

Return name of a thread.

This function fills: name

Returns:
1 on error, 0 else

Referenced by get_thread_values().

int get_thread_values ( load_display_t *  disp  ) 

Read thread-values into load-display struct.

This function reads the current thread information into the given struct. The entries are read from the /proc filesystem. This functions only modifies the following arguments:

disp->list list of thread-infos, unsorted

Return values:
disp->list_size number of valid elements in list
disp->array array of thread-infos, tid-sorted
disp->array_size number of allocated array-elements
list and array are allocated as needed, reusing previously allocated fields.

Precondition:
Not reentrant, Must not be called in parallel.

References check_list(), get_thread_info(), get_thread_name(), and getnum().

Referenced by update_values().


Generated on Wed Apr 11 06:39:34 2012 for JTop - Top for DROPS by  doxygen 1.5.6