1*4882a593Smuzhiyunperf-config(1) 2*4882a593Smuzhiyun============== 3*4882a593Smuzhiyun 4*4882a593SmuzhiyunNAME 5*4882a593Smuzhiyun---- 6*4882a593Smuzhiyunperf-config - Get and set variables in a configuration file. 7*4882a593Smuzhiyun 8*4882a593SmuzhiyunSYNOPSIS 9*4882a593Smuzhiyun-------- 10*4882a593Smuzhiyun[verse] 11*4882a593Smuzhiyun'perf config' [<file-option>] [section.name[=value] ...] 12*4882a593Smuzhiyunor 13*4882a593Smuzhiyun'perf config' [<file-option>] -l | --list 14*4882a593Smuzhiyun 15*4882a593SmuzhiyunDESCRIPTION 16*4882a593Smuzhiyun----------- 17*4882a593SmuzhiyunYou can manage variables in a configuration file with this command. 18*4882a593Smuzhiyun 19*4882a593SmuzhiyunOPTIONS 20*4882a593Smuzhiyun------- 21*4882a593Smuzhiyun 22*4882a593Smuzhiyun-l:: 23*4882a593Smuzhiyun--list:: 24*4882a593Smuzhiyun Show current config variables, name and value, for all sections. 25*4882a593Smuzhiyun 26*4882a593Smuzhiyun--user:: 27*4882a593Smuzhiyun For writing and reading options: write to user 28*4882a593Smuzhiyun '$HOME/.perfconfig' file or read it. 29*4882a593Smuzhiyun 30*4882a593Smuzhiyun--system:: 31*4882a593Smuzhiyun For writing and reading options: write to system-wide 32*4882a593Smuzhiyun '$(sysconfdir)/perfconfig' or read it. 33*4882a593Smuzhiyun 34*4882a593SmuzhiyunCONFIGURATION FILE 35*4882a593Smuzhiyun------------------ 36*4882a593Smuzhiyun 37*4882a593SmuzhiyunThe perf configuration file contains many variables to change various 38*4882a593Smuzhiyunaspects of each of its tools, including output, disk usage, etc. 39*4882a593SmuzhiyunThe '$HOME/.perfconfig' file is used to store a per-user configuration. 40*4882a593SmuzhiyunThe file '$(sysconfdir)/perfconfig' can be used to 41*4882a593Smuzhiyunstore a system-wide default configuration. 42*4882a593Smuzhiyun 43*4882a593SmuzhiyunOne an disable reading config files by setting the PERF_CONFIG environment 44*4882a593Smuzhiyunvariable to /dev/null, or provide an alternate config file by setting that 45*4882a593Smuzhiyunvariable. 46*4882a593Smuzhiyun 47*4882a593SmuzhiyunWhen reading or writing, the values are read from the system and user 48*4882a593Smuzhiyunconfiguration files by default, and options '--system' and '--user' 49*4882a593Smuzhiyuncan be used to tell the command to read from or write to only that location. 50*4882a593Smuzhiyun 51*4882a593SmuzhiyunSyntax 52*4882a593Smuzhiyun~~~~~~ 53*4882a593Smuzhiyun 54*4882a593SmuzhiyunThe file consist of sections. A section starts with its name 55*4882a593Smuzhiyunsurrounded by square brackets and continues till the next section 56*4882a593Smuzhiyunbegins. Each variable must be in a section, and have the form 57*4882a593Smuzhiyun'name = value', for example: 58*4882a593Smuzhiyun 59*4882a593Smuzhiyun [section] 60*4882a593Smuzhiyun name1 = value1 61*4882a593Smuzhiyun name2 = value2 62*4882a593Smuzhiyun 63*4882a593SmuzhiyunSection names are case sensitive and can contain any characters except 64*4882a593Smuzhiyunnewline (double quote `"` and backslash have to be escaped as `\"` and `\\`, 65*4882a593Smuzhiyunrespectively). Section headers can't span multiple lines. 66*4882a593Smuzhiyun 67*4882a593SmuzhiyunExample 68*4882a593Smuzhiyun~~~~~~~ 69*4882a593Smuzhiyun 70*4882a593SmuzhiyunGiven a $HOME/.perfconfig like this: 71*4882a593Smuzhiyun 72*4882a593Smuzhiyun# 73*4882a593Smuzhiyun# This is the config file, and 74*4882a593Smuzhiyun# a '#' and ';' character indicates a comment 75*4882a593Smuzhiyun# 76*4882a593Smuzhiyun 77*4882a593Smuzhiyun [colors] 78*4882a593Smuzhiyun # Color variables 79*4882a593Smuzhiyun top = red, default 80*4882a593Smuzhiyun medium = green, default 81*4882a593Smuzhiyun normal = lightgray, default 82*4882a593Smuzhiyun selected = white, lightgray 83*4882a593Smuzhiyun jump_arrows = blue, default 84*4882a593Smuzhiyun addr = magenta, default 85*4882a593Smuzhiyun root = white, blue 86*4882a593Smuzhiyun 87*4882a593Smuzhiyun [tui] 88*4882a593Smuzhiyun # Defaults if linked with libslang 89*4882a593Smuzhiyun report = on 90*4882a593Smuzhiyun annotate = on 91*4882a593Smuzhiyun top = on 92*4882a593Smuzhiyun 93*4882a593Smuzhiyun [buildid] 94*4882a593Smuzhiyun # Default, disable using /dev/null 95*4882a593Smuzhiyun dir = ~/.debug 96*4882a593Smuzhiyun 97*4882a593Smuzhiyun [annotate] 98*4882a593Smuzhiyun # Defaults 99*4882a593Smuzhiyun hide_src_code = false 100*4882a593Smuzhiyun use_offset = true 101*4882a593Smuzhiyun jump_arrows = true 102*4882a593Smuzhiyun show_nr_jumps = false 103*4882a593Smuzhiyun 104*4882a593Smuzhiyun [help] 105*4882a593Smuzhiyun # Format can be man, info, web or html 106*4882a593Smuzhiyun format = man 107*4882a593Smuzhiyun autocorrect = 0 108*4882a593Smuzhiyun 109*4882a593Smuzhiyun [ui] 110*4882a593Smuzhiyun show-headers = true 111*4882a593Smuzhiyun 112*4882a593Smuzhiyun [call-graph] 113*4882a593Smuzhiyun # fp (framepointer), dwarf 114*4882a593Smuzhiyun record-mode = fp 115*4882a593Smuzhiyun print-type = graph 116*4882a593Smuzhiyun order = caller 117*4882a593Smuzhiyun sort-key = function 118*4882a593Smuzhiyun 119*4882a593Smuzhiyun [report] 120*4882a593Smuzhiyun # Defaults 121*4882a593Smuzhiyun sort_order = comm,dso,symbol 122*4882a593Smuzhiyun percent-limit = 0 123*4882a593Smuzhiyun queue-size = 0 124*4882a593Smuzhiyun children = true 125*4882a593Smuzhiyun group = true 126*4882a593Smuzhiyun 127*4882a593Smuzhiyun [llvm] 128*4882a593Smuzhiyun dump-obj = true 129*4882a593Smuzhiyun clang-opt = -g 130*4882a593Smuzhiyun 131*4882a593SmuzhiyunYou can hide source code of annotate feature setting the config to false with 132*4882a593Smuzhiyun 133*4882a593Smuzhiyun % perf config annotate.hide_src_code=true 134*4882a593Smuzhiyun 135*4882a593SmuzhiyunIf you want to add or modify several config items, you can do like 136*4882a593Smuzhiyun 137*4882a593Smuzhiyun % perf config ui.show-headers=false kmem.default=slab 138*4882a593Smuzhiyun 139*4882a593SmuzhiyunTo modify the sort order of report functionality in user config file(i.e. `~/.perfconfig`), do 140*4882a593Smuzhiyun 141*4882a593Smuzhiyun % perf config --user report sort-order=srcline 142*4882a593Smuzhiyun 143*4882a593SmuzhiyunTo change colors of selected line to other foreground and background colors 144*4882a593Smuzhiyunin system config file (i.e. `$(sysconf)/perfconfig`), do 145*4882a593Smuzhiyun 146*4882a593Smuzhiyun % perf config --system colors.selected=yellow,green 147*4882a593Smuzhiyun 148*4882a593SmuzhiyunTo query the record mode of call graph, do 149*4882a593Smuzhiyun 150*4882a593Smuzhiyun % perf config call-graph.record-mode 151*4882a593Smuzhiyun 152*4882a593SmuzhiyunIf you want to know multiple config key/value pairs, you can do like 153*4882a593Smuzhiyun 154*4882a593Smuzhiyun % perf config report.queue-size call-graph.order report.children 155*4882a593Smuzhiyun 156*4882a593SmuzhiyunTo query the config value of sort order of call graph in user config file (i.e. `~/.perfconfig`), do 157*4882a593Smuzhiyun 158*4882a593Smuzhiyun % perf config --user call-graph.sort-order 159*4882a593Smuzhiyun 160*4882a593SmuzhiyunTo query the config value of buildid directory in system config file (i.e. `$(sysconf)/perfconfig`), do 161*4882a593Smuzhiyun 162*4882a593Smuzhiyun % perf config --system buildid.dir 163*4882a593Smuzhiyun 164*4882a593SmuzhiyunVariables 165*4882a593Smuzhiyun~~~~~~~~~ 166*4882a593Smuzhiyun 167*4882a593Smuzhiyuncolors.*:: 168*4882a593Smuzhiyun The variables for customizing the colors used in the output for the 169*4882a593Smuzhiyun 'report', 'top' and 'annotate' in the TUI. They should specify the 170*4882a593Smuzhiyun foreground and background colors, separated by a comma, for example: 171*4882a593Smuzhiyun 172*4882a593Smuzhiyun medium = green, lightgray 173*4882a593Smuzhiyun 174*4882a593Smuzhiyun If you want to use the color configured for you terminal, just leave it 175*4882a593Smuzhiyun as 'default', for example: 176*4882a593Smuzhiyun 177*4882a593Smuzhiyun medium = default, lightgray 178*4882a593Smuzhiyun 179*4882a593Smuzhiyun Available colors: 180*4882a593Smuzhiyun red, yellow, green, cyan, gray, black, blue, 181*4882a593Smuzhiyun white, default, magenta, lightgray 182*4882a593Smuzhiyun 183*4882a593Smuzhiyun colors.top:: 184*4882a593Smuzhiyun 'top' means a overhead percentage which is more than 5%. 185*4882a593Smuzhiyun And values of this variable specify percentage colors. 186*4882a593Smuzhiyun Basic key values are foreground-color 'red' and 187*4882a593Smuzhiyun background-color 'default'. 188*4882a593Smuzhiyun colors.medium:: 189*4882a593Smuzhiyun 'medium' means a overhead percentage which has more than 0.5%. 190*4882a593Smuzhiyun Default values are 'green' and 'default'. 191*4882a593Smuzhiyun colors.normal:: 192*4882a593Smuzhiyun 'normal' means the rest of overhead percentages 193*4882a593Smuzhiyun except 'top', 'medium', 'selected'. 194*4882a593Smuzhiyun Default values are 'lightgray' and 'default'. 195*4882a593Smuzhiyun colors.selected:: 196*4882a593Smuzhiyun This selects the colors for the current entry in a list of entries 197*4882a593Smuzhiyun from sub-commands (top, report, annotate). 198*4882a593Smuzhiyun Default values are 'black' and 'lightgray'. 199*4882a593Smuzhiyun colors.jump_arrows:: 200*4882a593Smuzhiyun Colors for jump arrows on assembly code listings 201*4882a593Smuzhiyun such as 'jns', 'jmp', 'jane', etc. 202*4882a593Smuzhiyun Default values are 'blue', 'default'. 203*4882a593Smuzhiyun colors.addr:: 204*4882a593Smuzhiyun This selects colors for addresses from 'annotate'. 205*4882a593Smuzhiyun Default values are 'magenta', 'default'. 206*4882a593Smuzhiyun colors.root:: 207*4882a593Smuzhiyun Colors for headers in the output of a sub-commands (top, report). 208*4882a593Smuzhiyun Default values are 'white', 'blue'. 209*4882a593Smuzhiyun 210*4882a593Smuzhiyuncore.*:: 211*4882a593Smuzhiyun core.proc-map-timeout:: 212*4882a593Smuzhiyun Sets a timeout (in milliseconds) for parsing /proc/<pid>/maps files. 213*4882a593Smuzhiyun Can be overridden by the --proc-map-timeout option on supported 214*4882a593Smuzhiyun subcommands. The default timeout is 500ms. 215*4882a593Smuzhiyun 216*4882a593Smuzhiyuntui.*, gtk.*:: 217*4882a593Smuzhiyun Subcommands that can be configured here are 'top', 'report' and 'annotate'. 218*4882a593Smuzhiyun These values are booleans, for example: 219*4882a593Smuzhiyun 220*4882a593Smuzhiyun [tui] 221*4882a593Smuzhiyun top = true 222*4882a593Smuzhiyun 223*4882a593Smuzhiyun will make the TUI be the default for the 'top' subcommand. Those will be 224*4882a593Smuzhiyun available if the required libs were detected at tool build time. 225*4882a593Smuzhiyun 226*4882a593Smuzhiyunbuildid.*:: 227*4882a593Smuzhiyun buildid.dir:: 228*4882a593Smuzhiyun Each executable and shared library in modern distributions comes with a 229*4882a593Smuzhiyun content based identifier that, if available, will be inserted in a 230*4882a593Smuzhiyun 'perf.data' file header to, at analysis time find what is needed to do 231*4882a593Smuzhiyun symbol resolution, code annotation, etc. 232*4882a593Smuzhiyun 233*4882a593Smuzhiyun The recording tools also stores a hard link or copy in a per-user 234*4882a593Smuzhiyun directory, $HOME/.debug/, of binaries, shared libraries, /proc/kallsyms 235*4882a593Smuzhiyun and /proc/kcore files to be used at analysis time. 236*4882a593Smuzhiyun 237*4882a593Smuzhiyun The buildid.dir variable can be used to either change this directory 238*4882a593Smuzhiyun cache location, or to disable it altogether. If you want to disable it, 239*4882a593Smuzhiyun set buildid.dir to /dev/null. The default is $HOME/.debug 240*4882a593Smuzhiyun 241*4882a593Smuzhiyunannotate.*:: 242*4882a593Smuzhiyun These are in control of addresses, jump function, source code 243*4882a593Smuzhiyun in lines of assembly code from a specific program. 244*4882a593Smuzhiyun 245*4882a593Smuzhiyun annotate.disassembler_style: 246*4882a593Smuzhiyun Use this to change the default disassembler style to some other value 247*4882a593Smuzhiyun supported by binutils, such as "intel", see the '-M' option help in the 248*4882a593Smuzhiyun 'objdump' man page. 249*4882a593Smuzhiyun 250*4882a593Smuzhiyun annotate.hide_src_code:: 251*4882a593Smuzhiyun If a program which is analyzed has source code, 252*4882a593Smuzhiyun this option lets 'annotate' print a list of assembly code with the source code. 253*4882a593Smuzhiyun For example, let's see a part of a program. There're four lines. 254*4882a593Smuzhiyun If this option is 'true', they can be printed 255*4882a593Smuzhiyun without source code from a program as below. 256*4882a593Smuzhiyun 257*4882a593Smuzhiyun │ push %rbp 258*4882a593Smuzhiyun │ mov %rsp,%rbp 259*4882a593Smuzhiyun │ sub $0x10,%rsp 260*4882a593Smuzhiyun │ mov (%rdi),%rdx 261*4882a593Smuzhiyun 262*4882a593Smuzhiyun But if this option is 'false', source code of the part 263*4882a593Smuzhiyun can be also printed as below. Default is 'false'. 264*4882a593Smuzhiyun 265*4882a593Smuzhiyun │ struct rb_node *rb_next(const struct rb_node *node) 266*4882a593Smuzhiyun │ { 267*4882a593Smuzhiyun │ push %rbp 268*4882a593Smuzhiyun │ mov %rsp,%rbp 269*4882a593Smuzhiyun │ sub $0x10,%rsp 270*4882a593Smuzhiyun │ struct rb_node *parent; 271*4882a593Smuzhiyun │ 272*4882a593Smuzhiyun │ if (RB_EMPTY_NODE(node)) 273*4882a593Smuzhiyun │ mov (%rdi),%rdx 274*4882a593Smuzhiyun │ return n; 275*4882a593Smuzhiyun 276*4882a593Smuzhiyun This option works with tui, stdio2 browsers. 277*4882a593Smuzhiyun 278*4882a593Smuzhiyun annotate.use_offset:: 279*4882a593Smuzhiyun Basing on a first address of a loaded function, offset can be used. 280*4882a593Smuzhiyun Instead of using original addresses of assembly code, 281*4882a593Smuzhiyun addresses subtracted from a base address can be printed. 282*4882a593Smuzhiyun Let's illustrate an example. 283*4882a593Smuzhiyun If a base address is 0XFFFFFFFF81624d50 as below, 284*4882a593Smuzhiyun 285*4882a593Smuzhiyun ffffffff81624d50 <load0> 286*4882a593Smuzhiyun 287*4882a593Smuzhiyun an address on assembly code has a specific absolute address as below 288*4882a593Smuzhiyun 289*4882a593Smuzhiyun ffffffff816250b8:│ mov 0x8(%r14),%rdi 290*4882a593Smuzhiyun 291*4882a593Smuzhiyun but if use_offset is 'true', an address subtracted from a base address is printed. 292*4882a593Smuzhiyun Default is true. This option is only applied to TUI. 293*4882a593Smuzhiyun 294*4882a593Smuzhiyun 368:│ mov 0x8(%r14),%rdi 295*4882a593Smuzhiyun 296*4882a593Smuzhiyun This option works with tui, stdio2 browsers. 297*4882a593Smuzhiyun 298*4882a593Smuzhiyun annotate.jump_arrows:: 299*4882a593Smuzhiyun There can be jump instruction among assembly code. 300*4882a593Smuzhiyun Depending on a boolean value of jump_arrows, 301*4882a593Smuzhiyun arrows can be printed or not which represent 302*4882a593Smuzhiyun where do the instruction jump into as below. 303*4882a593Smuzhiyun 304*4882a593Smuzhiyun │ ┌──jmp 1333 305*4882a593Smuzhiyun │ │ xchg %ax,%ax 306*4882a593Smuzhiyun │1330:│ mov %r15,%r10 307*4882a593Smuzhiyun │1333:└─→cmp %r15,%r14 308*4882a593Smuzhiyun 309*4882a593Smuzhiyun If jump_arrow is 'false', the arrows isn't printed as below. 310*4882a593Smuzhiyun Default is 'false'. 311*4882a593Smuzhiyun 312*4882a593Smuzhiyun │ ↓ jmp 1333 313*4882a593Smuzhiyun │ xchg %ax,%ax 314*4882a593Smuzhiyun │1330: mov %r15,%r10 315*4882a593Smuzhiyun │1333: cmp %r15,%r14 316*4882a593Smuzhiyun 317*4882a593Smuzhiyun This option works with tui browser. 318*4882a593Smuzhiyun 319*4882a593Smuzhiyun annotate.show_linenr:: 320*4882a593Smuzhiyun When showing source code if this option is 'true', 321*4882a593Smuzhiyun line numbers are printed as below. 322*4882a593Smuzhiyun 323*4882a593Smuzhiyun │1628 if (type & PERF_SAMPLE_IDENTIFIER) { 324*4882a593Smuzhiyun │ ↓ jne 508 325*4882a593Smuzhiyun │1628 data->id = *array; 326*4882a593Smuzhiyun │1629 array++; 327*4882a593Smuzhiyun │1630 } 328*4882a593Smuzhiyun 329*4882a593Smuzhiyun However if this option is 'false', they aren't printed as below. 330*4882a593Smuzhiyun Default is 'false'. 331*4882a593Smuzhiyun 332*4882a593Smuzhiyun │ if (type & PERF_SAMPLE_IDENTIFIER) { 333*4882a593Smuzhiyun │ ↓ jne 508 334*4882a593Smuzhiyun │ data->id = *array; 335*4882a593Smuzhiyun │ array++; 336*4882a593Smuzhiyun │ } 337*4882a593Smuzhiyun 338*4882a593Smuzhiyun This option works with tui, stdio2 browsers. 339*4882a593Smuzhiyun 340*4882a593Smuzhiyun annotate.show_nr_jumps:: 341*4882a593Smuzhiyun Let's see a part of assembly code. 342*4882a593Smuzhiyun 343*4882a593Smuzhiyun │1382: movb $0x1,-0x270(%rbp) 344*4882a593Smuzhiyun 345*4882a593Smuzhiyun If use this, the number of branches jumping to that address can be printed as below. 346*4882a593Smuzhiyun Default is 'false'. 347*4882a593Smuzhiyun 348*4882a593Smuzhiyun │1 1382: movb $0x1,-0x270(%rbp) 349*4882a593Smuzhiyun 350*4882a593Smuzhiyun This option works with tui, stdio2 browsers. 351*4882a593Smuzhiyun 352*4882a593Smuzhiyun annotate.show_total_period:: 353*4882a593Smuzhiyun To compare two records on an instruction base, with this option 354*4882a593Smuzhiyun provided, display total number of samples that belong to a line 355*4882a593Smuzhiyun in assembly code. If this option is 'true', total periods are printed 356*4882a593Smuzhiyun instead of percent values as below. 357*4882a593Smuzhiyun 358*4882a593Smuzhiyun 302 │ mov %eax,%eax 359*4882a593Smuzhiyun 360*4882a593Smuzhiyun But if this option is 'false', percent values for overhead are printed i.e. 361*4882a593Smuzhiyun Default is 'false'. 362*4882a593Smuzhiyun 363*4882a593Smuzhiyun 99.93 │ mov %eax,%eax 364*4882a593Smuzhiyun 365*4882a593Smuzhiyun This option works with tui, stdio2, stdio browsers. 366*4882a593Smuzhiyun 367*4882a593Smuzhiyun annotate.show_nr_samples:: 368*4882a593Smuzhiyun By default perf annotate shows percentage of samples. This option 369*4882a593Smuzhiyun can be used to print absolute number of samples. Ex, when set as 370*4882a593Smuzhiyun false: 371*4882a593Smuzhiyun 372*4882a593Smuzhiyun Percent│ 373*4882a593Smuzhiyun 74.03 │ mov %fs:0x28,%rax 374*4882a593Smuzhiyun 375*4882a593Smuzhiyun When set as true: 376*4882a593Smuzhiyun 377*4882a593Smuzhiyun Samples│ 378*4882a593Smuzhiyun 6 │ mov %fs:0x28,%rax 379*4882a593Smuzhiyun 380*4882a593Smuzhiyun This option works with tui, stdio2, stdio browsers. 381*4882a593Smuzhiyun 382*4882a593Smuzhiyun annotate.offset_level:: 383*4882a593Smuzhiyun Default is '1', meaning just jump targets will have offsets show right beside 384*4882a593Smuzhiyun the instruction. When set to '2' 'call' instructions will also have its offsets 385*4882a593Smuzhiyun shown, 3 or higher will show offsets for all instructions. 386*4882a593Smuzhiyun 387*4882a593Smuzhiyun This option works with tui, stdio2 browsers. 388*4882a593Smuzhiyun 389*4882a593Smuzhiyunhist.*:: 390*4882a593Smuzhiyun hist.percentage:: 391*4882a593Smuzhiyun This option control the way to calculate overhead of filtered entries - 392*4882a593Smuzhiyun that means the value of this option is effective only if there's a 393*4882a593Smuzhiyun filter (by comm, dso or symbol name). Suppose a following example: 394*4882a593Smuzhiyun 395*4882a593Smuzhiyun Overhead Symbols 396*4882a593Smuzhiyun ........ ....... 397*4882a593Smuzhiyun 33.33% foo 398*4882a593Smuzhiyun 33.33% bar 399*4882a593Smuzhiyun 33.33% baz 400*4882a593Smuzhiyun 401*4882a593Smuzhiyun This is an original overhead and we'll filter out the first 'foo' 402*4882a593Smuzhiyun entry. The value of 'relative' would increase the overhead of 'bar' 403*4882a593Smuzhiyun and 'baz' to 50.00% for each, while 'absolute' would show their 404*4882a593Smuzhiyun current overhead (33.33%). 405*4882a593Smuzhiyun 406*4882a593Smuzhiyunui.*:: 407*4882a593Smuzhiyun ui.show-headers:: 408*4882a593Smuzhiyun This option controls display of column headers (like 'Overhead' and 'Symbol') 409*4882a593Smuzhiyun in 'report' and 'top'. If this option is false, they are hidden. 410*4882a593Smuzhiyun This option is only applied to TUI. 411*4882a593Smuzhiyun 412*4882a593Smuzhiyuncall-graph.*:: 413*4882a593Smuzhiyun The following controls the handling of call-graphs (obtained via the 414*4882a593Smuzhiyun -g/--call-graph options). 415*4882a593Smuzhiyun 416*4882a593Smuzhiyun call-graph.record-mode:: 417*4882a593Smuzhiyun The mode for user space can be 'fp' (frame pointer), 'dwarf' 418*4882a593Smuzhiyun and 'lbr'. The value 'dwarf' is effective only if libunwind 419*4882a593Smuzhiyun (or a recent version of libdw) is present on the system; 420*4882a593Smuzhiyun the value 'lbr' only works for certain cpus. The method for 421*4882a593Smuzhiyun kernel space is controlled not by this option but by the 422*4882a593Smuzhiyun kernel config (CONFIG_UNWINDER_*). 423*4882a593Smuzhiyun 424*4882a593Smuzhiyun call-graph.dump-size:: 425*4882a593Smuzhiyun The size of stack to dump in order to do post-unwinding. Default is 8192 (byte). 426*4882a593Smuzhiyun When using dwarf into record-mode, the default size will be used if omitted. 427*4882a593Smuzhiyun 428*4882a593Smuzhiyun call-graph.print-type:: 429*4882a593Smuzhiyun The print-types can be graph (graph absolute), fractal (graph relative), 430*4882a593Smuzhiyun flat and folded. This option controls a way to show overhead for each callchain 431*4882a593Smuzhiyun entry. Suppose a following example. 432*4882a593Smuzhiyun 433*4882a593Smuzhiyun Overhead Symbols 434*4882a593Smuzhiyun ........ ....... 435*4882a593Smuzhiyun 40.00% foo 436*4882a593Smuzhiyun | 437*4882a593Smuzhiyun ---foo 438*4882a593Smuzhiyun | 439*4882a593Smuzhiyun |--50.00%--bar 440*4882a593Smuzhiyun | main 441*4882a593Smuzhiyun | 442*4882a593Smuzhiyun --50.00%--baz 443*4882a593Smuzhiyun main 444*4882a593Smuzhiyun 445*4882a593Smuzhiyun This output is a 'fractal' format. The 'foo' came from 'bar' and 'baz' exactly 446*4882a593Smuzhiyun half and half so 'fractal' shows 50.00% for each 447*4882a593Smuzhiyun (meaning that it assumes 100% total overhead of 'foo'). 448*4882a593Smuzhiyun 449*4882a593Smuzhiyun The 'graph' uses absolute overhead value of 'foo' as total so each of 450*4882a593Smuzhiyun 'bar' and 'baz' callchain will have 20.00% of overhead. 451*4882a593Smuzhiyun If 'flat' is used, single column and linear exposure of call chains. 452*4882a593Smuzhiyun 'folded' mean call chains are displayed in a line, separated by semicolons. 453*4882a593Smuzhiyun 454*4882a593Smuzhiyun call-graph.order:: 455*4882a593Smuzhiyun This option controls print order of callchains. The default is 456*4882a593Smuzhiyun 'callee' which means callee is printed at top and then followed by its 457*4882a593Smuzhiyun caller and so on. The 'caller' prints it in reverse order. 458*4882a593Smuzhiyun 459*4882a593Smuzhiyun If this option is not set and report.children or top.children is 460*4882a593Smuzhiyun set to true (or the equivalent command line option is given), 461*4882a593Smuzhiyun the default value of this option is changed to 'caller' for the 462*4882a593Smuzhiyun execution of 'perf report' or 'perf top'. Other commands will 463*4882a593Smuzhiyun still default to 'callee'. 464*4882a593Smuzhiyun 465*4882a593Smuzhiyun call-graph.sort-key:: 466*4882a593Smuzhiyun The callchains are merged if they contain same information. 467*4882a593Smuzhiyun The sort-key option determines a way to compare the callchains. 468*4882a593Smuzhiyun A value of 'sort-key' can be 'function' or 'address'. 469*4882a593Smuzhiyun The default is 'function'. 470*4882a593Smuzhiyun 471*4882a593Smuzhiyun call-graph.threshold:: 472*4882a593Smuzhiyun When there're many callchains it'd print tons of lines. So perf omits 473*4882a593Smuzhiyun small callchains under a certain overhead (threshold) and this option 474*4882a593Smuzhiyun control the threshold. Default is 0.5 (%). The overhead is calculated 475*4882a593Smuzhiyun by value depends on call-graph.print-type. 476*4882a593Smuzhiyun 477*4882a593Smuzhiyun call-graph.print-limit:: 478*4882a593Smuzhiyun This is a maximum number of lines of callchain printed for a single 479*4882a593Smuzhiyun histogram entry. Default is 0 which means no limitation. 480*4882a593Smuzhiyun 481*4882a593Smuzhiyunreport.*:: 482*4882a593Smuzhiyun report.sort_order:: 483*4882a593Smuzhiyun Allows changing the default sort order from "comm,dso,symbol" to 484*4882a593Smuzhiyun some other default, for instance "sym,dso" may be more fitting for 485*4882a593Smuzhiyun kernel developers. 486*4882a593Smuzhiyun report.percent-limit:: 487*4882a593Smuzhiyun This one is mostly the same as call-graph.threshold but works for 488*4882a593Smuzhiyun histogram entries. Entries having an overhead lower than this 489*4882a593Smuzhiyun percentage will not be printed. Default is '0'. If percent-limit 490*4882a593Smuzhiyun is '10', only entries which have more than 10% of overhead will be 491*4882a593Smuzhiyun printed. 492*4882a593Smuzhiyun 493*4882a593Smuzhiyun report.queue-size:: 494*4882a593Smuzhiyun This option sets up the maximum allocation size of the internal 495*4882a593Smuzhiyun event queue for ordering events. Default is 0, meaning no limit. 496*4882a593Smuzhiyun 497*4882a593Smuzhiyun report.children:: 498*4882a593Smuzhiyun 'Children' means functions called from another function. 499*4882a593Smuzhiyun If this option is true, 'perf report' cumulates callchains of children 500*4882a593Smuzhiyun and show (accumulated) total overhead as well as 'Self' overhead. 501*4882a593Smuzhiyun Please refer to the 'perf report' manual. The default is 'true'. 502*4882a593Smuzhiyun 503*4882a593Smuzhiyun report.group:: 504*4882a593Smuzhiyun This option is to show event group information together. 505*4882a593Smuzhiyun Example output with this turned on, notice that there is one column 506*4882a593Smuzhiyun per event in the group, ref-cycles and cycles: 507*4882a593Smuzhiyun 508*4882a593Smuzhiyun # group: {ref-cycles,cycles} 509*4882a593Smuzhiyun # ======== 510*4882a593Smuzhiyun # 511*4882a593Smuzhiyun # Samples: 7K of event 'anon group { ref-cycles, cycles }' 512*4882a593Smuzhiyun # Event count (approx.): 6876107743 513*4882a593Smuzhiyun # 514*4882a593Smuzhiyun # Overhead Command Shared Object Symbol 515*4882a593Smuzhiyun # ................ ....... ................. ................... 516*4882a593Smuzhiyun # 517*4882a593Smuzhiyun 99.84% 99.76% noploop noploop [.] main 518*4882a593Smuzhiyun 0.07% 0.00% noploop ld-2.15.so [.] strcmp 519*4882a593Smuzhiyun 0.03% 0.00% noploop [kernel.kallsyms] [k] timerqueue_del 520*4882a593Smuzhiyun 521*4882a593Smuzhiyuntop.*:: 522*4882a593Smuzhiyun top.children:: 523*4882a593Smuzhiyun Same as 'report.children'. So if it is enabled, the output of 'top' 524*4882a593Smuzhiyun command will have 'Children' overhead column as well as 'Self' overhead 525*4882a593Smuzhiyun column by default. 526*4882a593Smuzhiyun The default is 'true'. 527*4882a593Smuzhiyun 528*4882a593Smuzhiyun top.call-graph:: 529*4882a593Smuzhiyun This is identical to 'call-graph.record-mode', except it is 530*4882a593Smuzhiyun applicable only for 'top' subcommand. This option ONLY setup 531*4882a593Smuzhiyun the unwind method. To enable 'perf top' to actually use it, 532*4882a593Smuzhiyun the command line option -g must be specified. 533*4882a593Smuzhiyun 534*4882a593Smuzhiyunman.*:: 535*4882a593Smuzhiyun man.viewer:: 536*4882a593Smuzhiyun This option can assign a tool to view manual pages when 'help' 537*4882a593Smuzhiyun subcommand was invoked. Supported tools are 'man', 'woman' 538*4882a593Smuzhiyun (with emacs client) and 'konqueror'. Default is 'man'. 539*4882a593Smuzhiyun 540*4882a593Smuzhiyun New man viewer tool can be also added using 'man.<tool>.cmd' 541*4882a593Smuzhiyun or use different path using 'man.<tool>.path' config option. 542*4882a593Smuzhiyun 543*4882a593Smuzhiyunpager.*:: 544*4882a593Smuzhiyun pager.<subcommand>:: 545*4882a593Smuzhiyun When the subcommand is run on stdio, determine whether it uses 546*4882a593Smuzhiyun pager or not based on this value. Default is 'unspecified'. 547*4882a593Smuzhiyun 548*4882a593Smuzhiyunkmem.*:: 549*4882a593Smuzhiyun kmem.default:: 550*4882a593Smuzhiyun This option decides which allocator is to be analyzed if neither 551*4882a593Smuzhiyun '--slab' nor '--page' option is used. Default is 'slab'. 552*4882a593Smuzhiyun 553*4882a593Smuzhiyunrecord.*:: 554*4882a593Smuzhiyun record.build-id:: 555*4882a593Smuzhiyun This option can be 'cache', 'no-cache' or 'skip'. 556*4882a593Smuzhiyun 'cache' is to post-process data and save/update the binaries into 557*4882a593Smuzhiyun the build-id cache (in ~/.debug). This is the default. 558*4882a593Smuzhiyun But if this option is 'no-cache', it will not update the build-id cache. 559*4882a593Smuzhiyun 'skip' skips post-processing and does not update the cache. 560*4882a593Smuzhiyun 561*4882a593Smuzhiyun record.call-graph:: 562*4882a593Smuzhiyun This is identical to 'call-graph.record-mode', except it is 563*4882a593Smuzhiyun applicable only for 'record' subcommand. This option ONLY setup 564*4882a593Smuzhiyun the unwind method. To enable 'perf record' to actually use it, 565*4882a593Smuzhiyun the command line option -g must be specified. 566*4882a593Smuzhiyun 567*4882a593Smuzhiyun record.aio:: 568*4882a593Smuzhiyun Use 'n' control blocks in asynchronous (Posix AIO) trace writing 569*4882a593Smuzhiyun mode ('n' default: 1, max: 4). 570*4882a593Smuzhiyun 571*4882a593Smuzhiyundiff.*:: 572*4882a593Smuzhiyun diff.order:: 573*4882a593Smuzhiyun This option sets the number of columns to sort the result. 574*4882a593Smuzhiyun The default is 0, which means sorting by baseline. 575*4882a593Smuzhiyun Setting it to 1 will sort the result by delta (or other 576*4882a593Smuzhiyun compute method selected). 577*4882a593Smuzhiyun 578*4882a593Smuzhiyun diff.compute:: 579*4882a593Smuzhiyun This options sets the method for computing the diff result. 580*4882a593Smuzhiyun Possible values are 'delta', 'delta-abs', 'ratio' and 581*4882a593Smuzhiyun 'wdiff'. Default is 'delta'. 582*4882a593Smuzhiyun 583*4882a593Smuzhiyuntrace.*:: 584*4882a593Smuzhiyun trace.add_events:: 585*4882a593Smuzhiyun Allows adding a set of events to add to the ones specified 586*4882a593Smuzhiyun by the user, or use as a default one if none was specified. 587*4882a593Smuzhiyun The initial use case is to add augmented_raw_syscalls.o to 588*4882a593Smuzhiyun activate the 'perf trace' logic that looks for syscall 589*4882a593Smuzhiyun pointer contents after the normal tracepoint payload. 590*4882a593Smuzhiyun 591*4882a593Smuzhiyun trace.args_alignment:: 592*4882a593Smuzhiyun Number of columns to align the argument list, default is 70, 593*4882a593Smuzhiyun use 40 for the strace default, zero to no alignment. 594*4882a593Smuzhiyun 595*4882a593Smuzhiyun trace.no_inherit:: 596*4882a593Smuzhiyun Do not follow children threads. 597*4882a593Smuzhiyun 598*4882a593Smuzhiyun trace.show_arg_names:: 599*4882a593Smuzhiyun Should syscall argument names be printed? If not then trace.show_zeros 600*4882a593Smuzhiyun will be set. 601*4882a593Smuzhiyun 602*4882a593Smuzhiyun trace.show_duration:: 603*4882a593Smuzhiyun Show syscall duration. 604*4882a593Smuzhiyun 605*4882a593Smuzhiyun trace.show_prefix:: 606*4882a593Smuzhiyun If set to 'yes' will show common string prefixes in tables. The default 607*4882a593Smuzhiyun is to remove the common prefix in things like "MAP_SHARED", showing just "SHARED". 608*4882a593Smuzhiyun 609*4882a593Smuzhiyun trace.show_timestamp:: 610*4882a593Smuzhiyun Show syscall start timestamp. 611*4882a593Smuzhiyun 612*4882a593Smuzhiyun trace.show_zeros:: 613*4882a593Smuzhiyun Do not suppress syscall arguments that are equal to zero. 614*4882a593Smuzhiyun 615*4882a593Smuzhiyun trace.tracepoint_beautifiers:: 616*4882a593Smuzhiyun Use "libtraceevent" to use that library to augment the tracepoint arguments, 617*4882a593Smuzhiyun "libbeauty", the default, to use the same argument beautifiers used in the 618*4882a593Smuzhiyun strace-like sys_enter+sys_exit lines. 619*4882a593Smuzhiyun 620*4882a593Smuzhiyunftrace.*:: 621*4882a593Smuzhiyun ftrace.tracer:: 622*4882a593Smuzhiyun Can be used to select the default tracer when neither -G nor 623*4882a593Smuzhiyun -F option is not specified. Possible values are 'function' and 624*4882a593Smuzhiyun 'function_graph'. 625*4882a593Smuzhiyun 626*4882a593Smuzhiyunllvm.*:: 627*4882a593Smuzhiyun llvm.clang-path:: 628*4882a593Smuzhiyun Path to clang. If omit, search it from $PATH. 629*4882a593Smuzhiyun 630*4882a593Smuzhiyun llvm.clang-bpf-cmd-template:: 631*4882a593Smuzhiyun Cmdline template. Below lines show its default value. Environment 632*4882a593Smuzhiyun variable is used to pass options. 633*4882a593Smuzhiyun "$CLANG_EXEC -D__KERNEL__ -D__NR_CPUS__=$NR_CPUS "\ 634*4882a593Smuzhiyun "-DLINUX_VERSION_CODE=$LINUX_VERSION_CODE " \ 635*4882a593Smuzhiyun "$CLANG_OPTIONS $PERF_BPF_INC_OPTIONS $KERNEL_INC_OPTIONS " \ 636*4882a593Smuzhiyun "-Wno-unused-value -Wno-pointer-sign " \ 637*4882a593Smuzhiyun "-working-directory $WORKING_DIR " \ 638*4882a593Smuzhiyun "-c \"$CLANG_SOURCE\" -target bpf $CLANG_EMIT_LLVM -O2 -o - $LLVM_OPTIONS_PIPE" 639*4882a593Smuzhiyun 640*4882a593Smuzhiyun llvm.clang-opt:: 641*4882a593Smuzhiyun Options passed to clang. 642*4882a593Smuzhiyun 643*4882a593Smuzhiyun llvm.kbuild-dir:: 644*4882a593Smuzhiyun kbuild directory. If not set, use /lib/modules/`uname -r`/build. 645*4882a593Smuzhiyun If set to "" deliberately, skip kernel header auto-detector. 646*4882a593Smuzhiyun 647*4882a593Smuzhiyun llvm.kbuild-opts:: 648*4882a593Smuzhiyun Options passed to 'make' when detecting kernel header options. 649*4882a593Smuzhiyun 650*4882a593Smuzhiyun llvm.dump-obj:: 651*4882a593Smuzhiyun Enable perf dump BPF object files compiled by LLVM. 652*4882a593Smuzhiyun 653*4882a593Smuzhiyun llvm.opts:: 654*4882a593Smuzhiyun Options passed to llc. 655*4882a593Smuzhiyun 656*4882a593Smuzhiyunsamples.*:: 657*4882a593Smuzhiyun 658*4882a593Smuzhiyun samples.context:: 659*4882a593Smuzhiyun Define how many ns worth of time to show 660*4882a593Smuzhiyun around samples in perf report sample context browser. 661*4882a593Smuzhiyun 662*4882a593Smuzhiyunscripts.*:: 663*4882a593Smuzhiyun 664*4882a593Smuzhiyun Any option defines a script that is added to the scripts menu 665*4882a593Smuzhiyun in the interactive perf browser and whose output is displayed. 666*4882a593Smuzhiyun The name of the option is the name, the value is a script command line. 667*4882a593Smuzhiyun The script gets the same options passed as a full perf script, 668*4882a593Smuzhiyun in particular -i perfdata file, --cpu, --tid 669*4882a593Smuzhiyun 670*4882a593Smuzhiyunconvert.*:: 671*4882a593Smuzhiyun 672*4882a593Smuzhiyun convert.queue-size:: 673*4882a593Smuzhiyun Limit the size of ordered_events queue, so we could control 674*4882a593Smuzhiyun allocation size of perf data files without proper finished 675*4882a593Smuzhiyun round events. 676*4882a593Smuzhiyunstat.*:: 677*4882a593Smuzhiyun 678*4882a593Smuzhiyun stat.big-num:: 679*4882a593Smuzhiyun (boolean) Change the default for "--big-num". To make 680*4882a593Smuzhiyun "--no-big-num" the default, set "stat.big-num=false". 681*4882a593Smuzhiyun 682*4882a593Smuzhiyunintel-pt.*:: 683*4882a593Smuzhiyun 684*4882a593Smuzhiyun intel-pt.cache-divisor:: 685*4882a593Smuzhiyun 686*4882a593Smuzhiyun intel-pt.mispred-all:: 687*4882a593Smuzhiyun If set, Intel PT decoder will set the mispred flag on all 688*4882a593Smuzhiyun branches. 689*4882a593Smuzhiyun 690*4882a593Smuzhiyunauxtrace.*:: 691*4882a593Smuzhiyun 692*4882a593Smuzhiyun auxtrace.dumpdir:: 693*4882a593Smuzhiyun s390 only. The directory to save the auxiliary trace buffer 694*4882a593Smuzhiyun can be changed using this option. Ex, auxtrace.dumpdir=/tmp. 695*4882a593Smuzhiyun If the directory does not exist or has the wrong file type, 696*4882a593Smuzhiyun the current directory is used. 697*4882a593Smuzhiyun 698*4882a593SmuzhiyunSEE ALSO 699*4882a593Smuzhiyun-------- 700*4882a593Smuzhiyunlinkperf:perf[1] 701