Skip to content

Commit b07b9e8

Browse files
committed
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Ingo Molnar: "Tooling fixes, three Intel uncore driver fixes, plus an AUX events fix uncovered by the perf fuzzer" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86/intel/uncore: Remove PCIe3 unit for SNR perf/x86/intel/uncore: Fix missing marker for snr_uncore_imc_freerunning_events perf/x86/intel/uncore: Add PCI ID of IMC for Xeon E3 V5 Family perf: Correctly handle failed perf_get_aux_event() perf hists: Fix variable name's inconsistency in hists__for_each() macro perf map: Set kmap->kmaps backpointer for main kernel map chunks perf report: Fix incorrectly added dimensions as switch perf data file tools lib traceevent: Fix memory leakage in filter_event
2 parents 124b554 + 2167f16 commit b07b9e8

File tree

7 files changed

+22
-29
lines changed

7 files changed

+22
-29
lines changed

arch/x86/events/intel/uncore_snb.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#define PCI_DEVICE_ID_INTEL_SKL_HQ_IMC 0x1910
1616
#define PCI_DEVICE_ID_INTEL_SKL_SD_IMC 0x190f
1717
#define PCI_DEVICE_ID_INTEL_SKL_SQ_IMC 0x191f
18+
#define PCI_DEVICE_ID_INTEL_SKL_E3_IMC 0x1918
1819
#define PCI_DEVICE_ID_INTEL_KBL_Y_IMC 0x590c
1920
#define PCI_DEVICE_ID_INTEL_KBL_U_IMC 0x5904
2021
#define PCI_DEVICE_ID_INTEL_KBL_UQ_IMC 0x5914
@@ -657,6 +658,10 @@ static const struct pci_device_id skl_uncore_pci_ids[] = {
657658
PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SKL_SQ_IMC),
658659
.driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
659660
},
661+
{ /* IMC */
662+
PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SKL_E3_IMC),
663+
.driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
664+
},
660665
{ /* IMC */
661666
PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_KBL_Y_IMC),
662667
.driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
@@ -826,6 +831,7 @@ static const struct imc_uncore_pci_dev desktop_imc_pci_ids[] = {
826831
IMC_DEV(SKL_HQ_IMC, &skl_uncore_pci_driver), /* 6th Gen Core H Quad Core */
827832
IMC_DEV(SKL_SD_IMC, &skl_uncore_pci_driver), /* 6th Gen Core S Dual Core */
828833
IMC_DEV(SKL_SQ_IMC, &skl_uncore_pci_driver), /* 6th Gen Core S Quad Core */
834+
IMC_DEV(SKL_E3_IMC, &skl_uncore_pci_driver), /* Xeon E3 V5 Gen Core processor */
829835
IMC_DEV(KBL_Y_IMC, &skl_uncore_pci_driver), /* 7th Gen Core Y */
830836
IMC_DEV(KBL_U_IMC, &skl_uncore_pci_driver), /* 7th Gen Core U */
831837
IMC_DEV(KBL_UQ_IMC, &skl_uncore_pci_driver), /* 7th Gen Core U Quad Core */

arch/x86/events/intel/uncore_snbep.c

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -369,11 +369,6 @@
369369
#define SNR_M2M_PCI_PMON_BOX_CTL 0x438
370370
#define SNR_M2M_PCI_PMON_UMASK_EXT 0xff
371371

372-
/* SNR PCIE3 */
373-
#define SNR_PCIE3_PCI_PMON_CTL0 0x508
374-
#define SNR_PCIE3_PCI_PMON_CTR0 0x4e8
375-
#define SNR_PCIE3_PCI_PMON_BOX_CTL 0x4e4
376-
377372
/* SNR IMC */
378373
#define SNR_IMC_MMIO_PMON_FIXED_CTL 0x54
379374
#define SNR_IMC_MMIO_PMON_FIXED_CTR 0x38
@@ -4328,27 +4323,12 @@ static struct intel_uncore_type snr_uncore_m2m = {
43284323
.format_group = &snr_m2m_uncore_format_group,
43294324
};
43304325

4331-
static struct intel_uncore_type snr_uncore_pcie3 = {
4332-
.name = "pcie3",
4333-
.num_counters = 4,
4334-
.num_boxes = 1,
4335-
.perf_ctr_bits = 48,
4336-
.perf_ctr = SNR_PCIE3_PCI_PMON_CTR0,
4337-
.event_ctl = SNR_PCIE3_PCI_PMON_CTL0,
4338-
.event_mask = SNBEP_PMON_RAW_EVENT_MASK,
4339-
.box_ctl = SNR_PCIE3_PCI_PMON_BOX_CTL,
4340-
.ops = &ivbep_uncore_pci_ops,
4341-
.format_group = &ivbep_uncore_format_group,
4342-
};
4343-
43444326
enum {
43454327
SNR_PCI_UNCORE_M2M,
4346-
SNR_PCI_UNCORE_PCIE3,
43474328
};
43484329

43494330
static struct intel_uncore_type *snr_pci_uncores[] = {
43504331
[SNR_PCI_UNCORE_M2M] = &snr_uncore_m2m,
4351-
[SNR_PCI_UNCORE_PCIE3] = &snr_uncore_pcie3,
43524332
NULL,
43534333
};
43544334

@@ -4357,10 +4337,6 @@ static const struct pci_device_id snr_uncore_pci_ids[] = {
43574337
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x344a),
43584338
.driver_data = UNCORE_PCI_DEV_FULL_DATA(12, 0, SNR_PCI_UNCORE_M2M, 0),
43594339
},
4360-
{ /* PCIe3 */
4361-
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x334a),
4362-
.driver_data = UNCORE_PCI_DEV_FULL_DATA(4, 0, SNR_PCI_UNCORE_PCIE3, 0),
4363-
},
43644340
{ /* end: all zeroes */ }
43654341
};
43664342

