Commit Graph

22 Commits

Author SHA1 Message Date
Jan Hubicka 43ac26234a * libgcov.c (gcov_exit): Fix two pastos.
From-SVN: r71906
2003-09-29 17:09:36 +00:00
Zdenek Dvorak 50612a04e5 libgcov.c (gcov_exit): Cleanup and fix.
* libgcov.c (gcov_exit): Cleanup and fix.
	* profile.c (compute_value_histograms): Don't try to read profiles
	that are not present.

From-SVN: r70100
2003-08-02 10:30:48 +00:00
Nathan Sidwell 330d2e2ade gcov-io.h: Update documentation.
* gcov-io.h: Update documentation.
	(GCOV_UNSIGNED2STRING): New.
	(GCOV_TAG_FUNCTION_LENGTH, GCOV_TAG_BLOCKS_LENGTH,
	GCOV_TAG_ARCS_LENGTH, GCOV_TAG_COUNTER_LENGTH,
	GCOV_TAG_SUMMARY_LENGTH): Adjust.
	(GCOV_TAG_BLOCKS_NUM, GCOV_TAG_ARCS_NUM,
	GCOV_TAG_COUNTER_NUM): New.
	(GCOV_BLOCK_SIZE): Number of words.
	(gcov_var): Adjust buffer type.
	* gcov-io.c (gcov_write_bytes, gcov_read_bytes): Rename to ...
	(gcov_write_words, gcov_read_words): ... here. Take a 4-byte word
	count, not byte count.
	(gcov_open): Adjust overread init.
	(gcov_allocate, gcov_write_unsigned, gcov_write_counter,
	gcov_write_string, gcov_write_tag, gcov_write_length,
	gcov_write_tag_length): Adjust.
	(gcov_read_unsigned, gcov_read_counter, gcov_read_string): Adjust.
	(gcov_sync, gcov_seek): Adjust.
	* gcov-dump.c (print_usage): Show gcc version only.
	(dump_file): Use GCOV_UNSIGNED2STRING.
	(tag_blocks, tag_arcs, tag_counters): Use GCOV_TAG_*_NUM macros.
	* gcov.c (print_version): Show gcc version only.
	(read_graph_file): Use GCOV_UNSIGNED2STRING. Use
	GCOV_TAG_*_NUM macros.
	(read_count_file): Use GCOV_UNSIGNED2STRING. Use
	GCOV_TAG_COUNTER_LENGTH.
	* coverage.c (read_counts_file): Use GCOV_UNSIGNED2STRING.
	Use GCOV_TAG_COUNTER_NUM.
	* libgcov.c (gcov_version): Use GCOV_UNSIGNED2STRING.
	(__gcov_merge_single, __gcov_merge_delta): Use GCOV_CHECK.

From-SVN: r69188
2003-07-10 14:13:01 +00:00
Nathan Sidwell 160e2e4f23 gcov-io.h: Update documentation.
* gcov-io.h: Update documentation.
	(GCOV_GRAPH_SUFFIX, GCOV_GRAPH_MAGIC): Rename to GCOV_NOTE_SUFFIX,
	GCOV_NOTE_MAGIC.
	(GCOV_DATA_SUFFIX, GCOV_NOTE_SUFFIX): Update.
	(GCOV_DATA_MAGIC, GCOV_NOTE_MAGIC): Make non-palindromic.
	(struct gcov_var): Change buffer's type. Add endian flag.
	(gcov_open): Remove mode in libgcov.
	(gcov_magic): Prototype.
	* gcov-io.c (from_file): New.
	(gcov_open): Clear endian flag.
	(gcov_magic): New.
	(gcov_write_bytes, gcov_read_bytes): Return gcov_unsigned_t
	pointers.
	(gcov_write_unsigned, gcov_write_counter, gcov_write_string,
	gcov_write_tag, gcov_write_length, gcov_write_tag_length): Update.
	(gcov_read_unsigned, gcov_read_counter, gcov_read_string): Update.
	* gcov-iov.c (main): Correct cast.
	* coverage.c (read_counts_file): Use gcov_magic. Remove endianness
	conversion.
	(gcov_begin_output): Use GCOV_NOTE_MAGIC.
	(coverage_init): Use GCOV_NOTE_SUFFIX.
	* libgcov.c (gcov_version_mismatch): Remove endianness conversion.
	Rename to gcov_version, and return flag.
	(gcov_exit): Use gcov_version.
	(__gcov_init): Use gcov_version.
	* Makefile.in (coverageexts): Update.
	* gcov.c (print_version): Remove endianness conversion.
	(create_file_names): Use GCOV_NOTE_SUFFIX.
	(read_graph_file): Use gcov_magic.
	(read_count_file): Likewise.
	* gcov-dump.c (dump_file): Remove endianness conversion, use
	gcov_magic.

