Skip to content

Commit 75acebf

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: "Various fixes. The -g perf report lockup you reported is only partially addressed, patches that fix the excessive runtime are still being worked on" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86: Fix uncore PCI fixed counter handling uprobes: Fix utask->depth accounting in handle_trampoline() perf/x86: Add constraint for IVB CYCLE_ACTIVITY:CYCLES_LDM_PENDING perf: Fix up MMAP2 buffer space reservation perf tools: Add attr->mmap2 support perf kvm: Fix sample_type manipulation perf evlist: Fix id pos in perf_evlist__open() perf trace: Handle perf.data files with no tracepoints perf session: Separate progress bar update when processing events perf trace: Check if MAP_32BIT is defined perf hists: Fix formatting of long symbol names perf evlist: Fix parsing with no sample_id_all bit set perf tools: Add test for parsing with no sample_id_all bit perf trace: Check control+C more often
2 parents b55ee28 + dbc33f7 commit 75acebf

29 files changed

Lines changed: 381 additions & 82 deletions

‎arch/x86/kernel/cpu/perf_event_intel.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ static struct event_constraint intel_ivb_event_constraints[] __read_mostly =
124124
INTEL_UEVENT_CONSTRAINT(0x0148, 0x4), /* L1D_PEND_MISS.PENDING */
125125
INTEL_UEVENT_CONSTRAINT(0x0279, 0xf), /* IDQ.EMTPY */
126126
INTEL_UEVENT_CONSTRAINT(0x019c, 0xf), /* IDQ_UOPS_NOT_DELIVERED.CORE */
127+
INTEL_UEVENT_CONSTRAINT(0x02a3, 0xf), /* CYCLE_ACTIVITY.CYCLES_LDM_PENDING */
127128
INTEL_UEVENT_CONSTRAINT(0x04a3, 0xf), /* CYCLE_ACTIVITY.CYCLES_NO_EXECUTE */
128129
INTEL_UEVENT_CONSTRAINT(0x05a3, 0xf), /* CYCLE_ACTIVITY.STALLS_L2_PENDING */
129130
INTEL_UEVENT_CONSTRAINT(0x06a3, 0xf), /* CYCLE_ACTIVITY.STALLS_LDM_PENDING */

‎arch/x86/kernel/cpu/perf_event_intel_uncore.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2808,7 +2808,7 @@ uncore_get_event_constraint(struct intel_uncore_box *box, struct perf_event *eve
28082808
return c;
28092809
}
28102810

2811-
if (event->hw.config == ~0ULL)
2811+
if (event->attr.config == UNCORE_FIXED_EVENT)
28122812
return &constraint_fixed;
28132813

