Skip to content

Commit 7977fed

Browse files
author
Ingo Molnar
committed
Merge tag 'perf-urgent-for-mingo-5.6-20200228' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/urgent fixes from Arnaldo Carvalho de Melo: perf annotate: Ravi Bangoria: - Fix segfault with source toggle. - Fix --show-total-period and --show-nr-samples for tui/stdio2. - Fix handling of settings in ~/.perfconfig versus the ones passed in the command line - Re-render title bar after switching back from script browser. - Fix options man page, document some missing ones. perf probe: He Zhe: - Check return value of strlist__add() for -ENOMEM. tools UAPI: Arnaldo Carvalho de Melo: - Sync x86's msr-index.h copy with the kernel sources. - Update tools's copy of x86's kvm.h headers. Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2 parents 4c45945 + e0560ba commit 7977fed

File tree

14 files changed

+210
-148
lines changed

14 files changed

+210
-148
lines changed

tools/arch/x86/include/asm/msr-index.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,8 @@
512512
#define MSR_K7_HWCR 0xc0010015
513513
#define MSR_K7_HWCR_SMMLOCK_BIT 0
514514
#define MSR_K7_HWCR_SMMLOCK BIT_ULL(MSR_K7_HWCR_SMMLOCK_BIT)
515+
#define MSR_K7_HWCR_IRPERF_EN_BIT 30
516+
#define MSR_K7_HWCR_IRPERF_EN BIT_ULL(MSR_K7_HWCR_IRPERF_EN_BIT)
515517
#define MSR_K7_FID_VID_CTL 0xc0010041
516518
#define MSR_K7_FID_VID_STATUS 0xc0010042
517519

tools/arch/x86/include/uapi/asm/kvm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ struct kvm_sync_regs {
390390
#define KVM_STATE_NESTED_GUEST_MODE 0x00000001
391391
#define KVM_STATE_NESTED_RUN_PENDING 0x00000002
392392
#define KVM_STATE_NESTED_EVMCS 0x00000004
393+
#define KVM_STATE_NESTED_MTF_PENDING 0x00000008
393394

394395
#define KVM_STATE_NESTED_SMM_GUEST_MODE 0x00000001
395396
#define KVM_STATE_NESTED_SMM_VMXON 0x00000002

tools/perf/Documentation/perf-config.txt

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ buildid.*::
239239
set buildid.dir to /dev/null. The default is $HOME/.debug
240240

241241
annotate.*::
242-
These options work only for TUI.
243242
These are in control of addresses, jump function, source code
244243
in lines of assembly code from a specific program.
245244

@@ -269,6 +268,8 @@ annotate.*::
269268
│ mov (%rdi),%rdx
270269
│ return n;
271270

271+
This option works with tui, stdio2 browsers.
272+
272273
annotate.use_offset::
273274
Basing on a first address of a loaded function, offset can be used.
274275
Instead of using original addresses of assembly code,
@@ -287,6 +288,8 @@ annotate.*::
287288

288289
368:│ mov 0x8(%r14),%rdi
289290

291+
This option works with tui, stdio2 browsers.
292+
290293
annotate.jump_arrows::
291294
There can be jump instruction among assembly code.
292295
Depending on a boolean value of jump_arrows,
@@ -306,6 +309,8 @@ annotate.*::
306309
│1330: mov %r15,%r10
307310
│1333: cmp %r15,%r14
308311

312+
This option works with tui browser.
313+
309314
annotate.show_linenr::
310315
When showing source code if this option is 'true',
311316
line numbers are printed as below.
@@ -325,6 +330,8 @@ annotate.*::
325330
│ array++;
326331
│ }
327332

333+
This option works with tui, stdio2 browsers.
334+
328335
annotate.show_nr_jumps::
329336
Let's see a part of assembly code.
330337

@@ -335,6 +342,8 @@ annotate.*::
335342

336343
│1 1382: movb $0x1,-0x270(%rbp)
337344

345+
This option works with tui, stdio2 browsers.
346+
338347
annotate.show_total_period::
339348
To compare two records on an instruction base, with this option
340349
provided, display total number of samples that belong to a line
@@ -348,11 +357,30 @@ annotate.*::
348357

