* [PATCH 0/4] perf tools: Some fixes and updates @ 2012-04-05 16:26 Robert Richter 2012-04-05 16:26 ` [PATCH 1/4] perf tools: Fix include header files in util/parse-events.h Robert Richter ` (3 more replies) 0 siblings, 4 replies; 15+ messages in thread From: Robert Richter @ 2012-04-05 16:26 UTC (permalink / raw) To: Arnaldo Carvalho de Melo; +Cc: Ingo Molnar, LKML, Robert Richter Enclosed some changes made while working with the code. Mostly trivial but worth to add. -Robert Robert Richter (4): perf tools: Fix include header files in util/parse-events.h perf tools: Fix thread map that is type pid_t perf tools: Declare some references static in builtin-stat.c perf tools: Use sw counter only if hw pmu is not detected tools/perf/builtin-record.c | 2 +- tools/perf/builtin-stat.c | 26 +++++++++++++------------- tools/perf/util/parse-events.h | 2 ++ tools/perf/util/thread_map.h | 2 +- 4 files changed, 17 insertions(+), 15 deletions(-) -- 1.7.8.4 ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 1/4] perf tools: Fix include header files in util/parse-events.h 2012-04-05 16:26 [PATCH 0/4] perf tools: Some fixes and updates Robert Richter @ 2012-04-05 16:26 ` Robert Richter 2012-04-24 16:53 ` Robert Richter 2012-05-11 6:27 ` [tip:perf/core] perf tools: Fix include header files in util/ parse-events.h tip-bot for Robert Richter 2012-04-05 16:26 ` [PATCH 2/4] perf tools: Fix thread map that is type pid_t Robert Richter ` (2 subsequent siblings) 3 siblings, 2 replies; 15+ messages in thread From: Robert Richter @ 2012-04-05 16:26 UTC (permalink / raw) To: Arnaldo Carvalho de Melo; +Cc: Ingo Molnar, LKML, Robert Richter Include header fixes for ... bool: util/parse-events.h:31: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘have_tracepoints’ ... and types.h: util/parse-events.h:28: error: expected ‘)’ before ‘config’ util/parse-events.h:34: error: expected declaration specifiers or ‘...’ before ‘u64’ util/parse-events.h:45: error: expected ‘)’ before ‘type’ This happens if now other include files are included before util/parse-events.h. Signed-off-by: Robert Richter <robert.richter@amd.com> --- tools/perf/util/parse-events.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h index 6d7c74b..ab6ebe0 100644 --- a/tools/perf/util/parse-events.h +++ b/tools/perf/util/parse-events.h @@ -4,7 +4,9 @@ * Parse symbolic events/counts passed in as options: */ +#include <stdbool.h> #include "../../../include/linux/perf_event.h" +#include "types.h" struct list_head; struct perf_evsel; -- 1.7.8.4 ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 1/4] perf tools: Fix include header files in util/parse-events.h 2012-04-05 16:26 ` [PATCH 1/4] perf tools: Fix include header files in util/parse-events.h Robert Richter @ 2012-04-24 16:53 ` Robert Richter 2012-04-24 17:35 ` Arnaldo Carvalho de Melo 2012-05-11 6:27 ` [tip:perf/core] perf tools: Fix include header files in util/ parse-events.h tip-bot for Robert Richter 1 sibling, 1 reply; 15+ messages in thread From: Robert Richter @ 2012-04-24 16:53 UTC (permalink / raw) To: Arnaldo Carvalho de Melo; +Cc: Ingo Molnar, LKML On 05.04.12 18:26:25, Robert Richter wrote: > Include header fixes for > > ... bool: > > util/parse-events.h:31: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘have_tracepoints’ > > ... and types.h: > > util/parse-events.h:28: error: expected ‘)’ before ‘config’ > util/parse-events.h:34: error: expected declaration specifiers or ‘...’ before ‘u64’ > util/parse-events.h:45: error: expected ‘)’ before ‘type’ > > This happens if now other include files are included before > util/parse-events.h. > > Signed-off-by: Robert Richter <robert.richter@amd.com> Arnaldo, is it your intention that you didn't apply this patch? Thanks, -Robert > --- > tools/perf/util/parse-events.h | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h > index 6d7c74b..ab6ebe0 100644 > --- a/tools/perf/util/parse-events.h > +++ b/tools/perf/util/parse-events.h > @@ -4,7 +4,9 @@ > * Parse symbolic events/counts passed in as options: > */ > > +#include <stdbool.h> > #include "../../../include/linux/perf_event.h" > +#include "types.h" > > struct list_head; > struct perf_evsel; > -- > 1.7.8.4 > -- Advanced Micro Devices, Inc. Operating System Research Center ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/4] perf tools: Fix include header files in util/parse-events.h 2012-04-24 16:53 ` Robert Richter @ 2012-04-24 17:35 ` Arnaldo Carvalho de Melo 2012-04-24 17:58 ` Robert Richter 0 siblings, 1 reply; 15+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-04-24 17:35 UTC (permalink / raw) To: Robert Richter; +Cc: Ingo Molnar, LKML Em Tue, Apr 24, 2012 at 06:53:44PM +0200, Robert Richter escreveu: > On 05.04.12 18:26:25, Robert Richter wrote: > > Include header fixes for > > > > ... bool: > > > > util/parse-events.h:31: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘have_tracepoints’ > > > > ... and types.h: > > > > util/parse-events.h:28: error: expected ‘)’ before ‘config’ > > util/parse-events.h:34: error: expected declaration specifiers or ‘...’ before ‘u64’ > > util/parse-events.h:45: error: expected ‘)’ before ‘type’ > > > > This happens if now other include files are included before > > util/parse-events.h. > > > > Signed-off-by: Robert Richter <robert.richter@amd.com> > > Arnaldo, > > is it your intention that you didn't apply this patch? Is this on perf/urgent or perf/core? In what system does this happen? - Arnaldo > Thanks, > > -Robert > > > --- > > tools/perf/util/parse-events.h | 2 ++ > > 1 files changed, 2 insertions(+), 0 deletions(-) > > > > diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h > > index 6d7c74b..ab6ebe0 100644 > > --- a/tools/perf/util/parse-events.h > > +++ b/tools/perf/util/parse-events.h > > @@ -4,7 +4,9 @@ > > * Parse symbolic events/counts passed in as options: > > */ > > > > +#include <stdbool.h> > > #include "../../../include/linux/perf_event.h" > > +#include "types.h" > > > > struct list_head; > > struct perf_evsel; > > -- > > 1.7.8.4 > > > > -- > Advanced Micro Devices, Inc. > Operating System Research Center ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/4] perf tools: Fix include header files in util/parse-events.h 2012-04-24 17:35 ` Arnaldo Carvalho de Melo @ 2012-04-24 17:58 ` Robert Richter 2012-04-25 10:21 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 15+ messages in thread From: Robert Richter @ 2012-04-24 17:58 UTC (permalink / raw) To: Arnaldo Carvalho de Melo; +Cc: Ingo Molnar, LKML On 24.04.12 14:35:55, Arnaldo Carvalho de Melo wrote: > Em Tue, Apr 24, 2012 at 06:53:44PM +0200, Robert Richter escreveu: > > On 05.04.12 18:26:25, Robert Richter wrote: > > > Include header fixes for > > > > > > ... bool: > > > > > > util/parse-events.h:31: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘have_tracepoints’ > > > > > > ... and types.h: > > > > > > util/parse-events.h:28: error: expected ‘)’ before ‘config’ > > > util/parse-events.h:34: error: expected declaration specifiers or ‘...’ before ‘u64’ > > > util/parse-events.h:45: error: expected ‘)’ before ‘type’ > > > > > > This happens if now other include files are included before > > > util/parse-events.h. > > > > > > Signed-off-by: Robert Richter <robert.richter@amd.com> > > > > Arnaldo, > > > > is it your intention that you didn't apply this patch? > > Is this on perf/urgent or perf/core? In what system does this happen? Neither, I stumbled over this while working on a modified version of perf tools. The interface definition of util/parse-events.h contains type bool and u64, but both are not defined. Thus, including parse-events.h independently of other header files will raise this compile errors. It took me some time to figure out what happened so I think it is worth fixing it. -Robert -- Advanced Micro Devices, Inc. Operating System Research Center ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/4] perf tools: Fix include header files in util/parse-events.h 2012-04-24 17:58 ` Robert Richter @ 2012-04-25 10:21 ` Arnaldo Carvalho de Melo 0 siblings, 0 replies; 15+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-04-25 10:21 UTC (permalink / raw) To: Robert Richter; +Cc: Ingo Molnar, LKML Em Tue, Apr 24, 2012 at 07:58:04PM +0200, Robert Richter escreveu: > On 24.04.12 14:35:55, Arnaldo Carvalho de Melo wrote: > > Em Tue, Apr 24, 2012 at 06:53:44PM +0200, Robert Richter escreveu: > > > On 05.04.12 18:26:25, Robert Richter wrote: > > > > Include header fixes for > > > > > > > > ... bool: > > > > > > > > util/parse-events.h:31: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘have_tracepoints’ > > > > > > > > ... and types.h: > > > > > > > > util/parse-events.h:28: error: expected ‘)’ before ‘config’ > > > > util/parse-events.h:34: error: expected declaration specifiers or ‘...’ before ‘u64’ > > > > util/parse-events.h:45: error: expected ‘)’ before ‘type’ > > > > > > > > This happens if now other include files are included before > > > > util/parse-events.h. > > > > > > > > Signed-off-by: Robert Richter <robert.richter@amd.com> > > > > > > Arnaldo, > > > > > > is it your intention that you didn't apply this patch? > > > > Is this on perf/urgent or perf/core? In what system does this happen? > > Neither, I stumbled over this while working on a modified version of > perf tools. The interface definition of util/parse-events.h contains > type bool and u64, but both are not defined. Thus, including > parse-events.h independently of other header files will raise this > compile errors. It took me some time to figure out what happened so I > think it is worth fixing it. Cool, that explains why I have not stumbled on it, thanks for explaining, will apply. - Arnaldo ^ permalink raw reply [flat|nested] 15+ messages in thread
* [tip:perf/core] perf tools: Fix include header files in util/ parse-events.h 2012-04-05 16:26 ` [PATCH 1/4] perf tools: Fix include header files in util/parse-events.h Robert Richter 2012-04-24 16:53 ` Robert Richter @ 2012-05-11 6:27 ` tip-bot for Robert Richter 1 sibling, 0 replies; 15+ messages in thread From: tip-bot for Robert Richter @ 2012-05-11 6:27 UTC (permalink / raw) To: linux-tip-commits; +Cc: acme, linux-kernel, hpa, mingo, robert.richter, tglx Commit-ID: c651214e90e5c150015f7524a6bfc298ad61435f Gitweb: http://git.kernel.org/tip/c651214e90e5c150015f7524a6bfc298ad61435f Author: Robert Richter <robert.richter@amd.com> AuthorDate: Thu, 5 Apr 2012 18:26:25 +0200 Committer: Arnaldo Carvalho de Melo <acme@redhat.com> CommitDate: Wed, 2 May 2012 15:14:35 -0300 perf tools: Fix include header files in util/parse-events.h Include header fixes for ... bool: util/parse-events.h:31: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘have_tracepoints’ ... and types.h: util/parse-events.h:28: error: expected ‘)’ before ‘config’ util/parse-events.h:34: error: expected declaration specifiers or ‘...’ before ‘u64’ util/parse-events.h:45: error: expected ‘)’ before ‘type’ This happens if now other include files are included before util/parse-events.h. Signed-off-by: Robert Richter <robert.richter@amd.com> Cc: Ingo Molnar <mingo@kernel.org> Link: http://lkml.kernel.org/r/1333643188-26895-2-git-send-email-robert.richter@amd.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/parse-events.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h index ca069f8..5cb0028 100644 --- a/tools/perf/util/parse-events.h +++ b/tools/perf/util/parse-events.h @@ -4,7 +4,9 @@ * Parse symbolic events/counts passed in as options: */ +#include <stdbool.h> #include "../../../include/linux/perf_event.h" +#include "types.h" struct list_head; struct perf_evsel; ^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 2/4] perf tools: Fix thread map that is type pid_t 2012-04-05 16:26 [PATCH 0/4] perf tools: Some fixes and updates Robert Richter 2012-04-05 16:26 ` [PATCH 1/4] perf tools: Fix include header files in util/parse-events.h Robert Richter @ 2012-04-05 16:26 ` Robert Richter 2012-04-13 18:23 ` [tip:perf/core] " tip-bot for Robert Richter 2012-04-05 16:26 ` [PATCH 3/4] perf tools: Declare some references static in builtin-stat.c Robert Richter 2012-04-05 16:26 ` [PATCH 4/4] perf tools: Use sw counter only if hw pmu is not detected Robert Richter 3 siblings, 1 reply; 15+ messages in thread From: Robert Richter @ 2012-04-05 16:26 UTC (permalink / raw) To: Arnaldo Carvalho de Melo; +Cc: Ingo Molnar, LKML, Robert Richter Thread map is actually type pid_t and not int. Signed-off-by: Robert Richter <robert.richter@amd.com> --- tools/perf/util/thread_map.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/perf/util/thread_map.h b/tools/perf/util/thread_map.h index 7da80f1..f718df8 100644 --- a/tools/perf/util/thread_map.h +++ b/tools/perf/util/thread_map.h @@ -6,7 +6,7 @@ struct thread_map { int nr; - int map[]; + pid_t map[]; }; struct thread_map *thread_map__new_by_pid(pid_t pid); -- 1.7.8.4 ^ permalink raw reply related [flat|nested] 15+ messages in thread
* [tip:perf/core] perf tools: Fix thread map that is type pid_t 2012-04-05 16:26 ` [PATCH 2/4] perf tools: Fix thread map that is type pid_t Robert Richter @ 2012-04-13 18:23 ` tip-bot for Robert Richter 0 siblings, 0 replies; 15+ messages in thread From: tip-bot for Robert Richter @ 2012-04-13 18:23 UTC (permalink / raw) To: linux-tip-commits; +Cc: acme, linux-kernel, hpa, mingo, robert.richter, tglx Commit-ID: 61d5bf5b01a0baf0934a4bd3d15bc14e4bbf202c Gitweb: http://git.kernel.org/tip/61d5bf5b01a0baf0934a4bd3d15bc14e4bbf202c Author: Robert Richter <robert.richter@amd.com> AuthorDate: Thu, 5 Apr 2012 18:26:26 +0200 Committer: Arnaldo Carvalho de Melo <acme@redhat.com> CommitDate: Wed, 11 Apr 2012 17:38:50 -0300 perf tools: Fix thread map that is type pid_t Thread map is actually type pid_t and not int. Signed-off-by: Robert Richter <robert.richter@amd.com> Cc: Ingo Molnar <mingo@kernel.org> Link: http://lkml.kernel.org/r/1333643188-26895-3-git-send-email-robert.richter@amd.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/util/thread_map.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/perf/util/thread_map.h b/tools/perf/util/thread_map.h index 7da80f1..f718df8 100644 --- a/tools/perf/util/thread_map.h +++ b/tools/perf/util/thread_map.h @@ -6,7 +6,7 @@ struct thread_map { int nr; - int map[]; + pid_t map[]; }; struct thread_map *thread_map__new_by_pid(pid_t pid); ^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 3/4] perf tools: Declare some references static in builtin-stat.c 2012-04-05 16:26 [PATCH 0/4] perf tools: Some fixes and updates Robert Richter 2012-04-05 16:26 ` [PATCH 1/4] perf tools: Fix include header files in util/parse-events.h Robert Richter 2012-04-05 16:26 ` [PATCH 2/4] perf tools: Fix thread map that is type pid_t Robert Richter @ 2012-04-05 16:26 ` Robert Richter 2012-04-13 18:22 ` [tip:perf/core] perf stat: Declare some references static tip-bot for Robert Richter 2012-04-05 16:26 ` [PATCH 4/4] perf tools: Use sw counter only if hw pmu is not detected Robert Richter 3 siblings, 1 reply; 15+ messages in thread From: Robert Richter @ 2012-04-05 16:26 UTC (permalink / raw) To: Arnaldo Carvalho de Melo; +Cc: Ingo Molnar, LKML, Robert Richter This references are not exported, use static declaration. Signed-off-by: Robert Richter <robert.richter@amd.com> --- tools/perf/builtin-stat.c | 26 +++++++++++++------------- 1 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index c941bb6..dde9e17 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -173,7 +173,7 @@ static struct perf_event_attr very_very_detailed_attrs[] = { -struct perf_evlist *evsel_list; +static struct perf_evlist *evsel_list; static bool system_wide = false; static int run_idx = 0; @@ -265,18 +265,18 @@ static double stddev_stats(struct stats *stats) return sqrt(variance_mean); } -struct stats runtime_nsecs_stats[MAX_NR_CPUS]; -struct stats runtime_cycles_stats[MAX_NR_CPUS]; -struct stats runtime_stalled_cycles_front_stats[MAX_NR_CPUS]; -struct stats runtime_stalled_cycles_back_stats[MAX_NR_CPUS]; -struct stats runtime_branches_stats[MAX_NR_CPUS]; -struct stats runtime_cacherefs_stats[MAX_NR_CPUS]; -struct stats runtime_l1_dcache_stats[MAX_NR_CPUS]; -struct stats runtime_l1_icache_stats[MAX_NR_CPUS]; -struct stats runtime_ll_cache_stats[MAX_NR_CPUS]; -struct stats runtime_itlb_cache_stats[MAX_NR_CPUS]; -struct stats runtime_dtlb_cache_stats[MAX_NR_CPUS]; -struct stats walltime_nsecs_stats; +static struct stats runtime_nsecs_stats[MAX_NR_CPUS]; +static struct stats runtime_cycles_stats[MAX_NR_CPUS]; +static struct stats runtime_stalled_cycles_front_stats[MAX_NR_CPUS]; +static struct stats runtime_stalled_cycles_back_stats[MAX_NR_CPUS]; +static struct stats runtime_branches_stats[MAX_NR_CPUS]; +static struct stats runtime_cacherefs_stats[MAX_NR_CPUS]; +static struct stats runtime_l1_dcache_stats[MAX_NR_CPUS]; +static struct stats runtime_l1_icache_stats[MAX_NR_CPUS]; +static struct stats runtime_ll_cache_stats[MAX_NR_CPUS]; +static struct stats runtime_itlb_cache_stats[MAX_NR_CPUS]; +static struct stats runtime_dtlb_cache_stats[MAX_NR_CPUS]; +static struct stats walltime_nsecs_stats; static int create_perf_stat_counter(struct perf_evsel *evsel, struct perf_evsel *first) -- 1.7.8.4 ^ permalink raw reply related [flat|nested] 15+ messages in thread
* [tip:perf/core] perf stat: Declare some references static 2012-04-05 16:26 ` [PATCH 3/4] perf tools: Declare some references static in builtin-stat.c Robert Richter @ 2012-04-13 18:22 ` tip-bot for Robert Richter 0 siblings, 0 replies; 15+ messages in thread From: tip-bot for Robert Richter @ 2012-04-13 18:22 UTC (permalink / raw) To: linux-tip-commits; +Cc: acme, linux-kernel, hpa, mingo, robert.richter, tglx Commit-ID: 666e6d48c57921874008d97aac13f6ee3e24fd55 Gitweb: http://git.kernel.org/tip/666e6d48c57921874008d97aac13f6ee3e24fd55 Author: Robert Richter <robert.richter@amd.com> AuthorDate: Thu, 5 Apr 2012 18:26:27 +0200 Committer: Arnaldo Carvalho de Melo <acme@redhat.com> CommitDate: Wed, 11 Apr 2012 17:37:16 -0300 perf stat: Declare some references static This references are not exported, use static declaration. Signed-off-by: Robert Richter <robert.richter@amd.com> Cc: Ingo Molnar <mingo@kernel.org> Link: http://lkml.kernel.org/r/1333643188-26895-4-git-send-email-robert.richter@amd.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-stat.c | 26 +++++++++++++------------- 1 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index c941bb6..dde9e17 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -173,7 +173,7 @@ static struct perf_event_attr very_very_detailed_attrs[] = { -struct perf_evlist *evsel_list; +static struct perf_evlist *evsel_list; static bool system_wide = false; static int run_idx = 0; @@ -265,18 +265,18 @@ static double stddev_stats(struct stats *stats) return sqrt(variance_mean); } -struct stats runtime_nsecs_stats[MAX_NR_CPUS]; -struct stats runtime_cycles_stats[MAX_NR_CPUS]; -struct stats runtime_stalled_cycles_front_stats[MAX_NR_CPUS]; -struct stats runtime_stalled_cycles_back_stats[MAX_NR_CPUS]; -struct stats runtime_branches_stats[MAX_NR_CPUS]; -struct stats runtime_cacherefs_stats[MAX_NR_CPUS]; -struct stats runtime_l1_dcache_stats[MAX_NR_CPUS]; -struct stats runtime_l1_icache_stats[MAX_NR_CPUS]; -struct stats runtime_ll_cache_stats[MAX_NR_CPUS]; -struct stats runtime_itlb_cache_stats[MAX_NR_CPUS]; -struct stats runtime_dtlb_cache_stats[MAX_NR_CPUS]; -struct stats walltime_nsecs_stats; +static struct stats runtime_nsecs_stats[MAX_NR_CPUS]; +static struct stats runtime_cycles_stats[MAX_NR_CPUS]; +static struct stats runtime_stalled_cycles_front_stats[MAX_NR_CPUS]; +static struct stats runtime_stalled_cycles_back_stats[MAX_NR_CPUS]; +static struct stats runtime_branches_stats[MAX_NR_CPUS]; +static struct stats runtime_cacherefs_stats[MAX_NR_CPUS]; +static struct stats runtime_l1_dcache_stats[MAX_NR_CPUS]; +static struct stats runtime_l1_icache_stats[MAX_NR_CPUS]; +static struct stats runtime_ll_cache_stats[MAX_NR_CPUS]; +static struct stats runtime_itlb_cache_stats[MAX_NR_CPUS]; +static struct stats runtime_dtlb_cache_stats[MAX_NR_CPUS]; +static struct stats walltime_nsecs_stats; static int create_perf_stat_counter(struct perf_evsel *evsel, struct perf_evsel *first) ^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 4/4] perf tools: Use sw counter only if hw pmu is not detected 2012-04-05 16:26 [PATCH 0/4] perf tools: Some fixes and updates Robert Richter ` (2 preceding siblings ...) 2012-04-05 16:26 ` [PATCH 3/4] perf tools: Declare some references static in builtin-stat.c Robert Richter @ 2012-04-05 16:26 ` Robert Richter 2012-04-05 16:59 ` David Ahern 2012-04-13 18:23 ` [tip:perf/core] perf record: " tip-bot for Robert Richter 3 siblings, 2 replies; 15+ messages in thread From: Robert Richter @ 2012-04-05 16:26 UTC (permalink / raw) To: Arnaldo Carvalho de Melo; +Cc: Ingo Molnar, LKML, Robert Richter Use cpu-clock-tick sw counter for cpu-cycles only if there is no hw pmu available. This is the case if the syscall reports ENOENT. In other cases (e.g. invalid attributes) we don't want the sw counter to be used. Signed-off-by: Robert Richter <robert.richter@amd.com> --- tools/perf/builtin-record.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index be4e1ee..10b1f1f 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -245,7 +245,7 @@ try_again: * based cpu-clock-tick sw counter, which * is always available even if no PMU support: */ - if (attr->type == PERF_TYPE_HARDWARE + if (err == ENOENT && attr->type == PERF_TYPE_HARDWARE && attr->config == PERF_COUNT_HW_CPU_CYCLES) { if (verbose) -- 1.7.8.4 ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 4/4] perf tools: Use sw counter only if hw pmu is not detected 2012-04-05 16:26 ` [PATCH 4/4] perf tools: Use sw counter only if hw pmu is not detected Robert Richter @ 2012-04-05 16:59 ` David Ahern 2012-04-05 17:18 ` Robert Richter 2012-04-13 18:23 ` [tip:perf/core] perf record: " tip-bot for Robert Richter 1 sibling, 1 reply; 15+ messages in thread From: David Ahern @ 2012-04-05 16:59 UTC (permalink / raw) To: Robert Richter; +Cc: Arnaldo Carvalho de Melo, Ingo Molnar, LKML On 4/5/12 10:26 AM, Robert Richter wrote: > Use cpu-clock-tick sw counter for cpu-cycles only if there is no hw > pmu available. This is the case if the syscall reports ENOENT. In > other cases (e.g. invalid attributes) we don't want the sw counter to > be used. Isn't the invalid attributes case handled by the '} else if (err == EINVAL) {' case before this switch is done? David > > Signed-off-by: Robert Richter<robert.richter@amd.com> > --- > tools/perf/builtin-record.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c > index be4e1ee..10b1f1f 100644 > --- a/tools/perf/builtin-record.c > +++ b/tools/perf/builtin-record.c > @@ -245,7 +245,7 @@ try_again: > * based cpu-clock-tick sw counter, which > * is always available even if no PMU support: > */ > - if (attr->type == PERF_TYPE_HARDWARE > + if (err == ENOENT&& attr->type == PERF_TYPE_HARDWARE > && attr->config == PERF_COUNT_HW_CPU_CYCLES) { > > if (verbose) ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 4/4] perf tools: Use sw counter only if hw pmu is not detected 2012-04-05 16:59 ` David Ahern @ 2012-04-05 17:18 ` Robert Richter 0 siblings, 0 replies; 15+ messages in thread From: Robert Richter @ 2012-04-05 17:18 UTC (permalink / raw) To: David Ahern; +Cc: Arnaldo Carvalho de Melo, Ingo Molnar, LKML On 05.04.12 10:59:04, David Ahern wrote: > On 4/5/12 10:26 AM, Robert Richter wrote: > > Use cpu-clock-tick sw counter for cpu-cycles only if there is no hw > > pmu available. This is the case if the syscall reports ENOENT. In > > other cases (e.g. invalid attributes) we don't want the sw counter to > > be used. > > Isn't the invalid attributes case handled by the > '} else if (err == EINVAL) {' > case before this switch is done? Yes, but it does not jump out the code path. It is only doing some diagnostics and retries the syscall with some modified attributes or so. I had have the case what a syscall failed due to invalid attributes and then the sw counter was setup. I got odd results and I needed some time debugging this to realize what was going on. -Robert -- Advanced Micro Devices, Inc. Operating System Research Center ^ permalink raw reply [flat|nested] 15+ messages in thread
* [tip:perf/core] perf record: Use sw counter only if hw pmu is not detected 2012-04-05 16:26 ` [PATCH 4/4] perf tools: Use sw counter only if hw pmu is not detected Robert Richter 2012-04-05 16:59 ` David Ahern @ 2012-04-13 18:23 ` tip-bot for Robert Richter 1 sibling, 0 replies; 15+ messages in thread From: tip-bot for Robert Richter @ 2012-04-13 18:23 UTC (permalink / raw) To: linux-tip-commits; +Cc: acme, linux-kernel, hpa, mingo, robert.richter, tglx Commit-ID: 5a7ed29c7572d00a75e8c4529e30c5ac2ef82271 Gitweb: http://git.kernel.org/tip/5a7ed29c7572d00a75e8c4529e30c5ac2ef82271 Author: Robert Richter <robert.richter@amd.com> AuthorDate: Thu, 5 Apr 2012 18:26:28 +0200 Committer: Arnaldo Carvalho de Melo <acme@redhat.com> CommitDate: Wed, 11 Apr 2012 17:39:19 -0300 perf record: Use sw counter only if hw pmu is not detected Use cpu-clock-tick sw counter for cpu-cycles only if there is no hw pmu available. This is the case if the syscall reports ENOENT. In other cases (e.g. invalid attributes) we don't want the sw counter to be used. Cc: Ingo Molnar <mingo@kernel.org> Link: http://lkml.kernel.org/r/1333643188-26895-5-git-send-email-robert.richter@amd.com Signed-off-by: Robert Richter <robert.richter@amd.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- tools/perf/builtin-record.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index be4e1ee..10b1f1f 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -245,7 +245,7 @@ try_again: * based cpu-clock-tick sw counter, which * is always available even if no PMU support: */ - if (attr->type == PERF_TYPE_HARDWARE + if (err == ENOENT && attr->type == PERF_TYPE_HARDWARE && attr->config == PERF_COUNT_HW_CPU_CYCLES) { if (verbose) ^ permalink raw reply related [flat|nested] 15+ messages in thread
end of thread, other threads:[~2012-05-11 6:27 UTC | newest] Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2012-04-05 16:26 [PATCH 0/4] perf tools: Some fixes and updates Robert Richter 2012-04-05 16:26 ` [PATCH 1/4] perf tools: Fix include header files in util/parse-events.h Robert Richter 2012-04-24 16:53 ` Robert Richter 2012-04-24 17:35 ` Arnaldo Carvalho de Melo 2012-04-24 17:58 ` Robert Richter 2012-04-25 10:21 ` Arnaldo Carvalho de Melo 2012-05-11 6:27 ` [tip:perf/core] perf tools: Fix include header files in util/ parse-events.h tip-bot for Robert Richter 2012-04-05 16:26 ` [PATCH 2/4] perf tools: Fix thread map that is type pid_t Robert Richter 2012-04-13 18:23 ` [tip:perf/core] " tip-bot for Robert Richter 2012-04-05 16:26 ` [PATCH 3/4] perf tools: Declare some references static in builtin-stat.c Robert Richter 2012-04-13 18:22 ` [tip:perf/core] perf stat: Declare some references static tip-bot for Robert Richter 2012-04-05 16:26 ` [PATCH 4/4] perf tools: Use sw counter only if hw pmu is not detected Robert Richter 2012-04-05 16:59 ` David Ahern 2012-04-05 17:18 ` Robert Richter 2012-04-13 18:23 ` [tip:perf/core] perf record: " tip-bot for Robert Richter
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.