陳韋任你好, On 03/14/2011 02:20 AM, 陳韋任 wrote: > Hi, > >> evt2raw is a simple tool to convert from an event string to a code that can >> be >> passed directly to perf: >> >> $ perf stat -e `evt2raw inst_retired:any_p` /bin/ls > > I am a little confuse here. First, are there examples show what event > strings can be > given to `evt2raw`? I tried your example on a x86-64 machine (Linux/SPARC has > problem > with building perf). > > $ ./evt2raw inst_retired:any_p > r5300c0 > > It gave me a code. Can I map the code back to a symbolic name which > `perf list` give to me? > > Second, `perf list` shows events which can be used in -e. What's the > difference between `perf list` outputs and `evt2raw` inputs? >
evt2raw will allow you to use "perf stat" and "perf record" with hardware-specific events that are not available via perf's standard set of "generic hardware events". In other words, it is intended that libpfm4 support every possible event that the underlying PMU hardware and kernel can support. "perf list" only gives a small subset of events that are supposed to be available across many different hardware architectures and chip implementations of those architectures. If you want to use events that are supported on the certain chips, but are not in the list given by "perf list", you must use a raw event code, by specifying an 'r' followed by the event's hex code. Some of those raw event codes are going to be the same as the events used internally by the kernel for the "generic hardware events", but the only way to find out which specific hardware events are used for which "generic hardware events", you'd have to read the kernel code. There is no translation available in user space, via perf or any other tool. When perf was designed, it was believed that most users do not need this mapping information, so there is no API provided to obtain it. Does this help? - Corey ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ perfmon2-devel mailing list perfmon2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/perfmon2-devel