Skip to content

Commit 9b00eb8

Browse files
committed
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Ingo writes: "perf fixes: Misc perf tooling fixes." * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf tools: Stop fallbacking to kallsyms for vdso symbols lookup perf tools: Pass build flags to traceevent build perf report: Don't crash on invalid inline debug information perf cpu_map: Align cpu map synthesized events properly. perf tools: Fix tracing_path_mount proper path perf tools: Fix use of alternatives to find JDIR perf evsel: Store ids for events with their own cpus perf_event__synthesize_event_update_cpus perf vendor events intel: Fix wrong filter_band* values for uncore events Revert "perf tools: Fix PMU term format max value calculation" tools headers uapi: Sync kvm.h copy tools arch uapi: Sync the x86 kvm.h copy
2 parents 270b77a + 20e8e72 commit 9b00eb8

File tree

12 files changed

+39
-45
lines changed

12 files changed

+39
-45
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ struct kvm_sync_regs {
377377

378378
#define KVM_X86_QUIRK_LINT0_REENABLED (1 << 0)
379379
#define KVM_X86_QUIRK_CD_NW_CLEARED (1 << 1)
380+
#define KVM_X86_QUIRK_LAPIC_MMIO_HOLE (1 << 2)
380381

381382
#define KVM_STATE_NESTED_GUEST_MODE 0x00000001
382383
#define KVM_STATE_NESTED_RUN_PENDING 0x00000002

tools/include/uapi/linux/kvm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,7 @@ struct kvm_ppc_resize_hpt {
952952
#define KVM_CAP_S390_HPAGE_1M 156
953953
#define KVM_CAP_NESTED_STATE 157
954954
#define KVM_CAP_ARM_INJECT_SERROR_ESR 158
955+
#define KVM_CAP_MSR_PLATFORM_INFO 159
955956

956957
#ifdef KVM_CAP_IRQ_ROUTING
957958

tools/lib/api/fs/tracing_path.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static const char *tracing_path_tracefs_mount(void)
3636

3737
__tracing_path_set("", mnt);
3838

39-
return mnt;
39+
return tracing_path;
4040
}
4141

4242
static const char *tracing_path_debugfs_mount(void)
@@ -49,7 +49,7 @@ static const char *tracing_path_debugfs_mount(void)
4949

5050
__tracing_path_set("tracing/", mnt);
5151

52-
return mnt;
52+
return tracing_path;
5353
}
5454

5555
const char *tracing_path_mount(void)

tools/perf/Makefile.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ ifndef NO_JVMTI
833833
JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | awk '{print $$3}')
834834
else
835835
ifneq (,$(wildcard /usr/sbin/alternatives))
836-
JDIR=$(shell alternatives --display java | tail -1 | cut -d' ' -f 5 | sed 's%/jre/bin/java.%%g')
836+
JDIR=$(shell /usr/sbin/alternatives --display java | tail -1 | cut -d' ' -f 5 | sed 's%/jre/bin/java.%%g')
837837
endif
838838
endif
839839
ifndef JDIR

tools/perf/Makefile.perf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ $(LIBPERF_IN): prepare FORCE
635635
$(LIB_FILE): $(LIBPERF_IN)
636636
$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN) $(LIB_OBJS)
637637

638-
LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ)
638+
LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS)' 'LDFLAGS=$(LDFLAGS)'
639639

640640
$(LIBTRACEEVENT): FORCE
641641
$(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) $(OUTPUT)libtraceevent.a

tools/perf/builtin-report.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,7 @@ int cmd_report(int argc, const char **argv)
981981
.id_index = perf_event__process_id_index,
982982
.auxtrace_info = perf_event__process_auxtrace_info,
983983
.auxtrace = perf_event__process_auxtrace,
984+
.event_update = perf_event__process_event_update,
984985
.feature = process_feature_event,
985986
.ordered_events = true,
986987
.ordering_requires_timestamps = true,

