6 perf-c2c - Shared Data C2C/HITM Analyzer.
11 'perf c2c record' [<options>] <command>
12 'perf c2c record' [<options>] -- [<record command options>] <command>
13 'perf c2c report' [<options>]
17 C2C stands for Cache To Cache.
19 The perf c2c tool provides means for Shared Data C2C/HITM analysis. It allows
20 you to track down the cacheline contentions.
22 On x86, the tool is based on load latency and precise store facility events
23 provided by Intel CPUs. On PowerPC, the tool uses random instruction sampling
24 with thresholding feature.
27 - memory address of the access
28 - type of the access (load and store details)
29 - latency (in cycles) of the load access
31 The c2c tool provide means to record this data and report back access details
32 for cachelines with highest contention - highest number of HITM accesses.
34 The basic workflow with this tool follows the standard record/report phase.
35 User uses the record command to record events data and report command to
43 Select the PMU event. Use 'perf c2c record -e list'
44 to list available events.
48 Be more verbose (show counter open errors, etc).
52 Configure mem-loads latency. (x86 only)
56 Configure all used events to run in kernel space.
60 Configure all used events to run in user space.
70 Be more verbose (show counter open errors, etc).
74 Specify the input file to process.
78 Show extra node info in report (see NODE INFO section)
82 Specify sorting fields for single cacheline display.
83 Following fields are available: tid,pid,iaddr,dso
88 Setup callchains parameters.
89 Please refer to perf-report man page for details.
92 Force the stdio output (see STDIO OUTPUT)
95 Display only statistic tables and force stdio mode.
98 Display full length of symbols.
101 Do not display Source:Line column.
104 Show all captured HITM lines, with no regard to HITM % 0.0005 limit.
108 Don't do ownership validation.
112 Switch to HITM type (rmt, lcl) to display and sort on. Total HITMs as default.
115 Show callgraph with stitched LBRs, which may have more complete
116 callgraph. The perf.data file must have been obtained using
117 perf c2c record --call-graph lbr.
118 Disabled by default. In common cases with call stack overflows,
119 it can recreate better call stacks than the default lbr call stack
120 output. But this approach is not full proof. There can be cases
121 where it creates incorrect call stacks from incorrect matches.
122 The known limitations include exception handing such as
123 setjmp/longjmp will have calls/returns not match.
127 The perf c2c record command setup options related to HITM cacheline analysis
128 and calls standard perf record command.
130 Following perf record options are configured by default:
131 (check perf record man page for details)
133 -W,-d,--phys-data,--sample-cpu
135 Unless specified otherwise with '-e' option, following events are monitored by
138 cpu/mem-loads,ldlat=30/P
141 and following on PowerPC:
146 User can pass any 'perf record' option behind '--' mark, like (to enable
147 callchains and system wide monitoring):
149 $ perf c2c record -- -g -a
151 Please check RECORD OPTIONS section for specific c2c record options.
155 The perf c2c report command displays shared data analysis. It comes in two
156 display modes: stdio and tui (default).
158 The report command workflow is following:
159 - sort all the data based on the cacheline address
160 - store access details for each cacheline
161 - sort all cachelines based on user settings
164 In general perf report output consist of 2 basic views:
165 1) most expensive cachelines list
166 2) offsets details for each cacheline
168 For each cacheline in the 1) list we display following data:
169 (Both stdio and TUI modes follow the same fields output)
172 - zero based index to identify the cacheline
175 - cacheline address (hex number)
178 - sum of all cachelines accesses
181 - cacheline percentage of all Remote/Local HITM accesses
183 LLC Load Hitm - Total, Lcl, Rmt
184 - count of Total/Local/Remote load HITMs
186 Store Reference - Total, L1Hit, L1Miss
187 Total - all store accesses
188 L1Hit - store accesses that hit L1
189 L1Hit - store accesses that missed L1
192 - count of local and remote DRAM accesses
195 - count of all accesses that missed LLC
198 - sum of all load accesses
200 Core Load Hit - FB, L1, L2
201 - count of load hits in FB (Fill Buffer), L1 and L2 cache
203 LLC Load Hit - Llc, Rmt
204 - count of LLC and Remote load hits
206 For each offset in the 2) list we display following data:
209 - % of Remote/Local HITM accesses for given offset within cacheline
211 Store Refs - L1 Hit, L1 Miss
212 - % of store accesses that hit/missed L1 for given offset within cacheline
214 Data address - Offset
218 - pid of the process responsible for the accesses
221 - tid of the process responsible for the accesses
224 - code address responsible for the accesses
226 cycles - rmt hitm, lcl hitm, load
227 - sum of cycles for given accesses - Remote/Local HITM and generic load
230 - number of cpus that participated on the access
233 - code symbol related to the 'Code address' value
236 - shared object name related to the 'Code address' value
239 - source information related to the 'Code address' value
242 - nodes participating on the access (see NODE INFO section)
246 The 'Node' field displays nodes that accesses given cacheline
247 offset. Its output comes in 3 flavors:
248 - node IDs separated by ','
249 - node IDs with stats for each ID, in following format:
250 Node{cpus %hitms %stores}
251 - node IDs with list of affected CPUs in following format:
254 User can switch between above flavors with -N option or
255 use 'n' key to interactively switch in TUI mode.
259 User can specify how to sort offsets for cacheline.
261 Following fields are available and governs the final
262 output fields set for caheline offsets output:
264 tid - coalesced by process TIDs
265 pid - coalesced by process PIDs
266 iaddr - coalesced by code address, following fields are displayed:
267 Code address, Code symbol, Shared Object, Source line
268 dso - coalesced by shared object
270 By default the coalescing is setup with 'pid,iaddr'.
274 The stdio output displays data on standard output.
276 Following tables are displayed:
277 Trace Event Information
278 - overall statistics of memory accesses
280 Global Shared Cache Line Event Information
281 - overall statistics on shared cachelines
283 Shared Data Cache Line Table
284 - list of most expensive cachelines
286 Shared Cache Line Distribution Pareto
287 - list of all accessed offsets for each cacheline
291 The TUI output provides interactive interface to navigate
292 through cachelines list and to display offset details.
294 For details please refer to the help window by pressing '?' key.
298 Although Don Zickus, Dick Fowles and Joe Mario worked together
299 to get this implemented, we got lots of early help from Arnaldo
300 Carvalho de Melo, Stephane Eranian, Jiri Olsa and Andi Kleen.
304 Check Joe's blog on c2c tool for detailed use case explanation:
305 https://joemario.github.io/blog/2016/09/01/c2c-blog/
309 linkperf:perf-record[1], linkperf:perf-mem[1]