Skip to content

Commit 69f239e

Browse files
hbruecknerMartin Schwidefsky
authored andcommitted
s390/cpum_sf: Dynamically extend the sampling buffer if overflows occur
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 <[email protected]> Signed-off-by: Martin Schwidefsky <[email protected]>
1 parent 257608f commit 69f239e

File tree

2 files changed

+411
-120
lines changed

2 files changed

+411
-120
lines changed

arch/s390/include/asm/perf_event.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ extern unsigned long perf_misc_flags(struct pt_regs *regs);
4949
#define PERF_CPUM_SF_MAX_CTR 1
5050
#define PERF_EVENT_CPUM_SF 0xB0000UL /* Raw event ID */
5151

52+
#define REG_NONE 0
53+
#define REG_OVERFLOW 1
54+
#define OVERFLOW_REG(hwc) ((hwc)->extra_reg.config)
55+
#define SFB_ALLOC_REG(hwc) ((hwc)->extra_reg.alloc)
5256
#define TEAR_REG(hwc) ((hwc)->last_tag)
5357
#define SAMPL_RATE(hwc) ((hwc)->event_base)
5458

0 commit comments

Comments
 (0)