349358
99.93 │ mov %eax,%eax
350359

360+
This option works with tui, stdio2, stdio browsers.
361+
362+
annotate.show_nr_samples::
363+
By default perf annotate shows percentage of samples. This option
364+
can be used to print absolute number of samples. Ex, when set as
365+
false:
366+
367+
Percent│
368+
74.03 │ mov %fs:0x28,%rax
369+
370+
When set as true:
371+
372+
Samples│
373+
6 │ mov %fs:0x28,%rax
374+
375+
This option works with tui, stdio2, stdio browsers.
376+
351377
annotate.offset_level::
352378
Default is '1', meaning just jump targets will have offsets show right beside
353379
the instruction. When set to '2' 'call' instructions will also have its offsets
354380
shown, 3 or higher will show offsets for all instructions.
355381

382+
This option works with tui, stdio2 browsers.
383+
356384
hist.*::
357385
hist.percentage::
358386
This option control the way to calculate overhead of filtered entries -
@@ -490,6 +518,12 @@ top.*::
490518
column by default.
491519
The default is 'true'.
492520

521+
top.call-graph::
522+
This is identical to 'call-graph.record-mode', except it is
523+
applicable only for 'top' subcommand. This option ONLY setup
524+
the unwind method. To enable 'perf top' to actually use it,
525+
the command line option -g must be specified.
526+
493527
man.*::
494528
man.viewer::
495529
This option can assign a tool to view manual pages when 'help'
@@ -517,6 +551,16 @@ record.*::
517551
But if this option is 'no-cache', it will not update the build-id cache.
518552
'skip' skips post-processing and does not update the cache.
519553

554+
record.call-graph::
555+
This is identical to 'call-graph.record-mode', except it is
556+
applicable only for 'record' subcommand. This option ONLY setup
557+
the unwind method. To enable 'perf record' to actually use it,
558+
the command line option -g must be specified.
559+
560+
record.aio::
561+
Use 'n' control blocks in asynchronous (Posix AIO) trace writing
562+
mode ('n' default: 1, max: 4).
563+
520564
diff.*::
521565
diff.order::
522566
This option sets the number of columns to sort the result.
@@ -566,6 +610,11 @@ trace.*::
566610
"libbeauty", the default, to use the same argument beautifiers used in the
567611
strace-like sys_enter+sys_exit lines.
568612

613+
ftrace.*::
614+
ftrace.tracer::
615+
Can be used to select the default tracer. Possible values are
616+
'function' and 'function_graph'.
617+
569618
llvm.*::
570619
llvm.clang-path::
571620
Path to clang. If omit, search it from $PATH.
@@ -610,6 +659,29 @@ scripts.*::
610659
The script gets the same options passed as a full perf script,
611660
in particular -i perfdata file, --cpu, --tid
612661

662+
convert.*::
663+
664+
convert.queue-size::
665+
Limit the size of ordered_events queue, so we could control
666+
allocation size of perf data files without proper finished
667+
round events.
668+
669+
intel-pt.*::
670+
671+
intel-pt.cache-divisor::
672+
673+
intel-pt.mispred-all::
674+
If set, Intel PT decoder will set the mispred flag on all
675+
branches.
676+
677+
auxtrace.*::
678+
679+
auxtrace.dumpdir::
680+
s390 only. The directory to save the auxiliary trace buffer
681+
can be changed using this option. Ex, auxtrace.dumpdir=/tmp.
682+
If the directory does not exist or has the wrong file type,
683+
the current directory is used.
684+
613685
SEE ALSO
614686
--------
615687
linkperf:perf[1]

tools/perf/builtin-annotate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,8 @@ int cmd_annotate(int argc, const char **argv)
566566
if (ret < 0)
567567
return ret;
568568

