Re: [google] Remove deprecated pfmon-specific functions/structs from pmu-profile.c (issue6442086)
I have committed this to google/main for Chris (approved by Rong). Chris, please prepare a patch to backport this to google/4_7. Teresa On Tue, Aug 7, 2012 at 3:55 PM, Chris Manghane cm...@google.com wrote: Removes references in libgcov.c to functions and structs removed from pmu-profile.c For google/main. Tested with crosstools and bootstrap. 2012-08-07 Chris Manghane cm...@google.com * libgcc/pmu-profile.c (enum pmu_tool_type): Remove pfmon-specific functions/structs. (enum pmu_event_type): Ditto. (enum pmu_state): Ditto. (enum cpu_vendor_signature): Ditto. (struct pmu_tool_info): Ditto. (void gcov_write_branch_mispredict_infos): Ditto. (get_x86cpu_vendor): Ditto. (parse_pmu_profile_options): Ditto. (start_addr2line_symbolizer): Ditto. (reset_symbolizer_parent_pipes): Ditto. (reset_symbolizer_child_pipes): Ditto. (end_addr2line_symbolizer): Ditto. (symbolize_addr2line): Ditto. (start_pfmon_module): Ditto. (convert_pct_to_unsigned): Ditto. (parse_load_latency_line): Ditto. (parse_branch_mispredict_line): Ditto. (parse_pfmon_load_latency): Ditto. (parse_pfmon_tool_header): Ditto. (parse_pfmon_branch_mispredicts): Ditto. (pmu_start): Ditto. (init_pmu_branch_mispredict): Ditto. (init_pmu_tool): Ditto. (__gcov_init_pmu_profiler): Ditto. (__gcov_start_pmu_profiler): Ditto. (__gcov_stop_pmu_profiler): Ditto. (gcov_write_branch_mispredict_line): Ditto. (gcov_write_load_latency_infos): Ditto. (gcov_write_branch_mispredict_infos): Ditto. (gcov_write_tool_header): Ditto. (__gcov_end_pmu_profiler): Ditto. * libgcc/libgcov.c (gcov_alloc_filename): Remove references to pfmon specific functions/structs. (pmu_profile_stop): Ditto. (gcov_exit): Ditto. (__gcov_init): Ditto. (__gcov_flush): Ditto. Index: libgcc/pmu-profile.c === --- libgcc/pmu-profile.c(revision 190135) +++ libgcc/pmu-profile.c(working copy) @@ -67,169 +67,11 @@ see the files COPYING3 and COPYING.RUNTIME respect #define XDELETEVEC(p) free(p) #define XDELETE(p) free(p) -#define PFMON_CMD /usr/bin/pfmon -#define ADDR2LINE_CMD /usr/bin/addr2line -#define PMU_TOOL_MAX_ARGS (20) -static char default_addr2line[] = ??:0; -static const char pfmon_ll_header[] = # counts %self%cum -10 32 64256 1024 =1024 %wself -code addr symbol\n; -static const char pfmon_bm_header[] = -# counts %self%cum code addr symbol\n; - -const char *pfmon_intel_ll_args[PMU_TOOL_MAX_ARGS] = { - PFMON_CMD, - --aggregate-results, - --follow-all, - --with-header, - --smpl-module=pebs-ll, - --ld-lat-threshold=4, - --pebs-ll-dcmiss-code, - --resolve-addresses, - -emem_inst_retired:LATENCY_ABOVE_THRESHOLD, - --long-smpl-periods=1, - 0 /* terminating NULL must be present */ -}; - -const char *pfmon_amd_ll_args[PMU_TOOL_MAX_ARGS] = { - PFMON_CMD, - --aggregate-results, - --follow-all, - -uk, - --with-header, - --smpl-module=ibs, - --resolve-addresses, - -eibsop_event:uops, - --ibs-dcmiss-code, - --long-smpl-periods=0x0, - 0 /* terminating NULL must be present */ -}; - -const char *pfmon_intel_brm_args[PMU_TOOL_MAX_ARGS] = { - PFMON_CMD, - --aggregate-results, - --follow-all, - --with-header, - --resolve-addresses, - -eMISPREDICTED_BRANCH_RETIRED, - --long-smpl-periods=1, - 0 /* terminating NULL must be present */ -}; - -const char *pfmon_amd_brm_args[PMU_TOOL_MAX_ARGS] = { - PFMON_CMD, - --aggregate-results, - --follow-all, - --with-header, - --resolve-addresses, - -eRETIRED_MISPREDICTED_BRANCH_INSTRUCTIONS, - --long-smpl-periods=1, - 0 /* terminating NULL must be present */ -}; - -const char *addr2line_args[PMU_TOOL_MAX_ARGS] = { - ADDR2LINE_CMD, - -e, - 0 /* terminating NULL must be present */ -}; - - -enum pmu_tool_type -{ - PTT_PFMON, - PTT_LAST -}; - -enum pmu_event_type -{ - PET_INTEL_LOAD_LATENCY, - PET_AMD_LOAD_LATENCY, - PET_INTEL_BRANCH_MISPREDICT, - PET_AMD_BRANCH_MISPREDICT, - PET_LAST -}; - -typedef struct pmu_tool_fns { - const char *name; /* name of the pmu tool */ - /* pmu tool commandline argument. */ - const char **arg_array; - /* Initialize pmu module. */ - void *(*init_pmu_module) (void); - /* Start profililing. */ - void (*start_pmu_module) (pid_t ppid, char *tmpfile, const char **args); - /* Stop profililing. */ - void (*stop_pmu_module) (void); - /* How to parse the output generated by the PMU tool. */ - int (*parse_pmu_output) (char *filename, void *pmu_data); - /* How to write
[google] Remove deprecated pfmon-specific functions/structs from pmu-profile.c (issue6442086)
Removes references in libgcov.c to functions and structs removed from pmu-profile.c For google/main. Tested with crosstools and bootstrap. 2012-08-07 Chris Manghane cm...@google.com * libgcc/pmu-profile.c (enum pmu_tool_type): Remove pfmon-specific functions/structs. (enum pmu_event_type): Ditto. (enum pmu_state): Ditto. (enum cpu_vendor_signature): Ditto. (struct pmu_tool_info): Ditto. (void gcov_write_branch_mispredict_infos): Ditto. (get_x86cpu_vendor): Ditto. (parse_pmu_profile_options): Ditto. (start_addr2line_symbolizer): Ditto. (reset_symbolizer_parent_pipes): Ditto. (reset_symbolizer_child_pipes): Ditto. (end_addr2line_symbolizer): Ditto. (symbolize_addr2line): Ditto. (start_pfmon_module): Ditto. (convert_pct_to_unsigned): Ditto. (parse_load_latency_line): Ditto. (parse_branch_mispredict_line): Ditto. (parse_pfmon_load_latency): Ditto. (parse_pfmon_tool_header): Ditto. (parse_pfmon_branch_mispredicts): Ditto. (pmu_start): Ditto. (init_pmu_branch_mispredict): Ditto. (init_pmu_tool): Ditto. (__gcov_init_pmu_profiler): Ditto. (__gcov_start_pmu_profiler): Ditto. (__gcov_stop_pmu_profiler): Ditto. (gcov_write_branch_mispredict_line): Ditto. (gcov_write_load_latency_infos): Ditto. (gcov_write_branch_mispredict_infos): Ditto. (gcov_write_tool_header): Ditto. (__gcov_end_pmu_profiler): Ditto. * libgcc/libgcov.c (gcov_alloc_filename): Remove references to pfmon specific functions/structs. (pmu_profile_stop): Ditto. (gcov_exit): Ditto. (__gcov_init): Ditto. (__gcov_flush): Ditto. Index: libgcc/pmu-profile.c === --- libgcc/pmu-profile.c(revision 190135) +++ libgcc/pmu-profile.c(working copy) @@ -67,169 +67,11 @@ see the files COPYING3 and COPYING.RUNTIME respect #define XDELETEVEC(p) free(p) #define XDELETE(p) free(p) -#define PFMON_CMD /usr/bin/pfmon -#define ADDR2LINE_CMD /usr/bin/addr2line -#define PMU_TOOL_MAX_ARGS (20) -static char default_addr2line[] = ??:0; -static const char pfmon_ll_header[] = # counts %self%cum -10 32 64256 1024 =1024 %wself -code addr symbol\n; -static const char pfmon_bm_header[] = -# counts %self%cum code addr symbol\n; - -const char *pfmon_intel_ll_args[PMU_TOOL_MAX_ARGS] = { - PFMON_CMD, - --aggregate-results, - --follow-all, - --with-header, - --smpl-module=pebs-ll, - --ld-lat-threshold=4, - --pebs-ll-dcmiss-code, - --resolve-addresses, - -emem_inst_retired:LATENCY_ABOVE_THRESHOLD, - --long-smpl-periods=1, - 0 /* terminating NULL must be present */ -}; - -const char *pfmon_amd_ll_args[PMU_TOOL_MAX_ARGS] = { - PFMON_CMD, - --aggregate-results, - --follow-all, - -uk, - --with-header, - --smpl-module=ibs, - --resolve-addresses, - -eibsop_event:uops, - --ibs-dcmiss-code, - --long-smpl-periods=0x0, - 0 /* terminating NULL must be present */ -}; - -const char *pfmon_intel_brm_args[PMU_TOOL_MAX_ARGS] = { - PFMON_CMD, - --aggregate-results, - --follow-all, - --with-header, - --resolve-addresses, - -eMISPREDICTED_BRANCH_RETIRED, - --long-smpl-periods=1, - 0 /* terminating NULL must be present */ -}; - -const char *pfmon_amd_brm_args[PMU_TOOL_MAX_ARGS] = { - PFMON_CMD, - --aggregate-results, - --follow-all, - --with-header, - --resolve-addresses, - -eRETIRED_MISPREDICTED_BRANCH_INSTRUCTIONS, - --long-smpl-periods=1, - 0 /* terminating NULL must be present */ -}; - -const char *addr2line_args[PMU_TOOL_MAX_ARGS] = { - ADDR2LINE_CMD, - -e, - 0 /* terminating NULL must be present */ -}; - - -enum pmu_tool_type -{ - PTT_PFMON, - PTT_LAST -}; - -enum pmu_event_type -{ - PET_INTEL_LOAD_LATENCY, - PET_AMD_LOAD_LATENCY, - PET_INTEL_BRANCH_MISPREDICT, - PET_AMD_BRANCH_MISPREDICT, - PET_LAST -}; - -typedef struct pmu_tool_fns { - const char *name; /* name of the pmu tool */ - /* pmu tool commandline argument. */ - const char **arg_array; - /* Initialize pmu module. */ - void *(*init_pmu_module) (void); - /* Start profililing. */ - void (*start_pmu_module) (pid_t ppid, char *tmpfile, const char **args); - /* Stop profililing. */ - void (*stop_pmu_module) (void); - /* How to parse the output generated by the PMU tool. */ - int (*parse_pmu_output) (char *filename, void *pmu_data); - /* How to write parsed pmu data into gcda file. */ - void (*gcov_write_pmu_data) (void *data); - /* How to cleanup any data structure created during parsing. */ - void (*cleanup_pmu_data) (void *data); - /* How to initialize symbolizer for the PPID. */ - int (*start_symbolizer) (pid_t ppid); - void (*end_symbolizer) (void); - char *(*symbolize) (void
[google] Remove deprecated pfmon-specific functions/structs from pmu-profile.c (issue6442086)
This patch removes functions and structs necessary for gathering pmu info with pfmon, which is now a deprecated tool. For google/main. Tested with bootstrap. 2012-08-03 Chris Manghane cm...@google.com * libgcc/pmu-profile.c (enum pmu_tool_type): Remove pfmon-specific functions/strucs. (enum pmu_event_type): Ditto. (enum pmu_state): Ditto. (enum cpu_vendor_signature): Ditto. (struct pmu_tool_info): Ditto. (static void gcov_write_branch_mispredict_infos): Ditto. (get_x86cpu_vendor): Ditto. (parse_pmu_profile_options): Ditto. (start_addr2line_symbolizer): Ditto. (reset_symbolizer_parent_pipes): Ditto. (reset_symbolizer_child_pipes): Ditto. (end_addr2line_symbolizer): Ditto. (symbolize_addr2line): Ditto. (start_pfmon_module): Ditto. (convert_pct_to_unsigned): Ditto. (parse_load_latency_line): Ditto. (parse_branch_mispredict_line): Ditto. (parse_pfmon_load_latency): Ditto. (parse_pfmon_tool_header): Ditto. (parse_pfmon_branch_mispredicts): Ditto. (pmu_start): Ditto. (init_pmu_branch_mispredict): Ditto. (init_pmu_tool): Ditto. (__gcov_init_pmu_profiler): Ditto. (__gcov_start_pmu_profiler): Ditto. (__gcov_stop_pmu_profiler): Ditto. (gcov_write_branch_mispredict_line): Ditto. (gcov_write_load_latency_infos): Ditto. (gcov_write_branch_mispredict_infos): Ditto. (gcov_write_tool_header): Ditto. (__gcov_end_pmu_profiler): Ditto. Index: libgcc/pmu-profile.c === --- libgcc/pmu-profile.c(revision 190103) +++ libgcc/pmu-profile.c(working copy) @@ -67,169 +67,11 @@ see the files COPYING3 and COPYING.RUNTIME respect #define XDELETEVEC(p) free(p) #define XDELETE(p) free(p) -#define PFMON_CMD /usr/bin/pfmon -#define ADDR2LINE_CMD /usr/bin/addr2line -#define PMU_TOOL_MAX_ARGS (20) -static char default_addr2line[] = ??:0; -static const char pfmon_ll_header[] = # counts %self%cum -10 32 64256 1024 =1024 %wself -code addr symbol\n; -static const char pfmon_bm_header[] = -# counts %self%cum code addr symbol\n; - -const char *pfmon_intel_ll_args[PMU_TOOL_MAX_ARGS] = { - PFMON_CMD, - --aggregate-results, - --follow-all, - --with-header, - --smpl-module=pebs-ll, - --ld-lat-threshold=4, - --pebs-ll-dcmiss-code, - --resolve-addresses, - -emem_inst_retired:LATENCY_ABOVE_THRESHOLD, - --long-smpl-periods=1, - 0 /* terminating NULL must be present */ -}; - -const char *pfmon_amd_ll_args[PMU_TOOL_MAX_ARGS] = { - PFMON_CMD, - --aggregate-results, - --follow-all, - -uk, - --with-header, - --smpl-module=ibs, - --resolve-addresses, - -eibsop_event:uops, - --ibs-dcmiss-code, - --long-smpl-periods=0x0, - 0 /* terminating NULL must be present */ -}; - -const char *pfmon_intel_brm_args[PMU_TOOL_MAX_ARGS] = { - PFMON_CMD, - --aggregate-results, - --follow-all, - --with-header, - --resolve-addresses, - -eMISPREDICTED_BRANCH_RETIRED, - --long-smpl-periods=1, - 0 /* terminating NULL must be present */ -}; - -const char *pfmon_amd_brm_args[PMU_TOOL_MAX_ARGS] = { - PFMON_CMD, - --aggregate-results, - --follow-all, - --with-header, - --resolve-addresses, - -eRETIRED_MISPREDICTED_BRANCH_INSTRUCTIONS, - --long-smpl-periods=1, - 0 /* terminating NULL must be present */ -}; - -const char *addr2line_args[PMU_TOOL_MAX_ARGS] = { - ADDR2LINE_CMD, - -e, - 0 /* terminating NULL must be present */ -}; - - -enum pmu_tool_type -{ - PTT_PFMON, - PTT_LAST -}; - -enum pmu_event_type -{ - PET_INTEL_LOAD_LATENCY, - PET_AMD_LOAD_LATENCY, - PET_INTEL_BRANCH_MISPREDICT, - PET_AMD_BRANCH_MISPREDICT, - PET_LAST -}; - -typedef struct pmu_tool_fns { - const char *name; /* name of the pmu tool */ - /* pmu tool commandline argument. */ - const char **arg_array; - /* Initialize pmu module. */ - void *(*init_pmu_module) (void); - /* Start profililing. */ - void (*start_pmu_module) (pid_t ppid, char *tmpfile, const char **args); - /* Stop profililing. */ - void (*stop_pmu_module) (void); - /* How to parse the output generated by the PMU tool. */ - int (*parse_pmu_output) (char *filename, void *pmu_data); - /* How to write parsed pmu data into gcda file. */ - void (*gcov_write_pmu_data) (void *data); - /* How to cleanup any data structure created during parsing. */ - void (*cleanup_pmu_data) (void *data); - /* How to initialize symbolizer for the PPID. */ - int (*start_symbolizer) (pid_t ppid); - void (*end_symbolizer) (void); - char *(*symbolize) (void *addr); -} pmu_tool_fns; - -enum pmu_state -{ - PMU_NONE, /* Not configurated at all. */ - PMU_INITIALIZED, /* Configured and initialized. */ - PMU_ERROR,/* Configuration error. Cannot recover.