I would like too use PCM as Perf for HW Performance Counters.
for example: I would like to write a PCM script counting:
Is that possible. Any script will be very helpful. Thanks
Sure you can use PCM to program these events. But if you want events other than the pre-programmed events then it is a non-trivial amount of work for you. You have to figure out what the proper event encoding is for your cpu and then figure out where in PCM you need to change the programming. PCM doesn't do event multiplexing so if you want more events than there are counters you will have to collect the events in stages. In short, yes what you ask can be done but I don't have time to write code for you. I would recommend looking at linux perf or Intel VTune which is more setup for general "tell me all the events available and then program them correctly for me" type work.