569+
annotation_config__init(&annotate.opts);
570+
569571
argc = parse_options(argc, argv, options, annotate_usage, 0);
570572
if (argc) {
571573
/*
@@ -605,8 +607,6 @@ int cmd_annotate(int argc, const char **argv)
605607
if (ret < 0)
606608
goto out_delete;
607609

608-
annotation_config__init();
609-
610610
symbol_conf.try_vmlinux_path = true;
611611

612612
ret = symbol__init(&annotate.session->header.env);

tools/perf/builtin-probe.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,8 @@ static int perf_del_probe_events(struct strfilter *filter)
449449
ret = probe_file__del_strlist(kfd, klist);
450450
if (ret < 0)
451451
goto error;
452-
}
452+
} else if (ret == -ENOMEM)
453+
goto error;
453454

454455
ret2 = probe_file__get_events(ufd, filter, ulist);
455456
if (ret2 == 0) {
@@ -459,7 +460,8 @@ static int perf_del_probe_events(struct strfilter *filter)
459460
ret2 = probe_file__del_strlist(ufd, ulist);
460461
if (ret2 < 0)
461462
goto error;
462-
}
463+
} else if (ret2 == -ENOMEM)
464+
goto error;
463465

464466
if (ret == -ENOENT && ret2 == -ENOENT)
465467
pr_warning("\"%s\" does not hit any event.\n", str);

tools/perf/builtin-report.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1507,7 +1507,7 @@ int cmd_report(int argc, const char **argv)
15071507
symbol_conf.priv_size += sizeof(u32);
15081508
symbol_conf.sort_by_name = true;
15091509
}
1510-
annotation_config__init();
1510+
annotation_config__init(&report.annotation_opts);
15111511
}
15121512

15131513
if (symbol__init(&session->header.env) < 0)

tools/perf/builtin-top.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ static int perf_top__parse_source(struct perf_top *top, struct hist_entry *he)
143143
return err;
144144
}
145145

146-
err = symbol__annotate(&he->ms, evsel, 0, &top->annotation_opts, NULL);
146+
err = symbol__annotate(&he->ms, evsel, &top->annotation_opts, NULL);
147147
if (err == 0) {
148148
top->sym_filter_entry = he;
149149
} else {
@@ -1683,7 +1683,7 @@ int cmd_top(int argc, const char **argv)
16831683
if (status < 0)
16841684
goto out_delete_evlist;
16851685

1686-
annotation_config__init();
1686+
annotation_config__init(&top.annotation_opts);
16871687

16881688
symbol_conf.try_vmlinux_path = (symbol_conf.vmlinux_name == NULL);
16891689
status = symbol__init(NULL);

tools/perf/ui/browsers/annotate.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -754,10 +754,9 @@ static int annotate_browser__run(struct annotate_browser *browser,
754754
"? Search string backwards\n");
755755
continue;
756756
case 'r':
757-
{
758-
script_browse(NULL, NULL);
759-
continue;
760-
}
757+
script_browse(NULL, NULL);
758+
annotate_browser__show(&browser->b, title, help);
759+
continue;
761760
case 'k':
762761
notes->options->show_linenr = !notes->options->show_linenr;
763762
break;
@@ -834,13 +833,13 @@ static int annotate_browser__run(struct annotate_browser *browser,
834833
map_symbol__annotation_dump(ms, evsel, browser->opts);
835834
continue;
836835
case 't':
837-
if (notes->options->show_total_period) {
838-
notes->options->show_total_period = false;
839-
notes->options->show_nr_samples = true;
840-
} else if (notes->options->show_nr_samples)
841-
notes->options->show_nr_samples = false;
836+
if (symbol_conf.show_total_period) {
837+
symbol_conf.show_total_period = false;
838+
symbol_conf.show_nr_samples = true;
839+
} else if (symbol_conf.show_nr_samples)
840+
symbol_conf.show_nr_samples = false;
842841
else
843-
notes->options->show_total_period = true;
842+
symbol_conf.show_total_period = true;
844843
annotation__update_column_widths(notes);
845844
continue;
846845
case 'c':

tools/perf/ui/gtk/annotate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ static int symbol__gtk_annotate(struct map_symbol *ms, struct evsel *evsel,
174174
if (ms->map->dso->annotate_warned)
175175
return -1;
176176

177-
err = symbol__annotate(ms, evsel, 0, &annotation__default_options, NULL);
177+
err = symbol__annotate(ms, evsel, &annotation__default_options, NULL);
178178
if (err) {
179179
char msg[BUFSIZ];
180180
symbol__strerror_disassemble(ms, err, msg, sizeof(msg));

0 commit comments

Comments
 (0)