#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. |
int check_list | ( | thread_info_t ** | listp | ) |
Check that the ptr contains a valid list-element.
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
next | contains the next thread-id |
This function fills: tid, prio, name, abstime
next_pid | ignored |
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
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
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 |
References check_list(), get_thread_info(), get_thread_name(), and getnum().
Referenced by update_values().