How to set up and read performance counters

I’m following this guide: https://developer.arm.com/products/software-development-tools/ds-5-development-studio/resources/tutorials/using-the-pmu-event-counters-in-ds-5 for a general example of how to configure the performance counters and am struggling with my knowledge of assembly and the process in general. The end goal is to be able to manually configure and query to counters.

On one of the very first steps I get an

illegal instruction

error. This is my code which is attempting to disable the counters to check if I’m writing the register properly.

asm volatile ("MSR PMCR_EL0, %0\n"::"r" (value));

When I attempt to read modify write the PMCR_EL0 register with the similar method there are no errors but reading the value back out shows no change.

asm volatile ("MRS %0,PMCR_EL0\n":"=r" (value));
value = value | 4;
asm volatile ("MSR PMCR_EL0, %0\n"::"r" (value));
asm volatile ("MRS %0,PMCR_EL0\n":"=r" (value));

Any help would be appreciated. If the guide’s method I posted differs greatly for the A57 some guidance would be welcome as the reference manual seems to be vague on setting up events for the six counters. Here is my reference : http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0438g/BIIDBAFB.html