#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>
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 jitentry * | jitentry_list = NULL |
struct jitentry_debug_line * | jitentry_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 |
Convert a jit dump file to an ELF file
Copyright IBM Corporation 2007
Definition in file opjitconv.c.
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
static char* get_procid_from_dirname | ( | char * | dirname | ) | [static] |
Definition at line 430 of file opjitconv.c.
Referenced by filter_anon_samples_list().
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.
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().
static int op_process_jit_dumpfiles | ( | char const * | session_dir, | |
unsigned long long | start_time, | |||
unsigned long long | end_time | |||
) | [static] |
Definition at line 532 of file opjitconv.c.
References _add_jitdumps_to_deletion_list(), change_owner(), debug, delete_jitdumps, delete_path_names_list(), delete_pathname(), filter_anon_samples_list(), get_matching_pathnames(), get_pathname(), list_empty(), list_entry, list_for_each_safe, LIST_HEAD, MATCH_DIR_ONLY_RECURSION, pathname::name, pathname::neighbor, NO_RECURSION, non_root, OP_JIT_CONV_FAIL, OP_JIT_CONV_NO_ANON_SAMPLES, OP_JIT_CONV_NO_DUMPFILE, OP_JIT_CONV_OK, OP_JIT_CONV_TMPDIR_NOT_REMOVED, process_jit_dumpfile(), pw_oprofile, samples_dir, sys_cmd_buffer, and verbprintf.
Referenced by main().
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] |
Definition at line 254 of file opjitconv.c.
References copy_dumpfile(), copy_elffile(), debug, op_jitdump_info::dmp_file, op_jitdump_info::dmp_file_stat, find_anon_dir_match(), mmap_jitdump(), non_root, OP_JIT_CONV_ALREADY_DONE, OP_JIT_CONV_FAIL, OP_JIT_CONV_NO_MATCHING_ANON_SAMPLES, OP_JIT_CONV_OK, op_jit_convert(), pw_oprofile, and verbprintf.
Referenced by op_process_jit_dumpfiles().
bfd* cur_bfd |
Definition at line 60 of file opjitconv.c.
Referenced by create_text_section(), fill_symtab(), fill_text_section_content(), and op_jit_convert().
int debug |
Definition at line 72 of file opjitconv.c.
int delete_jitdumps |
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().
int dump_bfd_mach |
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** entries_address_ascending |
Definition at line 69 of file opjitconv.c.
Referenced by create_arrays(), create_text_section(), eliminate_overlaps(), fill_sections(), fill_symtab(), fill_text_section_content(), handle_overlap_region(), insert_entry(), invalidate_earlybirds(), op_jit_convert(), partition_sections(), resort_address(), resort_symbol(), scan_overlaps(), and select_one().
struct jitentry** entries_symbols_ascending |
Definition at line 67 of file opjitconv.c.
Referenced by create_arrays(), disambiguate_symbol_names(), insert_entry(), op_jit_convert(), and resort_symbol().
Definition at line 63 of file opjitconv.c.
Referenced by cb_compiled_method_load(), create_arrays(), create_sorted_array(), disambiguate_symbol_names(), fill_sections(), fill_symtab(), insert_entry(), invalidate_earlybirds(), op_jit_convert(), partition_sections(), resort_address(), resort_symbol(), and scan_overlaps().
struct jitentry_debug_line* jitentry_debug_line_list = NULL |
Definition at line 44 of file opjitconv.c.
Referenced by free_jit_debug_line(), init_debug_line_info(), op_jit_convert(), and parse_code_debug_info().
struct jitentry* jitentry_list = NULL |
Definition at line 43 of file opjitconv.c.
Referenced by count_entries(), fill_entry_array(), free_jit_records(), op_jit_convert(), parse_code_load(), and parse_code_unload().
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().