opd_mapping.c File Reference

#include "opd_mapping.h"
#include "opd_proc.h"
#include "opd_image.h"
#include "opd_printf.h"
#include "op_interface.h"
#include "op_config_24.h"
#include "op_libiberty.h"
#include <sys/mman.h>
#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
Include dependency graph for opd_mapping.c:

Go to the source code of this file.

Functions

void opd_cleanup_hash_name (void)
void opd_init_hash_map (void)
void opd_kill_maps (struct opd_proc *proc)
void opd_add_mapping (struct opd_proc *proc, struct opd_image *image, unsigned long start, unsigned long offset, unsigned long end)
static char * get_from_pool (uint ind)
static char const * opd_get_hash_name (int hash)
void opd_handle_mapping (struct op_note const *note)

Variables

static struct op_hash_indexhashmap
static char const * hash_name [OP_HASH_MAP_NR]

Detailed Description

Management of process mappings

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

Definition in file opd_mapping.c.


Function Documentation

static char* get_from_pool ( uint  ind  )  [inline, static]

get_from_pool - retrieve string from hash map pool

Parameters:
ind index into pool

Definition at line 99 of file opd_mapping.c.

References OP_HASH_MAP_NR.

Referenced by opd_get_hash_name().

Here is the caller graph for this function:

void opd_add_mapping ( struct opd_proc proc,
struct opd_image image,
unsigned long  start,
unsigned long  offset,
unsigned long  end 
)

opd_put_mapping - add a mapping to a process

Parameters:
proc process to add map to
image mapped image pointer
start start of mapping
offset file offset of mapping
end end of mapping

Add the mapping specified to the process proc growing the maps array if necessary.

Definition at line 68 of file opd_mapping.c.

References opd_map::end, opd_map::image, list_add_tail(), list_empty(), opd_proc::maps, opd_proc::name, opd_image::name, opd_map::next, opd_map::offset, opd_image::ref_count, opd_map::start, opd_proc::tid, verbprintf, and vmisc.

Referenced by opd_add_ascii_map(), opd_add_kernel_map(), opd_get_ascii_maps(), opd_handle_fork(), and opd_handle_mapping().

Here is the call graph for this function:

Here is the caller graph for this function:

void opd_cleanup_hash_name ( void   ) 

op_cleanup_hash_name

release resource owned by hash_name array

Definition at line 33 of file opd_mapping.c.

References hash_name, and OP_HASH_MAP_NR.

Referenced by clean_exit().

Here is the caller graph for this function:

static char const* opd_get_hash_name ( int  hash  )  [static]

opg_get_hash_name - find a mapping name from a hash

Parameters:
hash hash value for this name

Definition at line 109 of file opd_mapping.c.

References get_from_pool(), hash_name, and op_hash_index::parent.

Referenced by opd_handle_mapping().

Here is the call graph for this function:

Here is the caller graph for this function:

void opd_handle_mapping ( struct op_note const *  note  ) 

opd_handle_mapping - deal with mapping notification

Parameters:
note mapping notification

Deal with one notification that a process has mapped in a new executable file. The mapping information is added to the process structure.

Definition at line 139 of file opd_mapping.c.

References op_note::addr, op_note::hash, op_note::len, opd_proc::name, opd_image::name, op_note::offset, OP_HASH_MAP_NR, opd_add_mapping(), opd_get_hash_name(), opd_get_image(), opd_get_proc(), opd_new_proc(), op_note::pid, op_note::tgid, verbprintf, and vmisc.

Referenced by opd_do_notes().

Here is the call graph for this function:

Here is the caller graph for this function:

void opd_init_hash_map ( void   ) 

opd_init_hash_map - initialise the hashmap

Definition at line 42 of file opd_mapping.c.

References hashmapdevfd, and OP_HASH_MAP_SIZE.

Referenced by op_open_files().

Here is the caller graph for this function:

void opd_kill_maps ( struct opd_proc proc  ) 

opd_kill_maps - delete mapping information for a process

Parameters:
proc process to work on

Frees structures holding mapping information

Definition at line 55 of file opd_mapping.c.

References opd_map::image, list_del(), list_entry, list_for_each_safe, opd_proc::maps, opd_map::next, and opd_delete_image().

Referenced by opd_delete_proc(), and opd_handle_exec().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

char const* hash_name[OP_HASH_MAP_NR] [static]

Definition at line 30 of file opd_mapping.c.

Referenced by opd_cleanup_hash_name(), and opd_get_hash_name().

struct op_hash_index* hashmap [static]

Definition at line 28 of file opd_mapping.c.


Generated on 8 Nov 2012 for Oprofile by  doxygen 1.6.1