From-SVN: r69137
2003-07-09 12:12:29 +00:00
Nathan Sidwell dd486eb27c gcov-io.h: Add a local time stamp.
* gcov-io.h: Add a local time stamp.
	(struct gcov_info): Add stamp field.
	(gcov_truncate): New.
	* coverage.c (read_counts_file): Skip the stamp.
	(coverage_begin_output): Write the stamp.
	(build_gcov_info): Declare and init the stamp.
	(coverage_finish): Only unlink data file, if stamp is zero.
	* gcov-dump.c (dump_file): Dump the stamp.
	* gcov.c (bbg_stamp): New.
	(release_structures): Clear bbg_stamp.
	(read_graph_file): Read stamp.
	(read_count_file): Check stamp.
	* libgcov.c (gcov_exit): Check stamp and truncate if needed.

From-SVN: r69006
2003-07-06 14:51:48 +00:00
Kazu Hirata f9da506452 alloc-pool.c: Fix comment formatting.
* alloc-pool.c: Fix comment formatting.
	* bitmap.c: Likewise.
	* bitmap.h: Likewise.
	* bt-load.c: Likewise.
	* builtins.c: Likewise.
	* caller-save.c: Likewise.
	* cfganal.c: Likewise.
	* cfgrtl.c: Likewise.
	* collect2.c: Likewise.
	* cse.c: Likewise.
	* df.c: Likewise.
	* diagnostic.c: Likewise.
	* dwarf2out.c: Likewise.
	* dwarfout.c: Likewise.
	* expmed.c: Likewise.
	* final.c: Likewise.
	* flags.h: Likewise.
	* fold-const.c: Likewise.
	* gcc.c: Likewise.
	* gcov-io.h: Likewise.
	* gcov.c: Likewise.
	* genattrtab.c: Likewise.
	* genautomata.c: Likewise.
	* libgcov.c: Likewise.
	* mips-tfile.c: Likewise.
	* optabs.c: Likewise.
	* prefix.c: Likewise.
	* rtlanal.c: Likewise.
	* stmt.c: Likewise.
	* stor-layout.c: Likewise.
	* toplev.c: Likewise.
	* varasm.c: Likewise.
	* vmsdbgout.c: Likewise.

From-SVN: r68672
2003-06-29 13:53:12 +00:00
Zdenek Dvorak af166e5d27 value-prof.c: New.
* value-prof.c: New.
	* value-prof.h: New.
	* Makefile.in (value-prof.o): New.
	(LIBGCOV): Add _gcov_merge_single and _gcov_merge_delta
	(profile.o): Add value-prof.h and tree.h dependency.
	* flags.h (flag_profile_values): Declare.
	* gcov-io.h (GCOV_COUNTERS, GCOV_COUNTER_NAMES, GCOV_MERGE_FUNCTIONS):
	Add new counters.
	(GCOV_COUNTER_V_INTERVAL, GCOV_COUNTER_V_POW2, GCOV_COUNTER_V_SINGLE,
	GCOV_COUNTER_V_DELTA): New counter sections.
	(__gcov_merge_single, __gcov_merge_delta): Declare.
	* flow.c (mark_used_regs): Set subregs_of_mode only when the
	structure is initialized.
	* libgcov.c (__gcov_merge_single, __gcov_merge_delta): New functions.
	* profile.c: Include value-prof.h and tree.h.
	(gen_interval_profiler, gen_pow2_profiler, gen_one_value_profiler,
	gen_const_delta_profiler, instrument_values): New static functions.
	(get_exec_counts): Fix comment.
	(branch_prob): Invoke instrument_values.
	* toplev.c (flag_profile_values): New flag.
	* doc/invoke.texi (-fprofile-values): Document.

