00001
00009
00010
00011
00012
00013 #ifndef __JTOP_SERVER_INCLUDE_THREADINFO_H_
00014 #define __JTOP_SERVER_INCLUDE_THREADINFO_H_
00015
00016 #include "os.h"
00017 #include "service.h"
00018
00019 typedef enum sort_t{
00020 SORT_NOTHING,
00021 SORT_TID,
00022 SORT_NAME,
00023 SORT_PRIO,
00024 SORT_LOAD,
00025 SORT_TIME,
00026 } sort_t;
00027
00028
00029 typedef enum timedisp_t{
00030 TIME_RELLOAD,
00031 TIME_ABSTIME,
00032 TIME_RELTIME,
00033 TIME_COUNT,
00034 } timedisp_t;
00035
00036 #define THREAD_NAME_LEN 15
00037
00038 typedef struct thread_info_t{
00039 thread_t tid;
00040 cputime_t abstime;
00041 int load;
00042 cputime_t timedisp;
00043
00044
00045
00046
00047 long prio;
00048 char name[THREAD_NAME_LEN];
00049 cputime_t birthday;
00050 int select;
00051 struct load_display_t *disp;
00052 struct thread_info_t *next;
00053 } thread_info_t;
00054
00055
00056 typedef struct load_display_t{
00057 state_t state;
00058 os_mutex lock;
00059 int id;
00060
00061 const char*win;
00062 const char*grid;
00063 const char*title;
00064
00065 int rows;
00066 sort_t sortkey;
00067 timedisp_t timekey;
00068 int selected;
00069 cputime_t time_sel_sum;
00070
00071 int height;
00072
00073 thread_t *display_tids;
00074 int display_tids_size;
00075
00076 thread_info_t *list;
00077 int list_size;
00078 thread_info_t **array;
00079 int array_size;
00080
00081 thread_info_t *old_list;
00082 int old_list_size;
00083 thread_info_t **old_array;
00084 int old_array_size;
00085
00086 thread_info_t **sorted;
00087
00088 int sorted_size;
00089
00090 struct load_display_t*prev;
00091 struct load_display_t*next;
00092 } load_display_t;
00093
00094 extern int check_list(thread_info_t**listp);
00095 extern int check_array(int to_size, thread_info_t***arrp, int*size);
00096
00097 extern int get_thread_info(thread_t tid, thread_info_t *thread, thread_t*next);
00098 extern int get_thread_name(thread_info_t *thread);
00099 extern int get_thread_values(load_display_t *disp);
00100
00101 #endif