tools/perf/pmu-events/arch/x86/ivytown/uncore-power.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@
188188
"Counter": "0,1,2,3",
189189
"EventCode": "0xb",
190190
"EventName": "UNC_P_FREQ_GE_1200MHZ_CYCLES",
191-
"Filter": "filter_band0=1200",
191+
"Filter": "filter_band0=12",
192192
"MetricExpr": "(UNC_P_FREQ_GE_1200MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
193193
"MetricName": "freq_ge_1200mhz_cycles %",
194194
"PerPkg": "1",
@@ -199,7 +199,7 @@
199199
"Counter": "0,1,2,3",
200200
"EventCode": "0xc",
201201
"EventName": "UNC_P_FREQ_GE_2000MHZ_CYCLES",
202-
"Filter": "filter_band1=2000",
202+
"Filter": "filter_band1=20",
203203
"MetricExpr": "(UNC_P_FREQ_GE_2000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
204204
"MetricName": "freq_ge_2000mhz_cycles %",
205205
"PerPkg": "1",
@@ -210,7 +210,7 @@
210210
"Counter": "0,1,2,3",
211211
"EventCode": "0xd",
212212
"EventName": "UNC_P_FREQ_GE_3000MHZ_CYCLES",
213-
"Filter": "filter_band2=3000",
213+
"Filter": "filter_band2=30",
214214
"MetricExpr": "(UNC_P_FREQ_GE_3000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
215215
"MetricName": "freq_ge_3000mhz_cycles %",
216216
"PerPkg": "1",
@@ -221,7 +221,7 @@
221221
"Counter": "0,1,2,3",
222222
"EventCode": "0xe",
223223
"EventName": "UNC_P_FREQ_GE_4000MHZ_CYCLES",
224-
"Filter": "filter_band3=4000",
224+
"Filter": "filter_band3=40",
225225
"MetricExpr": "(UNC_P_FREQ_GE_4000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
226226
"MetricName": "freq_ge_4000mhz_cycles %",
227227
"PerPkg": "1",
@@ -232,7 +232,7 @@
232232
"Counter": "0,1,2,3",
233233
"EventCode": "0xb",
234234
"EventName": "UNC_P_FREQ_GE_1200MHZ_TRANSITIONS",
235-
"Filter": "edge=1,filter_band0=1200",
235+
"Filter": "edge=1,filter_band0=12",
236236
"MetricExpr": "(UNC_P_FREQ_GE_1200MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
237237
"MetricName": "freq_ge_1200mhz_cycles %",
238238
"PerPkg": "1",
@@ -243,7 +243,7 @@
243243
"Counter": "0,1,2,3",
244244
"EventCode": "0xc",
245245
"EventName": "UNC_P_FREQ_GE_2000MHZ_TRANSITIONS",
246-
"Filter": "edge=1,filter_band1=2000",
246+
"Filter": "edge=1,filter_band1=20",
247247
"MetricExpr": "(UNC_P_FREQ_GE_2000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
248248
"MetricName": "freq_ge_2000mhz_cycles %",
249249
"PerPkg": "1",
@@ -254,7 +254,7 @@
254254
"Counter": "0,1,2,3",
255255
"EventCode": "0xd",
256256
"EventName": "UNC_P_FREQ_GE_3000MHZ_TRANSITIONS",
257-
"Filter": "edge=1,filter_band2=4000",
257+
"Filter": "edge=1,filter_band2=30",
258258
"MetricExpr": "(UNC_P_FREQ_GE_3000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
259259
"MetricName": "freq_ge_3000mhz_cycles %",
260260
"PerPkg": "1",
@@ -265,7 +265,7 @@
265265
"Counter": "0,1,2,3",
266266
"EventCode": "0xe",
267267
"EventName": "UNC_P_FREQ_GE_4000MHZ_TRANSITIONS",
268-
"Filter": "edge=1,filter_band3=4000",
268+
"Filter": "edge=1,filter_band3=40",
269269
"MetricExpr": "(UNC_P_FREQ_GE_4000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
270270
"MetricName": "freq_ge_4000mhz_cycles %",
271271
"PerPkg": "1",

tools/perf/pmu-events/arch/x86/jaketown/uncore-power.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
"Counter": "0,1,2,3",
188188
"EventCode": "0xb",
189189
"EventName": "UNC_P_FREQ_GE_1200MHZ_CYCLES",
190-
"Filter": "filter_band0=1200",
190+
"Filter": "filter_band0=12",
191191
"MetricExpr": "(UNC_P_FREQ_GE_1200MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
192192
"MetricName": "freq_ge_1200mhz_cycles %",
193193
"PerPkg": "1",
@@ -198,7 +198,7 @@
198198
"Counter": "0,1,2,3",
199199
"EventCode": "0xc",
200200
"EventName": "UNC_P_FREQ_GE_2000MHZ_CYCLES",
201-
"Filter": "filter_band1=2000",
201+
"Filter": "filter_band1=20",
202202
"MetricExpr": "(UNC_P_FREQ_GE_2000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
203203
"MetricName": "freq_ge_2000mhz_cycles %",
204204
"PerPkg": "1",
@@ -209,7 +209,7 @@
209209
"Counter": "0,1,2,3",
210210
"EventCode": "0xd",
211211
"EventName": "UNC_P_FREQ_GE_3000MHZ_CYCLES",
212-
"Filter": "filter_band2=3000",
212+
"Filter": "filter_band2=30",
213213
"MetricExpr": "(UNC_P_FREQ_GE_3000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
214214
"MetricName": "freq_ge_3000mhz_cycles %",
215215
"PerPkg": "1",
@@ -220,7 +220,7 @@
220220
"Counter": "0,1,2,3",
221221
"EventCode": "0xe",
222222
"EventName": "UNC_P_FREQ_GE_4000MHZ_CYCLES",
223-
"Filter": "filter_band3=4000",
223+
"Filter": "filter_band3=40",
224224
"MetricExpr": "(UNC_P_FREQ_GE_4000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
225225
"MetricName": "freq_ge_4000mhz_cycles %",
226226
"PerPkg": "1",
@@ -231,7 +231,7 @@
231231
"Counter": "0,1,2,3",
232232
"EventCode": "0xb",
233233
"EventName": "UNC_P_FREQ_GE_1200MHZ_TRANSITIONS",
234-
"Filter": "edge=1,filter_band0=1200",
234+
"Filter": "edge=1,filter_band0=12",
235235
"MetricExpr": "(UNC_P_FREQ_GE_1200MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
236236
"MetricName": "freq_ge_1200mhz_cycles %",
237237
"PerPkg": "1",
@@ -242,7 +242,7 @@
242242
"Counter": "0,1,2,3",
243243
"EventCode": "0xc",
244244
"EventName": "UNC_P_FREQ_GE_2000MHZ_TRANSITIONS",
245-
"Filter": "edge=1,filter_band1=2000",
245+
"Filter": "edge=1,filter_band1=20",
246246
"MetricExpr": "(UNC_P_FREQ_GE_2000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
247247
"MetricName": "freq_ge_2000mhz_cycles %",
248248
"PerPkg": "1",
@@ -253,7 +253,7 @@
253253
"Counter": "0,1,2,3",
254254
"EventCode": "0xd",
255255
"EventName": "UNC_P_FREQ_GE_3000MHZ_TRANSITIONS",
256-
"Filter": "edge=1,filter_band2=4000",
256+
"Filter": "edge=1,filter_band2=30",
257257
"MetricExpr": "(UNC_P_FREQ_GE_3000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
258258
"MetricName": "freq_ge_3000mhz_cycles %",
259259
"PerPkg": "1",
@@ -264,7 +264,7 @@
264264
"Counter": "0,1,2,3",
265265
"EventCode": "0xe",
266266
"EventName": "UNC_P_FREQ_GE_4000MHZ_TRANSITIONS",
267-
"Filter": "edge=1,filter_band3=4000",
267+
"Filter": "edge=1,filter_band3=40",
268268
"MetricExpr": "(UNC_P_FREQ_GE_4000MHZ_CYCLES / UNC_P_CLOCKTICKS) * 100.",
269269
"MetricName": "freq_ge_4000mhz_cycles %",
270270
"PerPkg": "1",