@@ -4536,6 +4512,7 @@ static struct uncore_event_desc snr_uncore_imc_freerunning_events[] = {
45364512
INTEL_UNCORE_EVENT_DESC(write, "event=0xff,umask=0x21"),
45374513
INTEL_UNCORE_EVENT_DESC(write.scale, "3.814697266e-6"),
45384514
INTEL_UNCORE_EVENT_DESC(write.unit, "MiB"),
4515+
{ /* end: all zeroes */ },
45394516
};
45404517

45414518
static struct intel_uncore_ops snr_uncore_imc_freerunning_ops = {

kernel/events/core.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11465,8 +11465,10 @@ SYSCALL_DEFINE5(perf_event_open,
1146511465
}
1146611466
}
1146711467

11468-
if (perf_need_aux_event(event) && !perf_get_aux_event(event, group_leader))
11468+
if (perf_need_aux_event(event) && !perf_get_aux_event(event, group_leader)) {
11469+
err = -EINVAL;
1146911470
goto err_locked;
11471+
}
1147011472

1147111473
/*
1147211474
* Must be under the same ctx::mutex as perf_install_in_context(),

tools/lib/traceevent/parse-filter.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1228,8 +1228,10 @@ filter_event(struct tep_event_filter *filter, struct tep_event *event,
12281228
}
12291229

12301230
filter_type = add_filter_type(filter, event->id);
1231-
if (filter_type == NULL)
1231+
if (filter_type == NULL) {
1232+
free_arg(arg);
12321233
return TEP_ERRNO__MEM_ALLOC_FAILED;
1234+
}
12331235

12341236
if (filter_type->filter)
12351237
free_arg(filter_type->filter);

tools/perf/builtin-report.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,7 @@ int cmd_report(int argc, const char **argv)
10761076
struct stat st;
10771077
bool has_br_stack = false;
10781078
int branch_mode = -1;
1079+
int last_key = 0;
10791080
bool branch_call_mode = false;
10801081
#define CALLCHAIN_DEFAULT_OPT "graph,0.5,caller,function,percent"
10811082
static const char report_callchain_help[] = "Display call graph (stack chain/backtrace):\n\n"
@@ -1450,7 +1451,8 @@ int cmd_report(int argc, const char **argv)
14501451
sort_order = sort_tmp;
14511452
}
14521453

1453-
if (setup_sorting(session->evlist) < 0) {
1454+
if ((last_key != K_SWITCH_INPUT_DATA) &&
1455+
(setup_sorting(session->evlist) < 0)) {
14541456
if (sort_order)
14551457
parse_options_usage(report_usage, options, "s", 1);
14561458
if (field_order)
@@ -1530,6 +1532,7 @@ int cmd_report(int argc, const char **argv)
15301532
ret = __cmd_report(&report);
15311533
if (ret == K_SWITCH_INPUT_DATA) {
15321534
perf_session__delete(session);
1535+
last_key = K_SWITCH_INPUT_DATA;
15331536
goto repeat;
15341537
} else
15351538
ret = 0;

tools/perf/util/hist.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,10 @@ static inline void perf_hpp__prepend_sort_field(struct perf_hpp_fmt *format)
339339
list_for_each_entry_safe(format, tmp, &(_list)->sorts, sort_list)
340340

341341
#define hists__for_each_format(hists, format) \
342-
perf_hpp_list__for_each_format((hists)->hpp_list, fmt)
342+
perf_hpp_list__for_each_format((hists)->hpp_list, format)
343343

344344
#define hists__for_each_sort_list(hists, format) \
345-
perf_hpp_list__for_each_sort_list((hists)->hpp_list, fmt)
345+
perf_hpp_list__for_each_sort_list((hists)->hpp_list, format)
346346

347347
extern struct perf_hpp_fmt perf_hpp__format[];
348348

tools/perf/util/symbol-elf.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,9 @@ static int dso__process_kernel_symbol(struct dso *dso, struct map *map,
920920
if (curr_map == NULL)
921921
return -1;
922922

923+
if (curr_dso->kernel)
924+
map__kmap(curr_map)->kmaps = kmaps;
925+
923926
if (adjust_kernel_syms) {
924927
curr_map->start = shdr->sh_addr + ref_reloc(kmap);
925928
curr_map->end = curr_map->start + shdr->sh_size;

0 commit comments

Comments
 (0)