From-SVN: r68519
2003-06-26 07:52:10 +00:00
Nathan Sidwell 7d63a2fae0 gcov-io.h (gcov_write_bytes, [...]): Remove here.
* gcov-io.h (gcov_write_bytes, gcov_read_bytes): Remove here.
	(GCOV_TAG_*) Force type to gcov_unsigned_t.
	(GCOV_CHECK, GCOV_CHECK_READING, GCOV_CHECK_WRITING): New.
	(struct gcov_var): Remove modified. Add start, length, offset,
	overread. Have buffer array for libgcov.
	(gcov_sync, gcov_seek): Definitions moved to gcov-io.c.
	(gcov_position, gcov_rewrite, gcov_is_eof): Adjust.
	* gcov-io.c (gcov_open): Set mode, do not read anything.
	(gcov_close): Write final block.
	 (gcov_write_block, gcov_allocate): New.
	(gcov_write_bytes): Make static. Write or allocate buffer.
	(gcov_write_unsigned, gcov_write_counter): Buffer can never be
	null.
	(gcov_write_string): Adjust.
	(gcov_write_tag)
	(gcov_write_length): Adjust. Flush the block.
	(gcov_write_tag_length): Buffer can never be null.
	(gcov_read_bytes): Make static. Read in block.
	(gcov_sync): Moved here. Adjust.
	(gcov_seek): Moved here. Adjust.
	* coverage.c (read_counts_file): Adjust.
	* gcov-dump.c (print_prefix): Add position parameter.
	(flag_dump_positions): New flag.
	(options, main, print_usage): Add it.
	(dump_file, tag_blocks, tag_arcs, tag_lines, tag_counters,
	tag_summary): Adjust.
	* gcov.c (read_graph_file, read_count_file): Adjust.
	* libgcov.c (gcov_exit): Adjust.

From-SVN: r66805
2003-05-14 16:01:20 +00:00
Nathan Sidwell 9b514d2586 defaults.h (GCOV_TYPE_SIZE): Remove.
* defaults.h (GCOV_TYPE_SIZE): Remove.
	* gcov-io.h (gcov_type): Set to specific mode int on target.
	(gcov_unsigned_t, gcov_position_t): New.
	(GCOV_TYPE_NODE): New.
	(GCOV_TAG_SUMMARY_LENGTH): Adjust.
	(GCOV_COUNTERS_SUMMABLE): New.
	(gcov_ctr_summary, gcov_sumary, gcov_fn_info, gcov_merge_fn,
	gcov_ctr_info, gcov_info): Adjust types.
	(gcov_var): Adjust types.
	(gcov_write_unsigned, gcov_write_tag,
	gcov_write_length, gcov_write_tag_length, gcov_write_summary,
	gcov_read_unsigned, gcov_read_summary): Adjust gcov types.
	(gcov_position, gcov_sync, gcov_seek): Adjust gcov types.
	* gcov-io.c (gcov_write_unsigned, gcov_write_tag,
	gcov_write_length, gcov_write_tag_length, gcov_write_summary,
	gcov_read_unsigned, gcov_read_summary): Adjust gcov types.
	* libgcov.c (gcov_crc32, gcov_version_mismatch, gcov_exit,
	__gcov_init, __gcov_merge_add): Adjust gcov types.
	* coverage.c (ctr_merge_functions): Constify.
	(ctr_names): New.
	(read_counts_file): Adjust gcov types. Only summarize & merge
	summable counters.
	(coverage_counter_ref): Use GCOV_TYPE_NODE.
	(build_fn_info_type, build_fn_info_value, build_ctr_info_type,
	build_ctr_info_value, build_gcov_info): Adjust types.
	* profile.c (branch_prob): Adjust gcov types.
	* gcov_dump (dump_file): Adjust gcov types.

