1 2 The contents of this directory allow users to 3 CPUs by their symbolic names rather than raw e 4 5 The main program in this directory, is the 'je 6 executed _BEFORE_ the perf binary itself is bu 7 8 The 'jevents' program tries to locate and proc 9 tree tools/perf/pmu-events/arch/foo. 10 11 - Regular files with '.json' extension 12 JSON files, each of which describes 13 14 - The CSV file that maps a specific CP 15 be named 'mapfile.csv' (see below fo 16 17 - Directories are traversed, but all o 18 19 - To reduce JSON event duplication per 20 use "ArchStdEvent" keyword to derefe 21 events", defined in architecture sta 22 Architecture standard JSONs must be 23 folder. Matching is based on the "Ev 24 25 The PMU events supported by a CPU model are ex 26 such as Pipelining, Cache, Memory, Floating-po 27 should be placed in a separate JSON file - whe 28 the topic. Eg: "Floating-point.json". 29 30 All the topic JSON files for a CPU model/famil 31 sub directory. Thus for the Silvermont X86 CPU 32 33 $ ls tools/perf/pmu-events/arch/x86/si 34 cache.json memory.json virtual- 35 frontend.json pipeline.json 36 37 The JSONs folder for a CPU model/family may be 38 folder, or may be placed in a vendor sub-folde 39 for instances where the arch and vendor are no 40 41 Using the JSON files and the mapfile, 'jevents 42 'pmu-events.c', which encodes the two sets of 43 44 - Set of 'PMU events tables' for all k 45 (one table like the following, per J 46 is derived from JSON file name, 'pow 47 48 struct pmu_event pme_power8[] 49 50 ... 51 52 { 53 .name = "pm_1p 54 .event = "even 55 .desc = "1 or 56 }, 57 58 ... 59 } 60 61 - A 'mapping table' that maps each CPU 62 'PMU events table' 63 64 struct pmu_events_map pmu_even 65 { 66 .cpuid = "004b0000", 67 .version = "1", 68 .type = "core", 69 .table = pme_power8 70 }, 71 ... 72 73 }; 74 75 After the 'pmu-events.c' is generated, it is c 76 'pmu-events.o' is added to 'libperf.a' which i 77 78 NOTES: 79 1. Several CPUs can support same set o 80 JSON file. Hence several entries in 81 to a single 'PMU events table'. 82 83 2. The 'pmu-events.h' has an extern de 84 and the generated 'pmu-events.c' de 85 86 3. _All_ known CPU tables for architec 87 binary. 88 89 At run time, perf determines the actual CPU it 90 matching events table and builds aliases for t 91 users to specify events by their name: 92 93 $ perf stat -e pm_1plus_ppc_cmpl sleep 94 95 where 'pm_1plus_ppc_cmpl' is a Power8 PMU even 96 97 However some errors in processing may cause th 98 99 Mapfile format 100 =============== 101 102 The mapfile enables multiple CPU models to sha 103 It is required even if such mapping is 1:1. 104 105 The mapfile.csv format is expected to be: 106 107 Header line 108 CPUID,Version,Dir/path/name,Type 109 110 where: 111 112 Comma: 113 is the required field delimite 114 have commas within them). 115 116 Comments: 117 Lines in which the first chara 118 are ignored. 119 120 Header line 121 The header line is the first l 122 always _IGNORED_. It can be em 123 124 CPUID: 125 CPUID is an arch-specific char 126 to identify CPU (and associate 127 it supports). Multiple CPUIDS 128 File/path/name.json. 129 130 Example: 131 CPUID == 'GenuineIntel 132 CPUID == '004b0100' (P 133 Version: 134 is the Version of the mapfile. 135 136 Dir/path/name: 137 is the pathname to the directo 138 files, relative to the directo 139 140 Type: 141 indicates whether the events a 142 143 144 Eg: 145 146 $ grep silvermont tools/perf/pmu-event 147 GenuineIntel-6-37,v13,silvermont,core 148 GenuineIntel-6-4D,v13,silvermont,core 149 GenuineIntel-6-4C,v13,silvermont,core 150 151 i.e the three CPU models use the JSON 152 in the directory 'tools/perf/pmu-event
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.