Commit b20ee094 by Nathan Sidwell Committed by Nathan Sidwell

libgcov-interface.c (STRONG_ALIAS): New.

	* libgcov-interface.c (STRONG_ALIAS): New.
	(__gcov_flush): Call __gcov_reset_int.
	(__gcov_reset): Strong alias for ...
	(__gcov_reset_ing): ... this renamed hidden version.
	* libgcov.h (__gcov_reset_int): New declaration.

From-SVN: r214840
parent 4293bc0c
2014-09-02 Nathan sidwell <nathan@acm.org>
* libgcov-interface.c (STRONG_ALIAS): New.
(__gcov_flush): Call __gcov_reset_int.
(__gcov_reset): Strong alias for ...
(__gcov_reset_ing): ... this renamed hidden version.
* libgcov.h (__gcov_reset_int): New declaration.
2014-08-19 Yaakov Selkowitz <yselkowi@redhat.com> 2014-08-19 Yaakov Selkowitz <yselkowi@redhat.com>
* config/i386/cygming-crtend.c (register_frame_ctor): Move atexit * config/i386/cygming-crtend.c (register_frame_ctor): Move atexit
......
...@@ -42,6 +42,12 @@ void __gcov_dump (void) {} ...@@ -42,6 +42,12 @@ void __gcov_dump (void) {}
#else #else
/* Some functions we want to bind in this dynamic object, but have an
overridable global alias. */
#define STRONG_ALIAS(src,dst) \
extern __typeof (src) dst __attribute__((alias (#src)))
extern __gthread_mutex_t __gcov_flush_mx ATTRIBUTE_HIDDEN; extern __gthread_mutex_t __gcov_flush_mx ATTRIBUTE_HIDDEN;
extern __gthread_mutex_t __gcov_flush_mx ATTRIBUTE_HIDDEN; extern __gthread_mutex_t __gcov_flush_mx ATTRIBUTE_HIDDEN;
...@@ -77,7 +83,7 @@ __gcov_flush (void) ...@@ -77,7 +83,7 @@ __gcov_flush (void)
__gthread_mutex_lock (&__gcov_flush_mx); __gthread_mutex_lock (&__gcov_flush_mx);
__gcov_dump_one (&__gcov_root); __gcov_dump_one (&__gcov_root);
__gcov_reset (); __gcov_reset_int ();
__gthread_mutex_unlock (&__gcov_flush_mx); __gthread_mutex_unlock (&__gcov_flush_mx);
} }
...@@ -121,12 +127,14 @@ gcov_clear (const struct gcov_info *list) ...@@ -121,12 +127,14 @@ gcov_clear (const struct gcov_info *list)
in order to collect profile in region of interest. */ in order to collect profile in region of interest. */
void void
__gcov_reset (void) __gcov_reset_int (void)
{ {
gcov_clear (__gcov_root.list); gcov_clear (__gcov_root.list);
__gcov_root.dumped = 0; __gcov_root.dumped = 0;
} }
STRONG_ALIAS (__gcov_reset_int, __gcov_reset);
#endif /* L_gcov_reset */ #endif /* L_gcov_reset */
#ifdef L_gcov_dump #ifdef L_gcov_dump
......
...@@ -225,8 +225,10 @@ extern void __gcov_init (struct gcov_info *) ATTRIBUTE_HIDDEN; ...@@ -225,8 +225,10 @@ extern void __gcov_init (struct gcov_info *) ATTRIBUTE_HIDDEN;
/* Called before fork, to avoid double counting. */ /* Called before fork, to avoid double counting. */
extern void __gcov_flush (void) ATTRIBUTE_HIDDEN; extern void __gcov_flush (void) ATTRIBUTE_HIDDEN;
/* Function to reset all counters to 0. */ /* Function to reset all counters to 0. Both externally visible (and
overridable) and internal version. */
extern void __gcov_reset (void); extern void __gcov_reset (void);
extern void __gcov_reset_int (void) ATTRIBUTE_HIDDEN;
/* Function to enable early write of profile information so far. */ /* Function to enable early write of profile information so far. */
extern void __gcov_dump (void); extern void __gcov_dump (void);
......
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