From-SVN: r66668
2003-05-10 19:02:21 +00:00
Nathan Sidwell 474f141e8d gcov-io.h (GCOV_LOCKED): New #define.
* gcov-io.h (GCOV_LOCKED): New #define.
	(GCOV_LINKAGE): Make sure it is #defined.
	(gcov_write_string, gcov_write_tag, gcov_write_length,
	gcov_read_string, gcov_time): Poison in libgcov.
	(gcov_seek_end): Remove.
	(gcov_write_tag_length, gcov_sync, gcov_rewrite): New.
	(GCOV_TAG_FUNCTION_LENGTH, GCOV_TAG_BLOCKS_LENGTH,
	GCOV_TAG_ARCS_LENGTH, GCOV_TAG_COUNTER_LENGTH,
	GCOV_TAG_SUMMARY_LENGTH): New #defines.
	(gcov_write_tag, gcov_write_length): Not in libgcov.
	* gcov-io.c (gcov_open): Use GCOV_LOCKED.
	(gcov_write_tag, gcov_write_length): Not in libgcov.
	(gcov_write_tag_length): New.
	(gcov_write_summary): Use gcov_write_tag_length.
	* libgcov.c: Always #include gcov-io.h.
	(IN_LIBGCOV): -1 for inhibit_libc, +1 otherwise.
	(GCOV_LINKAGE): Define to nothing for L_gcov.
	(gcov_exit): Replace gcov_write_tag, gcov_write_length with
	gcov_write_tag_length. Use gcov_rewrite & gcov_seek.
	* gcov.c (read_graph_file): Replace gcov_seek by gcov_sync.
	(read_count_file): Likewise.
	* gcov-dump.c (dump_file): Likewise.
	* coverag.c (read_counts_file): Likewise.

From-SVN: r66555
2003-05-07 10:40:09 +00:00
Zdenek Dvorak 1e77e67301 libgcov.c (__gcov_merge_add): Do not use gcov_type when inhibit_libc is defined.
* libgcov.c (__gcov_merge_add): Do not use gcov_type when inhibit_libc
	is defined.

From-SVN: r66475
2003-05-05 05:22:07 +00:00
Zdenek Dvorak 09780dfb65 Makefile.in (LIBGCOV): Add _gcov_merge_add.
* Makefile.in (LIBGCOV): Add _gcov_merge_add.
	* gcov-io.h: Make GCOV_LINKAGE extern in libgcov and prevent resulting
	namespace clash.
	(GCOV_MERGE_FUNCTIONS): New.
	(gcov_merge_fn): Declare.
	(struct gcov_ctr_info): New field "merge".
	(__gcov_merge_add): Declare.
	* coverage.c (ctr_merge_functions): New.
	(build_ctr_info_type, build_ctr_info_value): Initialize merge field
	of gcov_ctr_info type.
	* libgcov.c (__gcov_merge_add): New.
	(gcov_exit): Call a hook to merge values of counters.

From-SVN: r66457
2003-05-04 15:20:26 +00:00
Nathan Sidwell 796621e8c2 New GCOV_TAG_FUNCTION layout
New GCOV_TAG_FUNCTION layout
	* coverage.c (struct function_list): Replace name with ident.
	(struct counts_entry): Likewise.
	(fn_ident): New.
	(htab_counts_entry_hash, htab_counts_entry_eq,
	htab_counts_entry_del): Adjust.
	(reads_count_file, get_coverage_counts,
	coverage_begin_output, coverage_end_function): Adjust.
	(build_fn_info_type, build_fn_info_value): Likewise.
	* gcov-dump.c (tag_function): Adjust.
	* gcov-io.c (gcov_write_string, gcov_read_string): Not in LIBGCOV.
	* gcov-io.h (gcov_write_string, gcov_read_string): Not in LIBGCOV.
	* gcov.c (struct function_info): Add ident.
	(read_graph_file, read_count_file): Adjust.
	* libgcov.c (gcov_exit): Adjust.

