opjitconv.c File Reference

#include "opjitconv.h"
#include "opd_printf.h"
#include "op_file.h"
#include "op_libiberty.h"
#include <dirent.h>
#include <fnmatch.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <pwd.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <unistd.h>
#include <wait.h>
Include dependency graph for opjitconv.c:

Go to the source code of this file.

Functions

 LIST_HEAD (jitdump_deletion_candidates)
static void get_pathname (char const *pathname, void *name_list)
static void delete_pathname (struct pathname *pname)
static void delete_path_names_list (struct list_head *list)
static int mmap_jitdump (char const *dumpfile, struct op_jitdump_info *file_info)
static char const * find_anon_dir_match (struct list_head *anon_dirs, char const *proc_id)
int change_owner (char *path)
int copy_dumpfile (char const *dumpfile, char *tmp_dumpfile)
int copy_elffile (char *elf_file, char *tmp_elffile)
static int process_jit_dumpfile (char const *dmp_pathname, struct list_head *anon_sample_dirs, unsigned long long start_time, unsigned long long end_time, char *tmp_conv_dir)
static char * get_procid_from_dirname (char *dirname)
static void filter_anon_samples_list (struct list_head *anon_dirs)
static void _add_jitdumps_to_deletion_list (void *all_jitdumps, char const *jitdump_dir)
static int op_process_jit_dumpfiles (char const *session_dir, unsigned long long start_time, unsigned long long end_time)
static void _cleanup_jitdumps (void)
int main (int argc, char **argv)

Variables

struct jitentryjitentry_list = NULL
struct jitentry_debug_linejitentry_debug_line_list = NULL
asymbol ** syms
enum bfd_architecture dump_bfd_arch
int dump_bfd_mach
char const * dump_bfd_target_name
struct passwd * pw_oprofile
char sys_cmd_buffer [PATH_MAX+1]
bfd * cur_bfd
u32 entry_count
u32 max_entry_count
struct jitentry ** entries_symbols_ascending
struct jitentry ** entries_address_ascending
int debug
int non_root
int delete_jitdumps

Detailed Description

Convert a jit dump file to an ELF file

Remarks:
Copyright 2007 OProfile authors
Read the file COPYING
Author:
Jens Wilke Maynard Johnson Daniel Hansel Gisle Dankel

Copyright IBM Corporation 2007

Definition in file opjitconv.c.


Function Documentation

static void _add_jitdumps_to_deletion_list ( void *  all_jitdumps,
char const *  jitdump_dir 
) [static]

Definition at line 496 of file opjitconv.c.

References debug, list_add(), list_entry, list_for_each_safe, jitdump_deletion_candidate::name, pathname::name, jitdump_deletion_candidate::neighbor, pathname::neighbor, and verbprintf.

Referenced by op_process_jit_dumpfiles().

Here is the call graph for this function:

Here is the caller graph for this function:

static void _cleanup_jitdumps ( void   )  [static]

Definition at line 680 of file opjitconv.c.

References buf, debug, delete_jitdumps, list_del(), list_entry, list_for_each_safe, jitdump_deletion_candidate::name, jitdump_deletion_candidate::neighbor, pid, and verbprintf.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int change_owner ( char *  path  ) 

Definition at line 164 of file opjitconv.c.

References non_root, OP_JIT_CONV_FAIL, OP_JIT_CONV_OK, and pw_oprofile.

Referenced by copy_dumpfile(), and op_process_jit_dumpfiles().

Here is the caller graph for this function:

int copy_dumpfile ( char const *  dumpfile,
char *  tmp_dumpfile 
)

Definition at line 192 of file opjitconv.c.

References change_owner(), OP_JIT_CONV_FAIL, OP_JIT_CONV_OK, and sys_cmd_buffer.

Referenced by process_jit_dumpfile().

Here is the call graph for this function:

Here is the caller graph for this function:

int copy_elffile ( char *  elf_file,
char *  tmp_elffile 
)

Definition at line 218 of file opjitconv.c.

References OP_JIT_CONV_FAIL, OP_JIT_CONV_OK, and sys_cmd_buffer.

Referenced by process_jit_dumpfile().

Here is the caller graph for this function:

static void delete_path_names_list ( struct list_head list  )  [static]

Definition at line 109 of file opjitconv.c.

References delete_pathname(), list_entry, list_for_each_safe, and pathname::neighbor.

