selftests/powerpc: Move perror closer to its use
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Tue, 22 Nov 2022 06:40:52 +0000 (12:10 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 30 Nov 2022 10:46:47 +0000 (21:46 +1100)
commit71ae6305ad41cfd1ac5aa91d356e71c7a537df2e
tree707c5cbf87e5cb47876fc4d5c0a5db86951b110c
parentdea681c91d3cd5326f87d0a3c93079573e22ce9a
selftests/powerpc: Move perror closer to its use

Right now, if perf_event_open() fails for the systemwide tests, error
report is printed too late, sometimes after subsequent system calls.
Move use of perror() to the main function, just after the syscall.

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/372ac78c27899f1f612fbd6ac796604a4a9310aa.1669096083.git.naveen.n.rao@linux.vnet.ibm.com
tools/testing/selftests/powerpc/ptrace/perf-hwbreak.c