#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <l4/dope/dopelib.h>
#include <l4/log/l4log.h>
#include "startup.h"
#include "os.h"
#include "threadinfo.h"
#include "service.h"
#include "subwindow.h"
#include "jtop.h"
#include "scope.h"
#include "debug.h"
Defines | |
#define | MAX_ACTIVITY_TIME 5000 |
Functions | |
void | message (const char *f,...) |
Send a message to the user. | |
static void | message_callback (dope_event *ev, void *arg) |
static void | select_callback (dope_event *ev, void *arg) |
Callback for switch button. | |
static void | backup_values (load_display_t *disp) |
static int | fixup_values (load_display_t *disp) |
int | activity (int) |
Calculates an activity from a given ms. | |
char * | canonicaltime (time_t t, char *buf, int size) |
Format time: <1ms: µs, <1s: ms, <1min: s, <1h: min. | |
static char * | disp_ftime (timedisp_t key, cputime_t t, char *buf, int size) |
Format time according to timekey. | |
static int | update_dope (load_display_t *disp) |
int | update_values (load_display_t *disp) |
Update a display. | |
static void | update_thread (void *arg) |
int | main (int argc, char **argv) |
Variables | |
char | LOG_tag [9] = "jtop" |
long | app_id |
int | update_interval = 1000 |
int activity | ( | int | ms | ) | [inline] |
Calculates an activity from a given ms.
ms | time in milliseconds |
0..256 | 256 for short time, 0 for >5seconds |
char * canonicaltime | ( | time_t | t, | |
char * | buf, | |||
int | size | |||
) | [inline] |
Format time: <1ms: µs, <1s: ms, <1min: s, <1h: min.
t | time in os-spec units | |
buf | buffer | |
size | size of buffer |
Referenced by disp_ftime().
static char* disp_ftime | ( | timedisp_t | key, | |
cputime_t | t, | |||
char * | buf, | |||
int | size | |||
) | [static] |
Format time according to timekey.
key | timekey | |
t | time itself, in os-specific units. If key==TIME_RELLOAD, real value is 1/10th of given one. | |
buf | buffer, at least 11 bytes | |
size | size of buffer |
References canonicaltime().
void message | ( | const char * | f, | |
... | ||||
) |
Send a message to the user.
This function opens a window with the message printed in. Later, when the grid-widget is fixed, a status line might be used.
static void select_callback | ( | dope_event * | ev, | |
void * | arg | |||
) | [static] |
Callback for switch button.
arg | a jtop_callback_t type, which win and idx set. win is the window-id, idx is the nr of the row (0..) |
References disp_by_nr().
int update_values | ( | load_display_t * | disp | ) |
Update a display.
If new threads appear, the dope-grid is adapted. This is adding new values, and changing the size of the frame.
References get_thread_values().
Referenced by sort_callback(), and subwindow_create().