Menu

#282 ophelp: enable display of hex event codes

open
nobody
None
5
2016-02-05
2016-02-05
No

"raw" event codes (to perf, for example) are usually expressed and used in hexidecimal.
ophelp displays event codes in decimal:
$ ophelp PM_L1MISS_LAT_EXC_32
537002470

It is, of course, easy enough to convert the values to hex, even in a single line:
$ echo "obase=16; $(ophelp PM_L1MISS_LAT_EXC_32)" | bc
200201E6

But this obviously requires a lot more typing and more typing means more chances for error.

I propose adding a "--hex" flag to ophelp to display the event codes directly in hex:
$ ophelp --hex PM_L1MISS_LAT_EXC
200201E6

An alternative which would be more general, but may be overkill, is a "--base <n>" flag to display the codes in any base, like octal:
$ ophelp --base=16 PM_L1MISS_LAT_EXC
200201E6
$ ophelp --base=8 PM_L1MISS_LAT_EXC
4000400746

Discussion


Log in to post a comment.