jtop.c File Reference

JTop main. More...

#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


Detailed Description

JTop main.

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

Function Documentation

int activity ( int  ms  )  [inline]

Calculates an activity from a given ms.

Parameters:
ms time in milliseconds
Return values:
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.

Parameters:
t time in os-spec units
buf buffer
size size of buffer
Returns:
ptr to filled-in buf, or 0 for error (buf too small)

Referenced by disp_ftime().

static char* disp_ftime ( timedisp_t  key,
cputime_t  t,
char *  buf,
int  size 
) [static]

Format time according to timekey.

Parameters:
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
Returns:
ptr to filled-in buf, or 0 for error (buf too small)

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.

Note:
The message has a limit on its printed length, about 100byte.

static void select_callback ( dope_event *  ev,
void *  arg 
) [static]

Callback for switch button.

Parameters:
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.

Precondition:
The caller should hold the disp-lock

References get_thread_values().

Referenced by sort_callback(), and subwindow_create().


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