Referenced by op_process_jit_dumpfiles().

Here is the call graph for this function:

Here is the caller graph for this function:

static void delete_pathname ( struct pathname pname  )  [static]

Definition at line 101 of file opjitconv.c.

References list_del(), pathname::name, and pathname::neighbor.

Referenced by delete_path_names_list(), and op_process_jit_dumpfiles().

Here is the call graph for this function:

Here is the caller graph for this function:

static void filter_anon_samples_list ( struct list_head anon_dirs  )  [static]

Definition at line 449 of file opjitconv.c.

References get_procid_from_dirname(), list_del(), list_entry, list_for_each_safe, pathname::name, pathname::neighbor, and pid.

Referenced by op_process_jit_dumpfiles().

Here is the call graph for this function:

Here is the caller graph for this function:

static char const* find_anon_dir_match ( struct list_head anon_dirs,
char const *  proc_id 
) [static]

Definition at line 149 of file opjitconv.c.

References list_entry, list_for_each, pathname::name, and pathname::neighbor.

Referenced by process_jit_dumpfile().

Here is the caller graph for this function:

static void get_pathname ( char const *  pathname,
void *  name_list 
) [static]

Definition at line 93 of file opjitconv.c.

References list_add(), pathname::name, and pathname::neighbor.

Referenced by op_process_jit_dumpfiles().

Here is the call graph for this function:

Here is the caller graph for this function:

static char* get_procid_from_dirname ( char *  dirname  )  [static]

Definition at line 430 of file opjitconv.c.

Referenced by filter_anon_samples_list().

Here is the caller graph for this function:

LIST_HEAD ( jitdump_deletion_candidates   ) 
int main ( int  argc,
char **  argv 
)

Definition at line 756 of file opjitconv.c.

References _cleanup_jitdumps(), debug, delete_jitdumps, non_root, OP_JIT_CONV_OK, op_process_jit_dumpfiles(), session_dir, and verbprintf.

Here is the call graph for this function:

static int mmap_jitdump ( char const *  dumpfile,
struct op_jitdump_info file_info 
) [static]

Definition at line 119 of file opjitconv.c.

References op_jitdump_info::dmp_file, op_jitdump_info::dmp_file_stat, OP_JIT_CONV_FAIL, OP_JIT_CONV_NO_DUMPFILE, and OP_JIT_CONV_OK.

Referenced by process_jit_dumpfile().

Here is the caller graph for this function:

static int op_process_jit_dumpfiles ( char const *  session_dir,
unsigned long long  start_time,
unsigned long long  end_time 
) [static]
static int process_jit_dumpfile ( char const *  dmp_pathname,
struct list_head anon_sample_dirs,
unsigned long long  start_time,
unsigned long long  end_time,
char *  tmp_conv_dir 
) [static]

Variable Documentation

bfd* cur_bfd
int debug

Definition at line 72 of file opjitconv.c.

Definition at line 76 of file opjitconv.c.

Referenced by _cleanup_jitdumps(), _do_jitdump_convert(), main(), and op_process_jit_dumpfiles().

enum bfd_architecture dump_bfd_arch

Definition at line 50 of file opjitconv.c.

Referenced by open_elf(), and parse_header().

Definition at line 51 of file opjitconv.c.

Referenced by open_elf(), and parse_header().

char const* dump_bfd_target_name

Definition at line 52 of file opjitconv.c.

Referenced by open_elf(), and parse_header().

struct jitentry* jitentry_list = NULL

Definition at line 65 of file opjitconv.c.

Referenced by create_arrays(), insert_entry(), and op_jit_convert().

int non_root

Definition at line 74 of file opjitconv.c.

Referenced by change_owner(), main(), op_process_jit_dumpfiles(), and process_jit_dumpfile().

struct passwd* pw_oprofile

Definition at line 55 of file opjitconv.c.

Referenced by change_owner(), op_process_jit_dumpfiles(), and process_jit_dumpfile().

asymbol** syms

Definition at line 47 of file opjitconv.c.

Referenced by fill_symtab(), op_jit_convert(), and callgraph_container::output_hint().

char sys_cmd_buffer[PATH_MAX+1]

Definition at line 57 of file opjitconv.c.

Referenced by copy_dumpfile(), copy_elffile(), and op_process_jit_dumpfiles().


Generated on 8 Nov 2012 for Oprofile by  doxygen 1.6.1