From-SVN: r66035
2003-04-24 09:46:17 +00:00
Nathan Sidwell cdb2376773 Makefile.in (LIBGCC_DEPS): Add gcov headers.
* Makefile.in (LIBGCC_DEPS): Add gcov headers.
	(libgcov.a): Depends on LIBGCC_DEPS.
	* basic-block.h (profile_info): Moved here from coverage.h. Made
	a pointer.
	* coverage.c (struct function_list): Fixed array of counter types.
	(struct counts_entry): Keyed by counter type, contains summary.
	(profile_info): Moved to profile.c.
	(prg_ctr_mask, prg_n_ctrs, fn_ctr_mask, fn_n_ctrs): New global
	vars.
	(profiler_label): Remove.
	(ctr_labels): New.
	(set_purpose, label_for_tag, build_counter_section_fields,
	build_counter_section_value, build_counter_section_data_fields,
	build_counter_section_data_values, build_function_info_fields,
	build_function_info_value, gcov_info_fields, gcov_info_value): Remove.
	(build_fn_info_type, build_fn_info_value, build_ctr_info_type,
	build_ctr_info_value, build_gcov_info): New.
	(htab_counts_entry_hash, htab_counts_entry_eq): Adjust.
	(reads_counts_file): Adjust.
	(get_coverage_counts): Takes counter number. Add summary
	parameter. Adjust.
	(coverage_counter_ref): Tkaes counter number. Adjust. Lazily
	create counter array labels.
	(coverage_end_function): Adjust.
	(create_coverage): Adjust.
	(find_counters_section): Remove.
	* coverage.h (MAX_COUNTER_SECTIONS): Remove.
	(struct section_info, struct profile_info): Remove.
	(profile_info): Moved to basic-block.h.
	(coverage_counter_ref): Takes a counter number.
	(get_coverage_counts): Takes a counter number. Added summary
	parameter.
	(find_counters_section): Remove.
	* gcov-dump.c (tag_arc_counts): Rename to ...
	(tag_counters): ... here. Adjust.
	(tag_table): Move tag_counters to 3rd entry. Remove
	PROGRAM_PLACEHOLDER and PROGRAM_INCORRECT entries.
	(dump_file): Check for counter tag values here.
	(tag_summary): Adjust.
	* gcov-io.c (gcov_write_summary, gcov_read_summary): Adjust.
	* gcov-io.h (GCOV_LOCKED): New.
	(GCOV_TAG_ARC_COUNTS): Rename to ...
	(GCOV_TAG_COUNTS_BASE): ... here.
	(GCOV_TAG_PLACEHOLDER_SUMMARY, GCOV_TAG_INCORRECT_SUMMARY):
	Remove.
	(GCOV_COUNTER_ARCS, GCOV_COUNTERS, GCOV_NAMES): New.
	(GCOV_TAG_FOR_COUNTER, GCOV_COUNTER_FOR_TAG,
	GCOV_TAG_IS_COUNTER): New.
	(struct gcov_ctr_summary): New.
	(struct gcov_summary): Adjust.
	(struct gcov_counter_section): Remove.
	struct gcov_counter_section_data): Remove.
	(struct gcov_function_info): Rename to ...
	(struct gcov_fn_info): ... here. Adjust.
	(struct gcov_ctr_info): New.
	(struct gcov_info): Adjust.
	* gcov.c (read_count_file): Adjust.
	(output_lines): Adjust.
	* libgcov.c (gcov_exit): Adjust.
	(__gcov_flush): Adjust.
	* mklibgcc.in (libgcc2_c_dep): Add gcov headers.
	* predict.c (maybe_hot_bb_p, probably_cold_bb_p,
	probably_never_executed_bb_p, compute_frequency_function): Adjust
	profile_info use.
	* profile.c (struct counts_entry): Remove.
	(profile_info): Define here.
	(get_exec_counts): Adjust get_coverage_counts call.
	(compute_branch_probablilities): Remove find_counters_section
	call.
	(gen_edge_profiler): Adjust coverage_counter_ref call.
	* tracer.c (tail_duplicate): Adjust profile_info use.

From-SVN: r65990
2003-04-23 14:05:11 +00:00
Nathan Sidwell ca29da4301 Break out coverage routines to new file.
* Makefile.in (COVERAGE_H): New variable
        (C_OBJS): Add coverage.o
        (coverage.o): New target.
        (profile.o, loop-init.o, sched-ebb.o, predict.o, tracer.o): Adjust
        dependencies.
        (GTFILES): Adjust.
        (gt-coverage.h): New target.
        (gt-profile.h): Remove.
        * profile.h: Remove. Move to ...
        * coverage.h: ... here. New. #include gcov-io.h.
        * gcov-io.h: Move function definitions to ...
        * gcov-io.c: ... here. New.
        * profile.c: Move coverage routines to coverage.c.
        (instrument_edges, get_exec_counts, branch_prob, init_branch_prob,
        end_branch_prob): Adjust.
        * coverage.c: New. Coverage routines from profile.c
        (coverage_counter_ref, coverage_init, coverage_finish,
        coverage_end_function, coverage_begin_output,
        coverage_counter_ref, get_coverage_counts): Define.
        * gcov-dump.c, gcov.c: #include gcov-io.c.
        * libgcov.c: Likewise. Adjust.
        * loop-init.c: Don't #include profile.h
        * tracer.c, predict.c, sched-ebb.c: Adjust #includes.
        * rtl.h: Add coverage prototypes.
        * toplev.c (compile_file): Init coverage, not branch_prob.
        Always call coverage_finish.
        (rest_of_compilation): Call coverage_end_function.

