Programmatically Get Pipeline Statistics

As part of my automated testing on real devices I would like to get the pipeline statistics from my compute kernels (ALU, Memory, Control Flow, Occupancy, etc). I'm able to generate a GPU trace in code without issue but that requires manually opening up the trace to find the values I'm interested in. What I would like is an API to read that trace or some counter set which provides the statistics I'm interested in. Is this possible?