opd_parse_proc.c File Reference

#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>
Include dependency graph for opd_parse_proc.c:

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)

Detailed Description

Parsing of /proc/pid

Remarks:
Copyright 2002 OProfile authors
Read the file COPYING
Author:
John Levon
Philippe Elie

Definition in file opd_parse_proc.c.


Function Documentation

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

Parameters:
proc process to add map to
line 0-terminated ASCII string
image_name the binary application name

Attempt to parse the string

and add the info to the process . Returns 1 on success, 0 otherwise.

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().

Here is the call graph for this function:

Here is the caller graph for this function:

static void opd_get_ascii_maps ( struct opd_proc proc  )  [static]

opd_get_ascii_maps - read all maps for a process

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

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

static u32 read_tgid ( u32  tid  )  [static]

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().

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on 8 Nov 2012 for Oprofile by  doxygen 1.6.1