From patchwork Fri Aug 1 10:06:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 375681 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4E33A140110 for ; Fri, 1 Aug 2014 20:06:50 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=Y/qKpDQcsM3B3FhEsUPNi/28Y7I8rnwqn5eqpPHd9uFMGo 9j8rjeUeOFb8ZQ4BUFK+pZyZ+QIRNSONRaxUfdwiouBYtcXiAaOwSYrv3VCh4gKG we/RpSHDQQP3I/CUEVAj29lkZPCZypbkEMGzNvdplzyOV9Z2RDg9AFrnNdy70= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=mjlsdi5AIWm1zYo0PG+Dr99Ye/A=; b=lBg0hzey31XFOzBgMBaa wm9f7ajxJDFPhjl447eYf+NC4VZKRNb+Xb/zVwOIg4aRGqiUlRTTNPsqrlDK7S3O H6aWpAqnJ8zPDrb7M5fDlfoF7Ff1vrJcOG41hqvley3n65xmGaxEm6j5Lju7v36D JBGhQxzgbgUeAHRAa0lAmT0= Received: (qmail 29967 invoked by alias); 1 Aug 2014 10:06:42 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 29936 invoked by uid 89); 1 Aug 2014 10:06:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-we0-f171.google.com Received: from mail-we0-f171.google.com (HELO mail-we0-f171.google.com) (74.125.82.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 01 Aug 2014 10:06:37 +0000 Received: by mail-we0-f171.google.com with SMTP id p10so4138122wes.16 for ; Fri, 01 Aug 2014 03:06:33 -0700 (PDT) X-Received: by 10.180.12.76 with SMTP id w12mr5368242wib.4.1406887592382; Fri, 01 Aug 2014 03:06:32 -0700 (PDT) Received: from [192.168.44.112] (05436870.skybroadband.com. [5.67.104.112]) by mx.google.com with ESMTPSA id ex2sm7121004wic.24.2014.08.01.03.06.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 01 Aug 2014 03:06:30 -0700 (PDT) Message-ID: <53DB66A4.7070500@acm.org> Date: Fri, 01 Aug 2014 11:06:28 +0100 From: Nathan Sidwell User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 MIME-Version: 1.0 To: GCC Patches Subject: gcov tidy up X-IsSubscribed: yes In developing the next patch I found some places to tidy up first. Committed. nathan 2014-08-01 Nathan Sidwell * Makefile.in (LIBGCOV_MERGE, LIBGCOV_PROFILER, LIBGCOV_INTERFACE): Reformat. * libgcov-driver.c (gcov_exit, __gcov_init): Disable when IN_GCOV_TOOL. * libgcov-interface.c: Reformat some comments. (__gcov_flush_mx): Add declaration. Tidy up definition. Index: libgcc/Makefile.in =================================================================== --- libgcc/Makefile.in (revision 213384) +++ libgcc/Makefile.in (working copy) @@ -852,13 +852,15 @@ include $(iterator) # Build libgcov components. -LIBGCOV_MERGE = _gcov_merge_add _gcov_merge_single _gcov_merge_delta _gcov_merge_ior \ - _gcov_merge_time_profile -LIBGCOV_PROFILER = _gcov_interval_profiler _gcov_pow2_profiler _gcov_one_value_profiler \ - _gcov_indirect_call_profiler _gcov_average_profiler _gcov_ior_profiler \ - _gcov_indirect_call_profiler_v2 _gcov_time_profiler -LIBGCOV_INTERFACE = _gcov_flush _gcov_fork _gcov_execl _gcov_execlp _gcov_execle \ - _gcov_execv _gcov_execvp _gcov_execve _gcov_reset _gcov_dump +LIBGCOV_MERGE = _gcov_merge_add _gcov_merge_single _gcov_merge_delta \ + _gcov_merge_ior _gcov_merge_time_profile +LIBGCOV_PROFILER = _gcov_interval_profiler _gcov_pow2_profiler \ + _gcov_one_value_profiler _gcov_indirect_call_profiler \ + _gcov_average_profiler _gcov_ior_profiler \ + _gcov_indirect_call_profiler_v2 _gcov_time_profiler +LIBGCOV_INTERFACE = _gcov_flush _gcov_fork _gcov_execl _gcov_execlp \ + _gcov_execle _gcov_execv _gcov_execvp _gcov_execve _gcov_reset \ + _gcov_dump LIBGCOV_DRIVER = _gcov libgcov-merge-objects = $(patsubst %,%$(objext),$(LIBGCOV_MERGE)) Index: libgcc/libgcov-driver.c =================================================================== --- libgcc/libgcov-driver.c (revision 213384) +++ libgcc/libgcov-driver.c (working copy) @@ -775,6 +775,7 @@ gcov_do_dump (struct gcov_info *list, in free (gf.filename); } +#if !IN_GCOV_TOOL void gcov_exit (void) { @@ -840,6 +841,6 @@ __gcov_init (struct gcov_info *info) } info->version = 0; } - +#endif /* !IN_GCOV_TOOL */ #endif /* L_gcov */ #endif /* inhibit_libc */ Index: libgcc/libgcov-interface.c =================================================================== --- libgcc/libgcov-interface.c (revision 213384) +++ libgcc/libgcov-interface.c (working copy) @@ -44,20 +44,21 @@ void __gcov_dump (void) {} extern void gcov_clear (void) ATTRIBUTE_HIDDEN; extern void gcov_exit (void) ATTRIBUTE_HIDDEN; +extern __gthread_mutex_t __gcov_flush_mx ATTRIBUTE_HIDDEN; #ifdef L_gcov_flush - #ifdef __GTHREAD_MUTEX_INIT -ATTRIBUTE_HIDDEN __gthread_mutex_t __gcov_flush_mx = __GTHREAD_MUTEX_INIT; +__gthread_mutex_t __gcov_flush_mx = __GTHREAD_MUTEX_INIT; #define init_mx_once() #else -__gthread_mutex_t __gcov_flush_mx ATTRIBUTE_HIDDEN; +__gthread_mutex_t __gcov_flush_mx; static void init_mx (void) { __GTHREAD_MUTEX_INIT_FUNCTION (&__gcov_flush_mx); } + static void init_mx_once (void) { @@ -160,8 +161,8 @@ __gcov_execl (const char *path, char *ar #endif #ifdef L_gcov_execlp -/* A wrapper for the execlp function. Flushes the accumulated profiling data, so - that they are not lost. */ +/* A wrapper for the execlp function. Flushes the accumulated + profiling data, so that they are not lost. */ int __gcov_execlp (const char *path, char *arg, ...) @@ -191,8 +192,8 @@ __gcov_execlp (const char *path, char *a #endif #ifdef L_gcov_execle -/* A wrapper for the execle function. Flushes the accumulated profiling data, so - that they are not lost. */ +/* A wrapper for the execle function. Flushes the accumulated + profiling data, so that they are not lost. */ int __gcov_execle (const char *path, char *arg, ...) @@ -224,8 +225,8 @@ __gcov_execle (const char *path, char *a #endif #ifdef L_gcov_execv -/* A wrapper for the execv function. Flushes the accumulated profiling data, so - that they are not lost. */ +/* A wrapper for the execv function. Flushes the accumulated + profiling data, so that they are not lost. */ int __gcov_execv (const char *path, char *const argv[]) @@ -236,8 +237,8 @@ __gcov_execv (const char *path, char *co #endif #ifdef L_gcov_execvp -/* A wrapper for the execvp function. Flushes the accumulated profiling data, so - that they are not lost. */ +/* A wrapper for the execvp function. Flushes the accumulated + profiling data, so that they are not lost. */ int __gcov_execvp (const char *path, char *const argv[]) @@ -248,8 +249,8 @@ __gcov_execvp (const char *path, char *c #endif #ifdef L_gcov_execve -/* A wrapper for the execve function. Flushes the accumulated profiling data, so - that they are not lost. */ +/* A wrapper for the execve function. Flushes the accumulated + profiling data, so that they are not lost. */ int __gcov_execve (const char *path, char *const argv[], char *const envp[])