#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <linux/types.h>
#include <linux/dirent.h>
#include <linux/unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <l4/log/l4log.h>
#include "threadinfo.h"
#include "service.h"
#include "debug.h"
Defines | |
#define | _GNU_SOURCE 1 |
#define | __KERNEL__ |
#define | DIRENT_BUF_SIZE 4096 |
Functions | |
int | getdents (unsigned int fd, struct dirent *dirp, unsigned int count) |
int | getdents (uint fd, struct dirent *dirp, uint count) |
static int | getnum (const char *buf) |
return the number given in buf or -1 if something else | |
int | get_thread_info (thread_t pid, thread_info_t *thread, thread_t *next_pid) |
Return prio and time of a given pid. | |
int | get_thread_name (thread_info_t *thread) |
Return name of a thread, no-op in Linux. | |
int | get_thread_values (load_display_t *disp) |
Read thread-values into load-display struct. |
int get_thread_info | ( | thread_t | pid, | |
thread_info_t * | thread, | |||
thread_t * | next_pid | |||
) |
Return prio and time of a given pid.
The Linux version also returns the name of the thread. Therefore, get_thread_name() is a no-op.
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, no-op in Linux.
Return name of a thread.
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(), and getnum().
Referenced by update_values().