From-SVN: r65897
2003-04-21 19:48:10 +00:00
Jan Hubicka d101590bee gcov-dump.c (tag_summary): Remove max_sum
* gcov-dump.c (tag_summary): Remove max_sum
	* gcov-io.h (gcov_summary, gcov_write_summary, gcov_read_summary): Kill
	max_sum.
	* libgcov.c (gcov_exit): Do one pass over the data.  Make error message
	more verbose.

From-SVN: r65758
2003-04-17 23:33:05 +00:00
Nathan Sidwell 94de45d9fe Makefile.in (loop-init.o): Do not depend on gcov-io.h, gcov-iov.h.
* Makefile.in (loop-init.o): Do not depend on gcov-io.h,
	gcov-iov.h.

	Simplify interface to gcov reading and writing.
	* gcov-io.h (gcov_file, gcov_position, gcov_length, gcov_buffer,
	gcov_alloc, gcov_modified, gcov_errored): Move into ...
	(struct gcov_var gcov_var): ... this static structure.
	(gcov_write_unsigned, gcov_write_counter, gcov_write_string):
	Return void.
	(gcov_read_unsigned, gcov_read_couter, gcov_read_string): Return
	read object.
	(gcov_read_bytes, gcov_write_bytes): Set error flag on error.
	(gcov_reserve_length): Remove.
	(gcov_write_tag): New.
	(gcov_write_length): Adjust.
	(gcov_read_summary, gcov_write_summary): Adjust.
	(gcov_eof, gcov_ok): Rename to ...
	(gcov_is_eof, gcov_is_error): ... here. Return error code.
	(gcov_save_position, gcov_resync): Rename to ...
	(gcov_position, gcov_seek): ... here.
	(gcov_skip, gcov_skip_string): Remove.
	(gcov_error): Remove.
	(gcov_open, gcov_close): Adjust.
	* gcov.c (find_source): Take const char *, copy it on allocation.
	(read_graph_file): Adjust.
	(read_count_file): Adjust.
	* libgcov.c (gcov_exit): Adjust.
	* gcov-dump.c (tag_function, tag_blocks, tag_arcs, tag_lines,
	tag_arc_counts, tag_summary): Return void. Adjust.
	(struct tag_format): Adjust proc member.
	(dump_file): Adjust gcov calls.

From-SVN: r65464
2003-04-11 10:38:57 +00:00
Nathan Sidwell 546d2adb91 Change gcov file interface to single file at a time.
* gcov-io.h: Replace IN_LIBGCC1 with IN_LIBGCOV. Use IN_GCOV.
	Convert to C89 prototypes.
	(gcov_file, gcov_length, gcov_position, gcov_buffer, gcov_alloc,
	gcov_error, gcov_modified): New static variables.
	(gcov_open, gcov_close, gcov_read_bytes, gcov_write_bytes): New
	functions.
	(gcov_write_unsigned, gcov_write_counter, gcov_write_string,
	gcov_read_unsigned, gcov_read_counter, gcov_read_string): Adjust.
	(gcov_read_summary, gcov_write_summary): Adjust.
	(gcov_save_position, gcov_reserve_length, gcov_write_length):
	Adjust.
	(gcov_resync, gcov_skip, gcov_skip_string): Adjust.
	(da_file_open, da_file_close, da_file_eof, da_file_error): Remove.
	(da_file_position, da_file_seek, da_file_write, da_file_read):
	Remove.
	(gcov_error, gcov_eof, gcov_ok, gcov_time): New functions.
	* gcov.c (gcov_type): Don't typedef here.
	(IN_GCOV): #define
	(read_graph_file, read_count_file): Adjust.
	* gcov-dump.c (gcov_type): Don't typedef here.
	(IN_GCOV): #define.
	(tag_function, tag_blocks, tag_arcs, tag_lines, tag_arc_counts):
	Remove FILE parameter, adjust.
	(struct tag_format): Adjust proc member.
	(dump_file): Adjust.
	* libgcov.c (IN_LIBGCOV): #define.
	(gcov_exit): Adjust.
	* loop-init.c: Don't #include gcov-io.h
	* profile.c (struct counts_entry): New structure to hold counter
	values.
	(struct section_reference, struct da_index_entry): Remove.
	(bbg_file, da_file): Remove.
	(htab_counts_index_hash, htab_counts_index_eq,
	htab_counts_index_del): Replace with ...
	(htab_counts_entry_hash, htab_counts_entry_eq,
	htab_counts_entry_del): ... these.
	(cleanup_counts_index, index_counts_file): Remove.
	(read_counts_file): New function.
	(get_exec_counts): Adjust.
	(compute_branch_probabilities): Don't free the exec counts here.
	(branch_prob): Adjust.
	(init_branch_prob): Adjust.
	(end_branch_prob): Adjust.

