• Thomas Richter's avatar
    s390/cpum_sf: Fix wrong page count in error message · 60cb7886
    Thomas Richter authored
    [ Upstream commit 4141b6a5 ]
    
    When perf record -e SF_CYCLES_BASIC_DIAG runs with very high
    frequency, the samples arrive faster than the perf process can
    save them to file. Eventually, for longer running processes, this
    leads to the siutation where the trace buffers allocated by perf
    slowly fills up. At one point the auxiliary trace buffer is full
    and  the CPU Measurement sampling facility is turned off. Furthermore
    a warning is printed to the kernel log buffer:
    
    cpum_sf: The AUX buffer with 0 pages for the diagnostic-sampling
    	mode is full
    
    The number of allocated pages for the auxiliary trace buffer is shown
    as zero pages. That is wrong.
    
    Fix this by saving the number of allocated pages before entering the
    work loop in the interrupt handler. When the interrupt handler processes
    the samples, it may detect the buffer full condition and stop sampling,
    reducing the buffer size to zero.
    Print the correct value in the error message:
    
    cpum_sf: The AUX buffer with 256 pages for the diagnostic-sampling
    	mode is full
    Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
    Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
    Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
    60cb7886
perf_cpum_sf.c 58.6 KB