Skip to content

Commit

Permalink
perf_counter: Start documenting HAVE_PERF_COUNTERS requirements
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
vapier authored and Ingo Molnar committed Jun 12, 2009
1 parent 974802e commit 018df72
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,8 @@ config AIO

config HAVE_PERF_COUNTERS
bool
help
See tools/perf/design.txt for details.

menu "Performance Counters"

Expand Down
15 changes: 15 additions & 0 deletions tools/perf/design.txt
Original file line number Diff line number Diff line change
Expand Up @@ -440,3 +440,18 @@ by this process or by another, and doesn't affect any counters that
this process has created on other processes. It only enables or
disables the group leaders, not any other members in the groups.


Arch requirements
-----------------

If your architecture does not have hardware performance metrics, you can
still use the generic software counters based on hrtimers for sampling.

So to start with, in order to add HAVE_PERF_COUNTERS to your Kconfig, you
will need at least this:
- asm/perf_counter.h - a basic stub will suffice at first
- support for atomic64 types (and associated helper functions)
- set_perf_counter_pending() implemented

If your architecture does have hardware capabilities, you can override the
weak stub hw_perf_counter_init() to register hardware counters.

0 comments on commit 018df72

Please sign in to comment.