[PATCH 6.6 136/268] perf python: Check if there is space to copy all the event