Skip to content

Commit

Permalink
s390/cpum_sf: Dynamically extend the sampling buffer if overflows occur
Browse files Browse the repository at this point in the history
Improve the sampling buffer allocation and add a function to reallocate and
increase the sampling buffer structure.  The number of allocated buffer elements
(sample-data-blocks) are accounted.  You can control the minimum and maximum
number these sample-data-blocks through the cpum_sfb_size kernel parameter.

The number hardware sample overflows (if any) are also accounted and stored
per perf event.  During the PMU disable/enable calls, the accumulated overflow
counter is analyzed and, if necessary, the sampling buffer is dynamically
increased.

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
hbrueckner authored and Martin Schwidefsky committed Dec 16, 2013
1 parent 257608f commit 69f239e
Show file tree
Hide file tree
Showing 2 changed files with 411 additions and 120 deletions.
4 changes: 4 additions & 0 deletions arch/s390/include/asm/perf_event.h
Expand Up @@ -49,6 +49,10 @@ extern unsigned long perf_misc_flags(struct pt_regs *regs);
#define PERF_CPUM_SF_MAX_CTR 1
#define PERF_EVENT_CPUM_SF 0xB0000UL /* Raw event ID */

#define REG_NONE 0
#define REG_OVERFLOW 1
#define OVERFLOW_REG(hwc) ((hwc)->extra_reg.config)
#define SFB_ALLOC_REG(hwc) ((hwc)->extra_reg.alloc)
#define TEAR_REG(hwc) ((hwc)->last_tag)
#define SAMPL_RATE(hwc) ((hwc)->event_base)

Expand Down

0 comments on commit 69f239e

Please sign in to comment.