28142814
if (type->constraints) {
@@ -3112,7 +3112,9 @@ static int uncore_pmu_event_init(struct perf_event *event)
31123112
*/
31133113
if (pmu->type->single_fixed && pmu->pmu_idx > 0)
31143114
return -EINVAL;
3115-
hwc->config = ~0ULL;
3115+
3116+
/* fixed counters have event field hardcoded to zero */
3117+
hwc->config = 0ULL;
31163118
} else {
31173119
hwc->config = event->attr.config & pmu->type->event_mask;
31183120
if (pmu->type->ops->hw_config) {

‎kernel/events/core.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5039,6 +5039,7 @@ static void perf_event_mmap_output(struct perf_event *event,
50395039
mmap_event->event_id.header.size += sizeof(mmap_event->maj);
50405040
mmap_event->event_id.header.size += sizeof(mmap_event->min);
50415041
mmap_event->event_id.header.size += sizeof(mmap_event->ino);
5042+
mmap_event->event_id.header.size += sizeof(mmap_event->ino_generation);
50425043
}
50435044

50445045
perf_event_header__init_id(&mmap_event->event_id.header, &sample, event);

‎kernel/events/uprobes.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,12 +1682,10 @@ static bool handle_trampoline(struct pt_regs *regs)
16821682
tmp = ri;
16831683
ri = ri->next;
16841684
kfree(tmp);
1685+
utask->depth--;
16851686

16861687
if (!chained)
16871688
break;
1688-
1689-
utask->depth--;
1690-
16911689
BUG_ON(!ri);
16921690
}
16931691

‎tools/perf/Makefile‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,8 @@ ifeq ($(ARCH),x86)
394394
LIB_OBJS += $(OUTPUT)tests/perf-time-to-tsc.o
395395
endif
396396
LIB_OBJS += $(OUTPUT)tests/code-reading.o
397+
LIB_OBJS += $(OUTPUT)tests/sample-parsing.o
398+
LIB_OBJS += $(OUTPUT)tests/parse-no-sample-id-all.o
397399

398400
BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
399401
BUILTIN_OBJS += $(OUTPUT)builtin-bench.o
@@ -439,7 +441,6 @@ PERFLIBS = $(LIB_FILE) $(LIBLK) $(LIBTRACEEVENT)
439441
ifneq ($(OUTPUT),)
440442
CFLAGS += -I$(OUTPUT)
441443
endif
442-
LIB_OBJS += $(OUTPUT)tests/sample-parsing.o
443444

444445
ifdef NO_LIBELF
445446
EXTLIBS := $(filter-out -lelf,$(EXTLIBS))

‎tools/perf/builtin-annotate.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused)
277277
.tool = {
278278
.sample = process_sample_event,
279279
.mmap = perf_event__process_mmap,
280+
.mmap2 = perf_event__process_mmap2,
280281
.comm = perf_event__process_comm,
281282
.exit = perf_event__process_exit,
282283
.fork = perf_event__process_fork,

‎tools/perf/builtin-inject.c‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,19 @@ static int perf_event__repipe_mmap(struct perf_tool *tool,
123123
return err;
124124
}
125125

126+
static int perf_event__repipe_mmap2(struct perf_tool *tool,
127+
union perf_event *event,
128+
struct perf_sample *sample,
129+
struct machine *machine)
130+
{
131+
int err;
132+
133+
err = perf_event__process_mmap2(tool, event, sample, machine);
134+
perf_event__repipe(tool, event, sample, machine);
135+
136+
return err;
137+
}
138+
126139
static int perf_event__repipe_fork(struct perf_tool *tool,
127140
union perf_event *event,
128141
struct perf_sample *sample,
@@ -339,6 +352,7 @@ static int __cmd_inject(struct perf_inject *inject)
339352

340353
if (inject->build_ids || inject->sched_stat) {
341354
inject->tool.mmap = perf_event__repipe_mmap;
355+
inject->tool.mmap2 = perf_event__repipe_mmap2;
342356
inject->tool.fork = perf_event__repipe_fork;
343357
inject->tool.tracing_data = perf_event__repipe_tracing_data;
344358
}
@@ -390,6 +404,7 @@ int cmd_inject(int argc, const char **argv, const char *prefix __maybe_unused)
390404
.tool = {
391405
.sample = perf_event__repipe_sample,
392406
.mmap = perf_event__repipe,
407+
.mmap2 = perf_event__repipe,
393408
.comm = perf_event__repipe,
394409
.fork = perf_event__repipe,
395410
.exit = perf_event__repipe,

‎tools/perf/builtin-kvm.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,16 +1165,16 @@ static int kvm_live_open_events(struct perf_kvm_stat *kvm)
11651165
struct perf_event_attr *attr = &pos->attr;
11661166

11671167
/* make sure these *are* set */
1168-
attr->sample_type |= PERF_SAMPLE_TID;
1169-
attr->sample_type |= PERF_SAMPLE_TIME;
1170-
attr->sample_type |= PERF_SAMPLE_CPU;
1171-
attr->sample_type |= PERF_SAMPLE_RAW;
1168+
perf_evsel__set_sample_bit(pos, TID);
1169+
perf_evsel__set_sample_bit(pos, TIME);
1170+
perf_evsel__set_sample_bit(pos, CPU);
1171+
perf_evsel__set_sample_bit(pos, RAW);
11721172
/* make sure these are *not*; want as small a sample as possible */
1173-
attr->sample_type &= ~PERF_SAMPLE_PERIOD;
1174-
attr->sample_type &= ~PERF_SAMPLE_IP;
1175-
attr->sample_type &= ~PERF_SAMPLE_CALLCHAIN;
1176-
attr->sample_type &= ~PERF_SAMPLE_ADDR;
1177-
attr->sample_type &= ~PERF_SAMPLE_READ;
1173+
perf_evsel__reset_sample_bit(pos, PERIOD);
1174+
perf_evsel__reset_sample_bit(pos, IP);
1175+
perf_evsel__reset_sample_bit(pos, CALLCHAIN);
1176+
perf_evsel__reset_sample_bit(pos, ADDR);
1177+
perf_evsel__reset_sample_bit(pos, READ);
11781178
attr->mmap = 0;
11791179
attr->comm = 0;
11801180
attr->task = 0;

‎tools/perf/builtin-mem.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ int cmd_mem(int argc, const char **argv, const char *prefix __maybe_unused)
190190
.tool = {
191191
.sample = process_sample_event,
192192
.mmap = perf_event__process_mmap,
193+
.mmap2 = perf_event__process_mmap2,
193194
.comm = perf_event__process_comm,
194195
.lost = perf_event__process_lost,
195196
.fork = perf_event__process_fork,

‎tools/perf/builtin-report.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
744744
.tool = {
745745
.sample = process_sample_event,
746746
.mmap = perf_event__process_mmap,
747+
.mmap2 = perf_event__process_mmap2,
747748
.comm = perf_event__process_comm,
748749
.exit = perf_event__process_exit,
749750
.fork = perf_event__process_fork,

0 commit comments

Comments
 (0)