From: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
To: Yuan Pengfei <coolypf@qq.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>, yuanpf12@sei.pku.edu.cn
Subject: Re: [PATCH] gcov: add support for GCC 4.9
Date: Mon, 12 May 2014 14:08:19 +0200 [thread overview]
Message-ID: <5370B9B3.4050705@linux.vnet.ibm.com> (raw)
In-Reply-To: <tencent_339F323E15E730DF6D7AC23A@qq.com>
On 11.05.2014 06:55, Yuan Pengfei wrote:
> From: Yuan Pengfei <coolypf@qq.com>
>
> This patch handles the gcov-related changes in GCC 4.9:
> A new counter (time profile) is added.
It appears that this patch contains two independent sets of changes:
1. Updates to gcov-kernel required to work with GCC 4.9
(#counters + new merge function stub)
2. A bug-fix required when using GCC option -fprofile-values
which is currently not supported by gcov-kernel
(see https://lkml.org/lkml/2014/2/19/74)
Please split these changes into separate patches.
Change 1) is definitely useful as without it .gcda file creation will
fail when compiling the kernel with GCC 4.9.
Regarding change 2) I still don't think this is necessary unless:
a) there is a way to trigger the problem without -fprofile-values, or
b) you intend to send an additional patch set that enables
-fprofile-values profiling for gcov-kernel in which case the fix
should be part of that patch set.
> See http://gcc.gnu.org/gcc-4.9/changes.html
> Signed-off-by: Yuan Pengfei <coolypf@qq.com>
> ---
> kernel/gcov/base.c | 6 ++++++
> kernel/gcov/gcc_3_4.c | 2 +-
> kernel/gcov/gcc_4_7.c | 7 ++++++-
> 3 files changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/gcov/base.c b/kernel/gcov/base.c
> index f45b75b..b358a80 100644
> --- a/kernel/gcov/base.c
> +++ b/kernel/gcov/base.c
> @@ -85,6 +85,12 @@ void __gcov_merge_ior(gcov_type *counters, unsigned int n_counters)
> }
> EXPORT_SYMBOL(__gcov_merge_ior);
>
> +void __gcov_merge_time_profile(gcov_type *counters, unsigned int n_counters)
> +{
> + /* Unused. */
> +}
> +EXPORT_SYMBOL(__gcov_merge_time_profile);
> +
> /**
> * gcov_enable_events - enable event reporting through gcov_event()
> *
> diff --git a/kernel/gcov/gcc_3_4.c b/kernel/gcov/gcc_3_4.c
> index 27bc88a..1c1f425 100644
> --- a/kernel/gcov/gcc_3_4.c
> +++ b/kernel/gcov/gcc_3_4.c
> @@ -269,7 +269,7 @@ struct gcov_info *gcov_info_dup(struct gcov_info *info)
> dup->counts[i].num = ctr->num;
> dup->counts[i].merge = ctr->merge;
> dup->counts[i].values = vmalloc(size);
> - if (!dup->counts[i].values)
> + if (size && !dup->counts[i].values)
> goto err_free;
> memcpy(dup->counts[i].values, ctr->values, size);
> }
> diff --git a/kernel/gcov/gcc_4_7.c b/kernel/gcov/gcc_4_7.c
> index 2c6e463..7f74b59 100644
> --- a/kernel/gcov/gcc_4_7.c
> +++ b/kernel/gcov/gcc_4_7.c
> @@ -18,7 +18,12 @@
> #include <linux/vmalloc.h>
> #include "gcov.h"
>
> +#if __GNUC__ == 4 && __GNUC_MINOR__ >= 9
> +#define GCOV_COUNTERS 9
> +#else
> #define GCOV_COUNTERS 8
> +#endif
> +
> #define GCOV_TAG_FUNCTION_LENGTH 3
>
> static struct gcov_info *gcov_info_head;
> @@ -290,7 +295,7 @@ struct gcov_info *gcov_info_dup(struct gcov_info *info)
>
> dci_ptr->values = vmalloc(cv_size);
>
> - if (!dci_ptr->values)
> + if (cv_size && !dci_ptr->values)
> goto err_free;
>
> dci_ptr->num = sci_ptr->num;
>
--
Peter Oberparleiter
Linux on System z Development - IBM Germany
next parent reply other threads:[~2014-05-12 12:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <tencent_339F323E15E730DF6D7AC23A@qq.com>
2014-05-12 12:08 ` Peter Oberparleiter [this message]
2014-05-11 5:22 [PATCH] gcov: add support for GCC 4.9 Yuan Pengfei
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5370B9B3.4050705@linux.vnet.ibm.com \
--to=oberpar@linux.vnet.ibm.com \
--cc=coolypf@qq.com \
--cc=linux-kernel@vger.kernel.org \
--cc=yuanpf12@sei.pku.edu.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox