• Thomas Richter's avatar
    s390/cpum_sf: Support ioctl PERF_EVENT_IOC_PERIOD · 2cb549a8
    Thomas Richter authored
    A perf_event can be set up to deliver overflow notifications
    via SIGIO signal.  The setup of the event is:
    
     1. create event with perf_event_open()
     2. assign it a signal for I/O notification with fcntl()
     3. Install signal handler and consume samples
    
    The initial setup of perf_event_open() determines the
    period/frequency time span needed to elapse before each signal
    is delivered to the user process.
    
    While the event is active, system call
    ioctl(.., PERF_EVENT_IOC_PERIOD, value) can be used the change
    the frequency/period time span of the active event.
    The remaining signal handler invocations honour the new value.
    
    This does not work on s390. In fact the time span does not change
    regardless of ioctl's third argument 'value'. The call succeeds
    but the time span does not change.
    
    Support this behavior and make it common with other platforms.
    This is achieved by changing the interval value of the sampling
    control block accordingly and feed this new value every time
    the event is enabled using pmu_event_enable().
    
    Before this change the interval value was set only once at
    pmu_event_add() and never changed.
    Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
    Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
    2cb549a8
perf_event.h 2.9 KB