aboutsummaryrefslogtreecommitdiff
path: root/gprof/gprof.c
diff options
context:
space:
mode:
authorBen Elliston <bje@au.ibm.com>2004-05-26 04:06:26 +0000
committerBen Elliston <bje@au.ibm.com>2004-05-26 04:06:26 +0000
commit37b1bfcd81b4c43b5a649535c6306713cb04dd69 (patch)
tree8833e760fac585856779552964e17726ea664a05 /gprof/gprof.c
parent6d1be3f1860bfc9fb75ea83cb930afb1ce895514 (diff)
downloadgdb-37b1bfcd81b4c43b5a649535c6306713cb04dd69.zip
gdb-37b1bfcd81b4c43b5a649535c6306713cb04dd69.tar.gz
gdb-37b1bfcd81b4c43b5a649535c6306713cb04dd69.tar.bz2
* corefile.c (core_init): Use a separate local variable,
core_sym_bytes, to make the units from bfd_get_symtab_upper_bound more obvious. (core_create_function_syms): Discard cbfd argument. Eliminate `offset' variable and calculate VMA directly. Update all users. * corefile.h (core_create_function_syms): Update prototype. (core_create_line_syms): Likewise. * gprof.c (main): Remove #ifdef PROF_SUPPORT_IMPLEMENTED code. Tidy.
Diffstat (limited to 'gprof/gprof.c')
-rw-r--r--gprof/gprof.c77
1 files changed, 19 insertions, 58 deletions
diff --git a/gprof/gprof.c b/gprof/gprof.c
index 260dbeb..381118c 100644
--- a/gprof/gprof.c
+++ b/gprof/gprof.c
@@ -483,7 +483,8 @@ This program is free software. This program has absolutely no warranty.\n"));
done (1);
}
- /* --sum implies --line, otherwise we'd lose b-b counts in gmon.sum */
+ /* --sum implies --line, otherwise we'd lose basic block counts in
+ gmon.sum */
if (output_style & STYLE_SUMMARY_FILE)
{
line_granularity = 1;
@@ -520,71 +521,36 @@ This program is free software. This program has absolutely no warranty.\n"));
* functions off the flat profile:
*/
if (line_granularity)
- {
- for (sp = &default_excluded_list[0]; *sp; sp++)
- {
- sym_id_add (*sp, EXCL_FLAT);
- }
- }
+ for (sp = &default_excluded_list[0]; *sp; sp++)
+ sym_id_add (*sp, EXCL_FLAT);
- /*
- * Read symbol table from core file:
- */
+ /* Read symbol table from core file. */
core_init (a_out_name);
- /*
- * If we should ignore direct function calls, we need to load
- * to core's text-space:
- */
+ /* If we should ignore direct function calls, we need to load to
+ core's text-space. */
if (ignore_direct_calls)
- {
- core_get_text_space (core_bfd);
- }
+ core_get_text_space (core_bfd);
- /*
- * Create symbols from core image:
- */
+ /* Create symbols from core image. */
if (line_granularity)
- {
- core_create_line_syms (core_bfd);
- }
+ core_create_line_syms ();
else
- {
- core_create_function_syms (core_bfd);
- }
+ core_create_function_syms ();
- /*
- * Translate sym specs into syms:
- */
+ /* Translate sym specs into syms. */
sym_id_parse ();
if (file_format == FF_PROF)
{
-#ifdef PROF_SUPPORT_IMPLEMENTED
- /*
- * Get information about mon.out file(s):
- */
- do
- {
- mon_out_read (gmon_name);
- if (optind < argc)
- {
- gmon_name = argv[optind];
- }
- }
- while (optind++ < argc);
-#else
fprintf (stderr,
_("%s: sorry, file format `prof' is not yet supported\n"),
whoami);
done (1);
-#endif
}
else
{
- /*
- * Get information about gmon.out file(s):
- */
+ /* Get information about gmon.out file(s). */
do
{
gmon_out_read (gmon_name);
@@ -603,19 +569,15 @@ This program is free software. This program has absolutely no warranty.\n"));
if (output_style == 0)
{
if (gmon_input & (INPUT_HISTOGRAM | INPUT_CALL_GRAPH))
- {
- output_style = STYLE_FLAT_PROFILE | STYLE_CALL_GRAPH;
- }
+ output_style = STYLE_FLAT_PROFILE | STYLE_CALL_GRAPH;
else
- {
- output_style = STYLE_EXEC_COUNTS;
- }
+ output_style = STYLE_EXEC_COUNTS;
+
output_style &= ~user_specified;
}
- /*
- * Dump a gmon.sum file if requested (before any other processing!):
- */
+ /* Dump a gmon.sum file if requested (before any other
+ processing!) */
if (output_style & STYLE_SUMMARY_FILE)
{
gmon_out_write (GMONSUM);
@@ -631,8 +593,7 @@ This program is free software. This program has absolutely no warranty.\n"));
cg = cg_assemble ();
}
- /* do some simple sanity checks: */
-
+ /* Do some simple sanity checks. */
if ((output_style & STYLE_FLAT_PROFILE)
&& !(gmon_input & INPUT_HISTOGRAM))
{