tools/perf/util/event.c

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,7 @@ void *cpu_map_data__alloc(struct cpu_map *map, size_t *size, u16 *type, int *max
10811081
}
10821082

10831083
*size += sizeof(struct cpu_map_data);
1084+
*size = PERF_ALIGN(*size, sizeof(u64));
10841085
return zalloc(*size);
10851086
}
10861087

@@ -1560,26 +1561,9 @@ struct map *thread__find_map(struct thread *thread, u8 cpumode, u64 addr,
15601561

15611562
return NULL;
15621563
}
1563-
try_again:
1564+
15641565
al->map = map_groups__find(mg, al->addr);
1565-
if (al->map == NULL) {
1566-
/*
1567-
* If this is outside of all known maps, and is a negative
1568-
* address, try to look it up in the kernel dso, as it might be
1569-
* a vsyscall or vdso (which executes in user-mode).
1570-
*
1571-
* XXX This is nasty, we should have a symbol list in the
1572-
* "[vdso]" dso, but for now lets use the old trick of looking
1573-
* in the whole kernel symbol list.
1574-
*/
1575-
if (cpumode == PERF_RECORD_MISC_USER && machine &&
1576-
mg != &machine->kmaps &&
1577-
machine__kernel_ip(machine, al->addr)) {
1578-
mg = &machine->kmaps;
1579-
load_map = true;
1580-
goto try_again;
1581-
}
1582-
} else {
1566+
if (al->map != NULL) {
15831567
/*
15841568
* Kernel maps might be changed when loading symbols so loading
15851569
* must be done prior to using kernel maps.

tools/perf/util/evsel.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,9 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts,
10891089
attr->exclude_user = 1;
10901090
}
10911091

1092+
if (evsel->own_cpus)
1093+
evsel->attr.read_format |= PERF_FORMAT_ID;
1094+
10921095
/*
10931096
* Apply event specific term settings,
10941097
* it overloads any global configuration.

tools/perf/util/pmu.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -930,13 +930,14 @@ static void pmu_format_value(unsigned long *format, __u64 value, __u64 *v,
930930

931931
static __u64 pmu_format_max_value(const unsigned long *format)
932932
{
933-
__u64 w = 0;
934-
int fbit;
935-
936-
for_each_set_bit(fbit, format, PERF_PMU_FORMAT_BITS)
937-
w |= (1ULL << fbit);
933+
int w;
938934

939-
return w;
935+
w = bitmap_weight(format, PERF_PMU_FORMAT_BITS);
936+
if (!w)
937+
return 0;
938+
if (w < 64)
939+
return (1ULL << w) - 1;
940+
return -1;
940941
}
941942

942943
/*

tools/perf/util/srcline.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ static struct symbol *new_inline_sym(struct dso *dso,
8585
struct symbol *inline_sym;
8686
char *demangled = NULL;
8787

88+
if (!funcname)
89+
funcname = "??";
90+
8891
if (dso) {
8992
demangled = dso__demangle_sym(dso, 0, funcname);
9093
if (demangled)

0 commit comments

Comments
 (0)