A quick Komlog example for monitoring Instructions per cycle metric, obtained with the perf stat command. Create a transfers block in your komlogd configuration pointing to perf_stat.py file and run komlogd.
This example will create two transfer methods, the first one will execute the perf stat command periodically and store the output to uri tmp.commands.perf. The second one will calculate %CPU from ipc variable.
You can read a related blog post (in spanish) here