00001
00009
00010
00011
00012
00013 #ifndef __JTOP_SERVER_INCLUDE_SCOPE_H_
00014 #define __JTOP_SERVER_INCLUDE_SCOPE_H_
00015 #include <l4/dope/dopelib.h>
00016 #include "threadinfo.h"
00017 #include "os.h"
00018
00019 typedef enum{
00020 SCOPE_RELLOAD,
00021 SCOPE_RELTIME,
00022 } scope_disp_t;
00023
00024 typedef struct scope_t {
00025 state_t state;
00026 os_mutex lock;
00027 int id;
00028
00029 const char*win;
00030 const char*scope;
00031 const char*title;
00032
00033 int width;
00034 int height;
00035 void *vscrid;
00036 short *screenaddr;
00037 int pause;
00038 int count;
00039 thread_t *display_tids;
00040 thread_info_t *array;
00041
00042 int threaded;
00043 int idx;
00044 cputime_t avg;
00045 int valid_x;
00046
00047 scope_disp_t key;
00048 cputime_t maxval;
00049 int y_maxval;
00050
00051 cputime_t lastupdate;
00052
00053 cputime_t *values;
00054 cputime_t *avgs;
00055 cputime_t *diffs;
00056 } scope_t;
00057
00058 #define SCOPE_COUNT (sizeof(int)*8)
00059
00060 extern int scope_init(void);
00061 extern int scope_create(int id_parent, int width, int height);
00062
00063 extern inline void scope_lock(scope_t*);
00064 extern inline void scope_unlock(scope_t*);
00065
00066 extern inline void scope_lock(scope_t*scope){
00067 os_mutex_lock(&scope->lock);
00068 }
00069 extern inline void scope_unlock(scope_t*scope){
00070 os_mutex_unlock(&scope->lock);
00071 }
00072
00073 #endif