diff options
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/Documentation/tips.txt | 4 | ||||
-rw-r--r-- | tools/perf/arch/powerpc/util/sym-handling.c | 3 | ||||
-rw-r--r-- | tools/perf/pmu-events/jevents.c | 2 | ||||
-rw-r--r-- | tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | 38 |
4 files changed, 46 insertions, 1 deletions
diff --git a/tools/perf/Documentation/tips.txt b/tools/perf/Documentation/tips.txt index 5950b5a24efd..8a6479c0eac9 100644 --- a/tools/perf/Documentation/tips.txt +++ b/tools/perf/Documentation/tips.txt | |||
@@ -28,3 +28,7 @@ To change sampling frequency to 100 Hz: perf record -F 100 | |||
28 | See assembly instructions with percentage: perf annotate <symbol> | 28 | See assembly instructions with percentage: perf annotate <symbol> |
29 | If you prefer Intel style assembly, try: perf annotate -M intel | 29 | If you prefer Intel style assembly, try: perf annotate -M intel |
30 | For hierarchical output, try: perf report --hierarchy | 30 | For hierarchical output, try: perf report --hierarchy |
31 | Order by the overhead of source file name and line number: perf report -s srcline | ||
32 | System-wide collection from all CPUs: perf record -a | ||
33 | Show current config key-value pairs: perf config --list | ||
34 | Show user configuration overrides: perf config --user --list | ||
diff --git a/tools/perf/arch/powerpc/util/sym-handling.c b/tools/perf/arch/powerpc/util/sym-handling.c index ed9d5d15d5b6..1030a6e504bb 100644 --- a/tools/perf/arch/powerpc/util/sym-handling.c +++ b/tools/perf/arch/powerpc/util/sym-handling.c | |||
@@ -82,7 +82,8 @@ void arch__fix_tev_from_maps(struct perf_probe_event *pev, | |||
82 | * | 82 | * |
83 | * In addition, we shouldn't specify an offset for kretprobes. | 83 | * In addition, we shouldn't specify an offset for kretprobes. |
84 | */ | 84 | */ |
85 | if (pev->point.offset || pev->point.retprobe || !map || !sym) | 85 | if (pev->point.offset || (!pev->uprobes && pev->point.retprobe) || |
86 | !map || !sym) | ||
86 | return; | 87 | return; |
87 | 88 | ||
88 | lep_offset = PPC64_LOCAL_ENTRY_OFFSET(sym->arch_sym); | 89 | lep_offset = PPC64_LOCAL_ENTRY_OFFSET(sym->arch_sym); |
diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c index 79c2133bc534..41611d7f9873 100644 --- a/tools/perf/pmu-events/jevents.c +++ b/tools/perf/pmu-events/jevents.c | |||
@@ -312,6 +312,8 @@ static struct fixed { | |||
312 | const char *event; | 312 | const char *event; |
313 | } fixed[] = { | 313 | } fixed[] = { |
314 | { "inst_retired.any", "event=0xc0" }, | 314 | { "inst_retired.any", "event=0xc0" }, |
315 | { "inst_retired.any_p", "event=0xc0" }, | ||
316 | { "cpu_clk_unhalted.ref", "event=0x0,umask=0x03" }, | ||
315 | { "cpu_clk_unhalted.thread", "event=0x3c" }, | 317 | { "cpu_clk_unhalted.thread", "event=0x3c" }, |
316 | { "cpu_clk_unhalted.thread_any", "event=0x3c,any=1" }, | 318 | { "cpu_clk_unhalted.thread_any", "event=0x3c,any=1" }, |
317 | { NULL, NULL}, | 319 | { NULL, NULL}, |
diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c index 7591a0c37473..16c06d3ae577 100644 --- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c +++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | |||
@@ -90,6 +90,7 @@ struct intel_pt_decoder { | |||
90 | bool pge; | 90 | bool pge; |
91 | bool have_tma; | 91 | bool have_tma; |
92 | bool have_cyc; | 92 | bool have_cyc; |
93 | bool fixup_last_mtc; | ||
93 | uint64_t pos; | 94 | uint64_t pos; |
94 | uint64_t last_ip; | 95 | uint64_t last_ip; |
95 | uint64_t ip; | 96 | uint64_t ip; |
@@ -586,10 +587,31 @@ struct intel_pt_calc_cyc_to_tsc_info { | |||
586 | uint64_t tsc_timestamp; | 587 | uint64_t tsc_timestamp; |
587 | uint64_t timestamp; | 588 | uint64_t timestamp; |
588 | bool have_tma; | 589 | bool have_tma; |
590 | bool fixup_last_mtc; | ||
589 | bool from_mtc; | 591 | bool from_mtc; |
590 | double cbr_cyc_to_tsc; | 592 | double cbr_cyc_to_tsc; |
591 | }; | 593 | }; |
592 | 594 | ||
595 | /* | ||
596 | * MTC provides a 8-bit slice of CTC but the TMA packet only provides the lower | ||
597 | * 16 bits of CTC. If mtc_shift > 8 then some of the MTC bits are not in the CTC | ||
598 | * provided by the TMA packet. Fix-up the last_mtc calculated from the TMA | ||
599 | * packet by copying the missing bits from the current MTC assuming the least | ||
600 | * difference between the two, and that the current MTC comes after last_mtc. | ||
601 | */ | ||
602 | static void intel_pt_fixup_last_mtc(uint32_t mtc, int mtc_shift, | ||
603 | uint32_t *last_mtc) | ||
604 | { | ||
605 | uint32_t first_missing_bit = 1U << (16 - mtc_shift); | ||
606 | uint32_t mask = ~(first_missing_bit - 1); | ||
607 | |||
608 | *last_mtc |= mtc & mask; | ||
609 | if (*last_mtc >= mtc) { | ||
610 | *last_mtc -= first_missing_bit; | ||
611 | *last_mtc &= 0xff; | ||
612 | } | ||
613 | } | ||
614 | |||
593 | static int intel_pt_calc_cyc_cb(struct intel_pt_pkt_info *pkt_info) | 615 | static int intel_pt_calc_cyc_cb(struct intel_pt_pkt_info *pkt_info) |
594 | { | 616 | { |
595 | struct intel_pt_decoder *decoder = pkt_info->decoder; | 617 | struct intel_pt_decoder *decoder = pkt_info->decoder; |
@@ -619,6 +641,11 @@ static int intel_pt_calc_cyc_cb(struct intel_pt_pkt_info *pkt_info) | |||
619 | return 0; | 641 | return 0; |
620 | 642 | ||
621 | mtc = pkt_info->packet.payload; | 643 | mtc = pkt_info->packet.payload; |
644 | if (decoder->mtc_shift > 8 && data->fixup_last_mtc) { | ||
645 | data->fixup_last_mtc = false; | ||
646 | intel_pt_fixup_last_mtc(mtc, decoder->mtc_shift, | ||
647 | &data->last_mtc); | ||
648 | } | ||
622 | if (mtc > data->last_mtc) | 649 | if (mtc > data->last_mtc) |
623 | mtc_delta = mtc - data->last_mtc; | 650 | mtc_delta = mtc - data->last_mtc; |
624 | else | 651 | else |
@@ -687,6 +714,7 @@ static int intel_pt_calc_cyc_cb(struct intel_pt_pkt_info *pkt_info) | |||
687 | 714 | ||
688 | data->ctc_delta = 0; | 715 | data->ctc_delta = 0; |
689 | data->have_tma = true; | 716 | data->have_tma = true; |
717 | data->fixup_last_mtc = true; | ||
690 | 718 | ||
691 | return 0; | 719 | return 0; |
692 | 720 | ||
@@ -753,6 +781,7 @@ static void intel_pt_calc_cyc_to_tsc(struct intel_pt_decoder *decoder, | |||
753 | .tsc_timestamp = decoder->tsc_timestamp, | 781 | .tsc_timestamp = decoder->tsc_timestamp, |
754 | .timestamp = decoder->timestamp, | 782 | .timestamp = decoder->timestamp, |
755 | .have_tma = decoder->have_tma, | 783 | .have_tma = decoder->have_tma, |
784 | .fixup_last_mtc = decoder->fixup_last_mtc, | ||
756 | .from_mtc = from_mtc, | 785 | .from_mtc = from_mtc, |
757 | .cbr_cyc_to_tsc = 0, | 786 | .cbr_cyc_to_tsc = 0, |
758 | }; | 787 | }; |
@@ -1271,6 +1300,7 @@ static void intel_pt_calc_tma(struct intel_pt_decoder *decoder) | |||
1271 | } | 1300 | } |
1272 | decoder->ctc_delta = 0; | 1301 | decoder->ctc_delta = 0; |
1273 | decoder->have_tma = true; | 1302 | decoder->have_tma = true; |
1303 | decoder->fixup_last_mtc = true; | ||
1274 | intel_pt_log("CTC timestamp " x64_fmt " last MTC %#x CTC rem %#x\n", | 1304 | intel_pt_log("CTC timestamp " x64_fmt " last MTC %#x CTC rem %#x\n", |
1275 | decoder->ctc_timestamp, decoder->last_mtc, ctc_rem); | 1305 | decoder->ctc_timestamp, decoder->last_mtc, ctc_rem); |
1276 | } | 1306 | } |
@@ -1285,6 +1315,12 @@ static void intel_pt_calc_mtc_timestamp(struct intel_pt_decoder *decoder) | |||
1285 | 1315 | ||
1286 | mtc = decoder->packet.payload; | 1316 | mtc = decoder->packet.payload; |
1287 | 1317 | ||
1318 | if (decoder->mtc_shift > 8 && decoder->fixup_last_mtc) { | ||
1319 | decoder->fixup_last_mtc = false; | ||
1320 | intel_pt_fixup_last_mtc(mtc, decoder->mtc_shift, | ||
1321 | &decoder->last_mtc); | ||
1322 | } | ||
1323 | |||
1288 | if (mtc > decoder->last_mtc) | 1324 | if (mtc > decoder->last_mtc) |
1289 | mtc_delta = mtc - decoder->last_mtc; | 1325 | mtc_delta = mtc - decoder->last_mtc; |
1290 | else | 1326 | else |
@@ -1353,6 +1389,8 @@ static void intel_pt_calc_cyc_timestamp(struct intel_pt_decoder *decoder) | |||
1353 | timestamp, decoder->timestamp); | 1389 | timestamp, decoder->timestamp); |
1354 | else | 1390 | else |
1355 | decoder->timestamp = timestamp; | 1391 | decoder->timestamp = timestamp; |
1392 | |||
1393 | decoder->timestamp_insn_cnt = 0; | ||
1356 | } | 1394 | } |
1357 | 1395 | ||
1358 | /* Walk PSB+ packets when already in sync. */ | 1396 | /* Walk PSB+ packets when already in sync. */ |