Commit 92b7a2a5 by Jan Hubicka Committed by Jan Hubicka

final.c (final): Use symbol name as function name for profiling.


	* final.c (final): Use symbol name as function name for profiling.
	* profile.c (get_exec_counts): Likewise.
	(branch_prob): Likewise.

From-SVN: r57790
parent 429489e5
Thu Oct 3 23:20:58 CEST 2002 Jan Hubicka <jh@suse.cz>
* final.c (final): Use symbol name as function name for profiling.
* profile.c (get_exec_counts): Likewise.
(branch_prob): Likewise.
2002-10-03 Jakub Jelinek <jakub@redhat.com> 2002-10-03 Jakub Jelinek <jakub@redhat.com>
* longlong.h (__udiv_qrnnd): Remove PARAMS from prototype. * longlong.h (__udiv_qrnnd): Remove PARAMS from prototype.
......
...@@ -1915,7 +1915,8 @@ final (first, file, optimize, prescan) ...@@ -1915,7 +1915,8 @@ final (first, file, optimize, prescan)
functions_tail = &new_item->next; functions_tail = &new_item->next;
new_item->next = 0; new_item->next = 0;
new_item->name = xstrdup (current_function_name); new_item->name = xstrdup (IDENTIFIER_POINTER
(DECL_ASSEMBLER_NAME (current_function_decl)));
new_item->cfg_checksum = profile_info.current_function_cfg_checksum; new_item->cfg_checksum = profile_info.current_function_cfg_checksum;
new_item->count_edges = profile_info.count_edges_instrumented_now; new_item->count_edges = profile_info.count_edges_instrumented_now;
} }
......
...@@ -260,6 +260,8 @@ get_exec_counts () ...@@ -260,6 +260,8 @@ get_exec_counts ()
char *function_name_buffer; char *function_name_buffer;
int function_name_buffer_len; int function_name_buffer_len;
gcov_type max_counter_in_run; gcov_type max_counter_in_run;
const char *name = IDENTIFIER_POINTER
(DECL_ASSEMBLER_NAME (current_function_decl));
profile_info.max_counter_in_program = 0; profile_info.max_counter_in_program = 0;
profile_info.count_profiles_merged = 0; profile_info.count_profiles_merged = 0;
...@@ -282,7 +284,7 @@ get_exec_counts () ...@@ -282,7 +284,7 @@ get_exec_counts ()
profile = xmalloc (sizeof (gcov_type) * num_edges); profile = xmalloc (sizeof (gcov_type) * num_edges);
rewind (da_file); rewind (da_file);
function_name_buffer_len = strlen (current_function_name) + 1; function_name_buffer_len = strlen (name) + 1;
function_name_buffer = xmalloc (function_name_buffer_len + 1); function_name_buffer = xmalloc (function_name_buffer_len + 1);
for (i = 0; i < num_edges; i++) for (i = 0; i < num_edges; i++)
...@@ -349,7 +351,7 @@ get_exec_counts () ...@@ -349,7 +351,7 @@ get_exec_counts ()
break; break;
} }
if (strcmp (function_name_buffer, current_function_name) != 0) if (strcmp (function_name_buffer, name) != 0)
{ {
/* skip */ /* skip */
if (fseek (da_file, arc_count * 8, SEEK_CUR) < 0) if (fseek (da_file, arc_count * 8, SEEK_CUR) < 0)
...@@ -772,6 +774,8 @@ branch_prob () ...@@ -772,6 +774,8 @@ branch_prob ()
int i; int i;
int num_edges, ignored_edges; int num_edges, ignored_edges;
struct edge_list *el; struct edge_list *el;
const char *name = IDENTIFIER_POINTER
(DECL_ASSEMBLER_NAME (current_function_decl));
profile_info.current_function_cfg_checksum = compute_checksum (); profile_info.current_function_cfg_checksum = compute_checksum ();
...@@ -781,7 +785,7 @@ branch_prob () ...@@ -781,7 +785,7 @@ branch_prob ()
/* Start of a function. */ /* Start of a function. */
if (flag_test_coverage) if (flag_test_coverage)
output_gcov_string (current_function_name, (long) -2); output_gcov_string (name, (long) -2);
total_num_times_called++; total_num_times_called++;
...@@ -995,8 +999,7 @@ branch_prob () ...@@ -995,8 +999,7 @@ branch_prob ()
{ {
int flag_bits; int flag_bits;
__write_gcov_string (current_function_name, __write_gcov_string (name, strlen (name), bbg_file, -1);
strlen (current_function_name), bbg_file, -1);
/* write checksum. */ /* write checksum. */
__write_long (profile_info.current_function_cfg_checksum, bbg_file, 4); __write_long (profile_info.current_function_cfg_checksum, bbg_file, 4);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment