From: Adrian Hunter <adrian.hunter@intel.com>
To: Jiri Olsa <jolsa@redhat.com>
Cc: linux-kernel@vger.kernel.org,
Corey Ashford <cjashfor@linux.vnet.ibm.com>,
Ingo Molnar <mingo@elte.hu>, Paul Mackerras <paulus@samba.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
David Ahern <dsahern@gmail.com>
Subject: Re: [PATCH] perf tools: Renaming 'time' variable in perf_time_to_tsc due to name shadowing error
Date: Sat, 03 Aug 2013 22:23:05 +0300 [thread overview]
Message-ID: <51FD5899.6060100@intel.com> (raw)
In-Reply-To: <20130802133346.GD1711@krava.brq.redhat.com>
On 2/08/2013 4:33 p.m., Jiri Olsa wrote:
> The perf compilation fails with following error:
> ...
> CC arch/x86/util/tsc.o
> arch/x86/util/tsc.c: In function ‘perf_time_to_tsc’:
> arch/x86/util/tsc.c:13:6: error: declaration of ‘time’ shadows a global declaration [-Werror=shadow]
> cc1: all warnings being treated as errors
>
> Renaming the 'time' variable to prevent this.
Did you see David did the same patch.
Although David noted the gcc version. It doesn't happen for gcc 4.7.3.
The commit message should probably reflect that it depends on the gcc
version.
Otherwise:
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
>
> Signed-off-by: Jiri Olsa<jolsa@redhat.com>
> Cc: Arnaldo Carvalho de Melo<acme@redhat.com>
> Cc: Corey Ashford<cjashfor@linux.vnet.ibm.com>
> Cc: Ingo Molnar<mingo@elte.hu>
> Cc: Paul Mackerras<paulus@samba.org>
> Cc: Peter Zijlstra<a.p.zijlstra@chello.nl>
> Cc: Arnaldo Carvalho de Melo<acme@redhat.com>
> Cc: David Ahern<dsahern@gmail.com>
> Cc: Adrian Hunter<adrian.hunter@intel.com>
> ---
> tools/perf/arch/x86/util/tsc.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tools/perf/arch/x86/util/tsc.c b/tools/perf/arch/x86/util/tsc.c
> index f111744..9570c2b 100644
> --- a/tools/perf/arch/x86/util/tsc.c
> +++ b/tools/perf/arch/x86/util/tsc.c
> @@ -10,11 +10,11 @@
>
> u64 perf_time_to_tsc(u64 ns, struct perf_tsc_conversion *tc)
> {
> - u64 time, quot, rem;
> + u64 t, quot, rem;
>
> - time = ns - tc->time_zero;
> - quot = time / tc->time_mult;
> - rem = time % tc->time_mult;
> + t = ns - tc->time_zero;
> + quot = t / tc->time_mult;
> + rem = t % tc->time_mult;
> return (quot<< tc->time_shift) +
> (rem<< tc->time_shift) / tc->time_mult;
> }
next prev parent reply other threads:[~2013-08-03 19:23 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-30 9:18 [PATCHSET 00/17] perf tools: Introduce new 'ftrace' command (v4) Namhyung Kim
2013-07-30 9:18 ` [PATCH 01/17] perf util: Save pid-cmdline mapping into tracing header Namhyung Kim
2013-07-30 13:28 ` Arnaldo Carvalho de Melo
2013-07-31 0:51 ` Namhyung Kim
2013-07-31 14:07 ` Arnaldo Carvalho de Melo
2013-08-05 7:17 ` Namhyung Kim
2013-08-07 13:44 ` David Ahern
2013-08-09 5:51 ` Namhyung Kim
2013-07-30 9:18 ` [PATCH 02/17] perf util: Add more debug message on failure path Namhyung Kim
2013-07-30 13:33 ` Arnaldo Carvalho de Melo
2013-07-30 9:19 ` [PATCH 03/17] perf tools: Introduce new 'ftrace' tool Namhyung Kim
2013-07-30 9:19 ` [PATCH 04/17] perf ftrace: Add support for --pid option Namhyung Kim
2013-07-30 9:19 ` [PATCH 05/17] perf ftrace: Add support for -a and -C option Namhyung Kim
2013-07-30 9:19 ` [PATCH 06/17] perf ftrace: Split "live" sub-command Namhyung Kim
2013-07-30 9:19 ` [PATCH 07/17] perf ftrace: Add 'record' sub-command Namhyung Kim
2013-07-30 9:19 ` [PATCH 08/17] perf ftrace: Add 'show' sub-command Namhyung Kim
2013-07-30 9:19 ` [PATCH 09/17] perf ftrace: Add 'report' sub-command Namhyung Kim
2013-07-30 9:19 ` [PATCH 10/17] perf ftrace: Add dump_printf() for low-level debugging Namhyung Kim
2013-07-30 9:19 ` [PATCH 11/17] perf ftrace: Use pager for displaying result Namhyung Kim
2013-07-30 9:19 ` [PATCH 12/17] perf ftrace: Cleanup using ftrace_setup/teardown() Namhyung Kim
2013-07-30 9:19 ` [PATCH 13/17] perf tools: Add document for perf-ftrace command Namhyung Kim
2013-07-30 9:19 ` [PATCH 14/17] perf ftrace: Add a signal handler for SIGSEGV Namhyung Kim
2013-07-30 9:19 ` [PATCH 15/17] perf ftrace: Add --clock option Namhyung Kim
2013-07-30 9:19 ` [PATCH 16/17] perf ftrace: Show leaf-functions as oneliner Namhyung Kim
2013-07-30 9:19 ` [PATCH 17/17] perf ftrace: Tidy up the function graph output of 'show' subcommand Namhyung Kim
2013-08-01 12:02 ` [PATCHSET 00/17] perf tools: Introduce new 'ftrace' command (v4) Jiri Olsa
2013-08-02 9:16 ` Ingo Molnar
2013-08-05 7:44 ` Namhyung Kim
[not found] ` <51FB2B90.6090602@gmail.com>
2013-08-02 13:33 ` [PATCH] perf tools: Renaming 'time' variable in perf_time_to_tsc due to name shadowing error Jiri Olsa
2013-08-03 19:23 ` Adrian Hunter [this message]
2013-08-05 7:47 ` Jiri Olsa
2013-08-09 10:23 ` [PATCHSET 00/17] perf tools: Introduce new 'ftrace' command (v4) Jiri Olsa
2013-08-13 2:20 ` Namhyung Kim
2013-08-28 14:57 ` Jeremy Eder
2013-08-29 2:56 ` Namhyung Kim
2013-08-09 10:25 ` Jiri Olsa
2013-08-09 10:30 ` Jiri Olsa
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=51FD5899.6060100@intel.com \
--to=adrian.hunter@intel.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=cjashfor@linux.vnet.ibm.com \
--cc=dsahern@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
/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