aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-06-12 13:17:43 -0400
committerIngo Molnar <mingo@elte.hu>2009-06-12 13:37:30 -0400
commit018df72dd01576ab199c6129233cdeaf1409958b (patch)
tree1561017056cc1289e373b094d72ba41a4382308b
parent974802eaa1afdc87e00821df7020a2b3c6fee623 (diff)
perf_counter: Start documenting HAVE_PERF_COUNTERS requirements
Help out arch porters who want to support perf counters by listing some basic requirements. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <1244827063-24046-1-git-send-email-vapier@gentoo.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--init/Kconfig2
-rw-r--r--tools/perf/design.txt15
2 files changed, 17 insertions, 0 deletions
diff --git a/init/Kconfig b/init/Kconfig
index c649657e2259..d3a50967c337 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -936,6 +936,8 @@ config AIO
936 936
937config HAVE_PERF_COUNTERS 937config HAVE_PERF_COUNTERS
938 bool 938 bool
939 help
940 See tools/perf/design.txt for details.
939 941
940menu "Performance Counters" 942menu "Performance Counters"
941 943
diff --git a/tools/perf/design.txt b/tools/perf/design.txt
index 860e116d979c..f71e0d245cba 100644
--- a/tools/perf/design.txt
+++ b/tools/perf/design.txt
@@ -440,3 +440,18 @@ by this process or by another, and doesn't affect any counters that
440this process has created on other processes. It only enables or 440this process has created on other processes. It only enables or
441disables the group leaders, not any other members in the groups. 441disables the group leaders, not any other members in the groups.
442 442
443
444Arch requirements
445-----------------
446
447If your architecture does not have hardware performance metrics, you can
448still use the generic software counters based on hrtimers for sampling.
449
450So to start with, in order to add HAVE_PERF_COUNTERS to your Kconfig, you
451will need at least this:
452 - asm/perf_counter.h - a basic stub will suffice at first
453 - support for atomic64 types (and associated helper functions)
454 - set_perf_counter_pending() implemented
455
456If your architecture does have hardware capabilities, you can override the
457weak stub hw_perf_counter_init() to register hardware counters.