From-SVN: r65338
2003-04-07 19:37:12 +00:00
Janis Johnson 01e60c33e6 libgcov.c: Provide only dummy functions if libc is not available.
2003-03-27  Janis Johnson  <janis187@us.ibm.com>

	* libgcov.c: Provide only dummy functions if libc is not available.

From-SVN: r64936
2003-03-27 23:52:02 +00:00
Zdenek Dvorak ec4a0419ad gcov-io.h (gcov_save_position, [...]): Modified to enable reading/ writing of whole .da file just once.
* gcov-io.h (gcov_save_position, gcov_reserve_length, gcov_resync,
	gcov_skip, gcov_skip_string, gcov_write_unsigned, gcov_write_counter,
	gcov_write_string, gcov_read_unsigned, gcov_read_counter,
	gcov_read_string, gcov_write_length): Modified to enable reading/
	writing of whole .da file just once.
	(da_file_open, da_file_close, da_file_eof, da_file_error,
	da_file_position, da_file_seek, da_file_write, da_file_read): New
	functions.
	(actual_da_file, actual_da_file_position, actual_da_file_length,
	actual_da_file_buffer, actual_da_file_buffer_size): New static
	functions.
	* libgcov.c (gcov_exit): Modified to read/write the whole .da file at
	just once.

From-SVN: r63800
2003-03-04 20:56:24 +00:00
Zdenek Dvorak cb9e4555c1 gcov-dump.c (print_prefix): Fix signedness warning.
* gcov-dump.c (print_prefix): Fix signedness warning.
	* gcov-io.h (struct counter_section, struct counter_section_data): New.
	(struct function_info): n_arc_counts field removed, n_counter_sections,
	counter_sections fields added.
	(struct gcov_info): arc_counts, n_arc_counts fields removed,
	n_counter_sections, counter_sections fields added.
	* libgcov.c (gcov_exit, __gcov_flush): Add support for multiple
	profile sections.
	* profile.h (MAX_COUNTER_SECTIONS): New.
	(struct section_info): New.
	(struct profile_info): count_instrumented_edges,
	count_edges_instrumented_now fields removed, n_sections, section_info
	fields added.
	(find_counters_section): Declare.
	* profile.c (struct function_list): count_edges field removed,
	n_counter_sections, counter_sections fields added.
	(set_purpose, label_for_tag, build_counter_section_fields,
	build_counter_section_value, build_counter_section_data_fields,
	build_counter_section_data_value, build_function_info_fields,
	build_function_info_value, build_gcov_info_fields,
	build_gcov_info_value): New static functions.
	(find_counters_section): New function.
	(instrument_edges, get_exec_counts, compute_branch_probabilities,
	branch_prob, create_profiler): Modified to support multiple profile
	sections.

From-SVN: r63474
2003-02-26 16:55:10 +00:00
Nathan Sidwell 23af32e6ea Makefile.in (LIB2FUNCS_ST): Remove _gcov.
* Makefile.in (LIB2FUNCS_ST): Remove _gcov.
	(LIBGCOV): New variable.
	(libgcc.mk): Add LIBGCOV.
	(LIBGCC_DEPS): Add libgcov.c.
	(libgcov.a): New target.
	(clean): Remove libgcov.a.
	(install-libgcc): Do libgcov too.
	(stage1-start, stage2-start, stage3-start, stage4-start): Deal
	with libgcov.a.
	* libgcc2.c (L_gcov): Move into ...
	* libgcov.c: ... here. New file.
	* mklibgcc.in: Add libgcov rules.
	* gcc.c (LINK_COMMAND_SPEC): Add -lgcov when profiling.

	* doc/invoke.texi (profile-arcs, test-coverage): Update and
	clarify.

	* profile.c (index_counts_file): Remove duplicate check for open file.

From-SVN: r61905
2003-01-27 23:22:17 +00:00