SNIP On Sun, Nov 12, 2017 at 11:46 PM, Jiri Olsa <jo...@redhat.com> wrote:
> but you closed fd4 before openning fd5..? Yes, that is correct. I closed fd4. The reason is by closing fd4, we are having a total of 3 hardware breakpoints active, but we are making the software counting in the kernel think that four TYPE_DATA breakpoints active. The counting should have disallowed us from creating fd5 as per the following logic in the kernel: static int __reserve_bp_slot(struct perf_event *bp) { .... /* Flexible counters need to keep at least one slot */ if (slots.pinned + (!!slots.flexible) > nr_slots[type]) return -ENOSPC; .... }