#include "op_libiberty.h"
#include "opd_parse_proc.h"
#include "opd_proc.h"
#include "opd_mapping.h"
#include "opd_image.h"
#include "opd_printf.h"
#include "op_file.h"
#include "op_fileio.h"
#include <dirent.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Go to the source code of this file.
Functions | |
static int | opd_add_ascii_map (struct opd_proc *proc, char const *line, char *const image_name) |
static void | opd_get_ascii_maps (struct opd_proc *proc) |
static u32 | read_tgid (u32 tid) |
void | opd_get_ascii_procs (void) |
Parsing of /proc/pid
Definition in file opd_parse_proc.c.
static int opd_add_ascii_map | ( | struct opd_proc * | proc, | |
char const * | line, | |||
char *const | image_name | |||
) | [static] |
opd_add_ascii_map - parse an ASCII map string for a process
proc | process to add map to | |
line | 0-terminated ASCII string | |
image_name | the binary application name |
Attempt to parse the string
The parsing is based on Linux 2.4 format, which looks like this :
4001e000-400fc000 r-xp 00000000 03:04 31011 /lib/libc-2.1.2.so
Definition at line 43 of file opd_parse_proc.c.
References opd_add_mapping(), opd_get_image(), opd_proc::tgid, and opd_proc::tid.
Referenced by opd_get_ascii_maps().
static void opd_get_ascii_maps | ( | struct opd_proc * | proc | ) | [static] |
opd_get_ascii_maps - read all maps for a process
proc | process to work on |
Read the /proc/<pid>/maps file and add all mapping information found to the process .
Definition at line 92 of file opd_parse_proc.c.
References opd_map::image, list_empty(), list_entry, list_for_each, opd_proc::maps, opd_proc::name, opd_image::name, list_head::next, opd_map::next, op_close_file(), op_get_line(), op_try_open_file(), opd_add_ascii_map(), opd_add_mapping(), opd_get_image(), opd_proc::tgid, opd_proc::tid, verbprintf, and vmisc.
Referenced by opd_get_ascii_procs().
void opd_get_ascii_procs | ( | void | ) |
opd_get_ascii_procs - read process and mapping information from /proc
Read information on each process and its mappings from the /proc filesystem.
Definition at line 199 of file opd_parse_proc.c.
References opd_get_ascii_maps(), opd_get_proc(), opd_new_proc(), pid, read_tgid(), opd_proc::tgid, verbprintf, and vmisc.
Referenced by opd_24_start().
Definition at line 165 of file opd_parse_proc.c.
References op_close_file(), op_get_line(), op_try_open_file(), and opd_image::tgid.
Referenced by opd_get_ascii_procs().