If changing the source code for ocount isn't an option, you can always modify the output afterwards.
Try piping the output through this perl one liner:
ocount --events=rtm_retired:commit,rtm_retired:start,rtm_retired:aborted programA | \
perl -n -e ' @suffix = ("commit", "start", "aborted"); if ( m/rtm_retired/ ) { $count++; s/rtm_retired/rtm_retired:$suffix[$count-1]/; } print $_;'
This should work as long as you make sure to keep track of the order of counters you pass to ocount
and match the @suffix
array to it.