Skip to content

Commit 203b660

Browse files
committed
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf updates from Ingo Molnar: "Lots of tooling updates - too many to list, here's a few highlights: - Various subcommand updates to 'perf trace', 'perf report', 'perf record', 'perf annotate', 'perf script', 'perf test', etc. - CPU and NUMA topology and affinity handling improvements, - HW tracing and HW support updates: - Intel PT updates - ARM CoreSight updates - vendor HW event updates - BPF updates - Tons of infrastructure updates, both on the build system and the library support side - Documentation updates. - ... and lots of other changes, see the changelog for details. Kernel side updates: - Tighten up kprobes blacklist handling, reduce the number of places where developers can install a kprobe and hang/crash the system. - Fix/enhance vma address filter handling. - Various PMU driver updates, small fixes and additions. - refcount_t conversions - BPF updates - error code propagation enhancements - misc other changes" * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (238 commits) perf script python: Add Python3 support to syscall-counts-by-pid.py perf script python: Add Python3 support to syscall-counts.py perf script python: Add Python3 support to stat-cpi.py perf script python: Add Python3 support to stackcollapse.py perf script python: Add Python3 support to sctop.py perf script python: Add Python3 support to powerpc-hcalls.py perf script python: Add Python3 support to net_dropmonitor.py perf script python: Add Python3 support to mem-phys-addr.py perf script python: Add Python3 support to failed-syscalls-by-pid.py perf script python: Add Python3 support to netdev-times.py perf tools: Add perf_exe() helper to find perf binary perf script: Handle missing fields with -F +.. perf data: Add perf_data__open_dir_data function perf data: Add perf_data__(create_dir|close_dir) functions perf data: Fail check_backup in case of error perf data: Make check_backup work over directories perf tools: Add rm_rf_perf_data function perf tools: Add pattern name checking to rm_rf perf tools: Add depth checking to rm_rf perf data: Add global path holder ...
2 parents 3478588 + c978b94 commit 203b660

File tree

315 files changed

+10259
-2608
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

315 files changed

+10259
-2608
lines changed

arch/alpha/kernel/perf_event.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -630,12 +630,6 @@ static int __hw_perf_event_init(struct perf_event *event)
630630
return ev;
631631
}
632632

633-
/* The EV67 does not support mode exclusion */
634-
if (attr->exclude_kernel || attr->exclude_user
635-
|| attr->exclude_hv || attr->exclude_idle) {
636-
return -EPERM;
637-
}
638-
639633
/*
640634
* We place the event type in event_base here and leave calculation
641635
* of the codes to programme the PMU for alpha_pmu_enable() because
@@ -771,6 +765,7 @@ static struct pmu pmu = {
771765
.start = alpha_pmu_start,
772766
.stop = alpha_pmu_stop,
773767
.read = alpha_pmu_read,
768+
.capabilities = PERF_PMU_CAP_NO_EXCLUDE,
774769
};
775770

776771

arch/arm/mach-imx/mmdc.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -294,13 +294,7 @@ static int mmdc_pmu_event_init(struct perf_event *event)
294294
return -EOPNOTSUPP;
295295
}
296296

297-
if (event->attr.exclude_user ||
298-
event->attr.exclude_kernel ||
299-
event->attr.exclude_hv ||
300-
event->attr.exclude_idle ||
301-
event->attr.exclude_host ||
302-
event->attr.exclude_guest ||
303-
event->attr.sample_period)
297+
if (event->attr.sample_period)
304298
return -EINVAL;
305299

306300
if (cfg < 0 || cfg >= MMDC_NUM_COUNTERS)
@@ -456,6 +450,7 @@ static int mmdc_pmu_init(struct mmdc_pmu *pmu_mmdc,
456450
.start = mmdc_pmu_event_start,
457451
.stop = mmdc_pmu_event_stop,
458452
.read = mmdc_pmu_event_update,
453+
.capabilities = PERF_PMU_CAP_NO_EXCLUDE,
459454
},
460455
.mmdc_base = mmdc_base,
461456
.dev = dev,

arch/arm/mm/cache-l2x0-pmu.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -314,14 +314,6 @@ static int l2x0_pmu_event_init(struct perf_event *event)
314314
event->attach_state & PERF_ATTACH_TASK)
315315
return -EINVAL;
316316

317-
if (event->attr.exclude_user ||
318-
event->attr.exclude_kernel ||
319-
event->attr.exclude_hv ||
320-
event->attr.exclude_idle ||
321-
event->attr.exclude_host ||
322-
event->attr.exclude_guest)
323-
return -EINVAL;
324-
325317
if (event->cpu < 0)
326318
return -EINVAL;
327319

@@ -544,6 +536,7 @@ static __init int l2x0_pmu_init(void)
544536
.del = l2x0_pmu_event_del,
545537
.event_init = l2x0_pmu_event_init,
546538
.attr_groups = l2x0_pmu_attr_groups,
539+
.capabilities = PERF_PMU_CAP_NO_EXCLUDE,
547540
};
548541

549542
l2x0_pmu_reset();

arch/powerpc/perf/hv-24x7.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,15 +1306,6 @@ static int h_24x7_event_init(struct perf_event *event)
13061306
return -EINVAL;
13071307
}
13081308

1309-
/* unsupported modes and filters */
1310-
if (event->attr.exclude_user ||
1311-
event->attr.exclude_kernel ||
1312-
event->attr.exclude_hv ||
1313-
event->attr.exclude_idle ||
1314-
event->attr.exclude_host ||
1315-
event->attr.exclude_guest)
1316-
return -EINVAL;
1317-
13181309
/* no branch sampling */
13191310
if (has_branch_stack(event))
13201311
return -EOPNOTSUPP;
@@ -1577,6 +1568,7 @@ static struct pmu h_24x7_pmu = {
15771568
.start_txn = h_24x7_event_start_txn,
15781569
.commit_txn = h_24x7_event_commit_txn,
15791570
.cancel_txn = h_24x7_event_cancel_txn,
1571+
.capabilities = PERF_PMU_CAP_NO_EXCLUDE,
15801572
};
15811573

15821574
static int hv_24x7_init(void)

arch/powerpc/perf/hv-gpci.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -232,15 +232,6 @@ static int h_gpci_event_init(struct perf_event *event)
232232
return -EINVAL;
233233
}
234234

235-
/* unsupported modes and filters */
236-
if (event->attr.exclude_user ||
237-
event->attr.exclude_kernel ||
238-
event->attr.exclude_hv ||
239-
event->attr.exclude_idle ||
240-
event->attr.exclude_host ||
241-
event->attr.exclude_guest)
242-
return -EINVAL;
243-
244235
/* no branch sampling */
245236
if (has_branch_stack(event))
246237
return -EOPNOTSUPP;
@@ -285,6 +276,7 @@ static struct pmu h_gpci_pmu = {
285276
.start = h_gpci_event_start,
286277
.stop = h_gpci_event_stop,
287278
.read = h_gpci_event_update,
279+
.capabilities = PERF_PMU_CAP_NO_EXCLUDE,
288280
};
289281

290282
static int hv_gpci_init(void)

arch/powerpc/perf/imc-pmu.c

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -473,15 +473,6 @@ static int nest_imc_event_init(struct perf_event *event)
473473
if (event->hw.sample_period)
474474
return -EINVAL;
475475

476-
/* unsupported modes and filters */
477-
if (event->attr.exclude_user ||
478-
event->attr.exclude_kernel ||
479-
event->attr.exclude_hv ||
480-
event->attr.exclude_idle ||
481-
event->attr.exclude_host ||
482-
event->attr.exclude_guest)
483-
return -EINVAL;
484-
485476
if (event->cpu < 0)
486477
return -EINVAL;
487478

@@ -748,15 +739,6 @@ static int core_imc_event_init(struct perf_event *event)
748739
if (event->hw.sample_period)
749740
return -EINVAL;
750741

751-
/* unsupported modes and filters */
752-
if (event->attr.exclude_user ||
753-
event->attr.exclude_kernel ||
754-
event->attr.exclude_hv ||
755-
event->attr.exclude_idle ||
756-
event->attr.exclude_host ||
757-
event->attr.exclude_guest)
758-
return -EINVAL;
759-
760742
if (event->cpu < 0)
761743
return -EINVAL;
762744

@@ -1069,6 +1051,7 @@ static int update_pmu_ops(struct imc_pmu *pmu)
10691051
pmu->pmu.stop = imc_event_stop;
10701052
pmu->pmu.read = imc_event_update;
10711053
pmu->pmu.attr_groups = pmu->attr_groups;
1054+
pmu->pmu.capabilities = PERF_PMU_CAP_NO_EXCLUDE;
10721055
pmu->attr_groups[IMC_FORMAT_ATTR] = &imc_format_group;
10731056

10741057
switch (pmu->domain) {

arch/s390/kernel/perf_cpum_sf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,7 +1600,7 @@ static void aux_sdb_init(unsigned long sdb)
16001600

16011601
/*
16021602
* aux_buffer_setup() - Setup AUX buffer for diagnostic mode sampling
1603-
* @cpu: On which to allocate, -1 means current
1603+
* @event: Event the buffer is setup for, event->cpu == -1 means current
16041604
* @pages: Array of pointers to buffer pages passed from perf core
16051605
* @nr_pages: Total pages
16061606
* @snapshot: Flag for snapshot mode
@@ -1612,8 +1612,8 @@ static void aux_sdb_init(unsigned long sdb)
16121612
*
16131613
* Return the private AUX buffer structure if success or NULL if fails.
16141614
*/
1615-
static void *aux_buffer_setup(int cpu, void **pages, int nr_pages,
1616-
bool snapshot)
1615+
static void *aux_buffer_setup(struct perf_event *event, void **pages,
1616+
int nr_pages, bool snapshot)
16171617
{
16181618
struct sf_buffer *sfb;
16191619
struct aux_buffer *aux;

arch/x86/events/amd/ibs.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -253,15 +253,6 @@ static int perf_ibs_precise_event(struct perf_event *event, u64 *config)
253253
return -EOPNOTSUPP;
254254
}
255255

256-
static const struct perf_event_attr ibs_notsupp = {
257-
.exclude_user = 1,
258-
.exclude_kernel = 1,
259-
.exclude_hv = 1,
260-
.exclude_idle = 1,
261-
.exclude_host = 1,
262-
.exclude_guest = 1,
263-
};
264-
265256
static int perf_ibs_init(struct perf_event *event)
266257
{
267258
struct hw_perf_event *hwc = &event->hw;
@@ -282,9 +273,6 @@ static int perf_ibs_init(struct perf_event *event)
282273
if (event->pmu != &perf_ibs->pmu)
283274
return -ENOENT;
284275

285-
if (perf_flags(&event->attr) & perf_flags(&ibs_notsupp))
286-
return -EINVAL;
287-
288276
if (config & ~perf_ibs->config_mask)
289277
return -EINVAL;
290278

@@ -537,6 +525,7 @@ static struct perf_ibs perf_ibs_fetch = {
537525
.start = perf_ibs_start,
538526
.stop = perf_ibs_stop,
539527
.read = perf_ibs_read,
528+
.capabilities = PERF_PMU_CAP_NO_EXCLUDE,
540529
},
541530
.msr = MSR_AMD64_IBSFETCHCTL,
542531
.config_mask = IBS_FETCH_CONFIG_MASK,

arch/x86/events/amd/iommu.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,6 @@ static int perf_iommu_event_init(struct perf_event *event)
223223
if (is_sampling_event(event) || event->attach_state & PERF_ATTACH_TASK)
224224
return -EINVAL;
225225

226-
/* IOMMU counters do not have usr/os/guest/host bits */
227-
if (event->attr.exclude_user || event->attr.exclude_kernel ||
228-
event->attr.exclude_host || event->attr.exclude_guest)
229-
return -EINVAL;
230-
231226
if (event->cpu < 0)
232227
return -EINVAL;
233228

@@ -414,6 +409,7 @@ static const struct pmu iommu_pmu __initconst = {
414409
.read = perf_iommu_read,
415410
.task_ctx_nr = perf_invalid_context,
416411
.attr_groups = amd_iommu_attr_groups,
412+
.capabilities = PERF_PMU_CAP_NO_EXCLUDE,
417413
};
418414

419415
static __init int init_one_iommu(unsigned int idx)

arch/x86/events/amd/power.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,7 @@ static int pmu_event_init(struct perf_event *event)
136136
return -ENOENT;
137137

138138
/* Unsupported modes and filters. */
139-
if (event->attr.exclude_user ||
140-
event->attr.exclude_kernel ||
141-
event->attr.exclude_hv ||
142-
event->attr.exclude_idle ||
143-
event->attr.exclude_host ||
144-
event->attr.exclude_guest ||
145-
/* no sampling */
146-
event->attr.sample_period)
139+
if (event->attr.sample_period)
147140
return -EINVAL;
148141

149142
if (cfg != AMD_POWER_EVENTSEL_PKG)
@@ -226,6 +219,7 @@ static struct pmu pmu_class = {
226219
.start = pmu_event_start,
227220
.stop = pmu_event_stop,
228221
.read = pmu_event_read,
222+
.capabilities = PERF_PMU_CAP_NO_EXCLUDE,
229223
};
230224

231225
static int power_cpu_exit(unsigned int cpu)

arch/x86/events/amd/uncore.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,6 @@ static int amd_uncore_event_init(struct perf_event *event)
201201
if (is_sampling_event(event) || event->attach_state & PERF_ATTACH_TASK)
202202
return -EINVAL;
203203

204-
/* NB and Last level cache counters do not have usr/os/guest/host bits */
205-
if (event->attr.exclude_user || event->attr.exclude_kernel ||
206-
event->attr.exclude_host || event->attr.exclude_guest)
207-
return -EINVAL;
208-
209204
/* and we do not enable counter overflow interrupts */
210205
hwc->config = event->attr.config & AMD64_RAW_EVENT_MASK_NB;
211206
hwc->idx = -1;
@@ -307,6 +302,7 @@ static struct pmu amd_nb_pmu = {
307302
.start = amd_uncore_start,
308303
.stop = amd_uncore_stop,
309304
.read = amd_uncore_read,
305+
.capabilities = PERF_PMU_CAP_NO_EXCLUDE,
310306
};
311307

312308
static struct pmu amd_llc_pmu = {
@@ -317,6 +313,7 @@ static struct pmu amd_llc_pmu = {
317313
.start = amd_uncore_start,
318314
.stop = amd_uncore_stop,
319315
.read = amd_uncore_read,
316+
.capabilities = PERF_PMU_CAP_NO_EXCLUDE,
320317
};
321318

322319
static struct amd_uncore *amd_uncore_alloc(unsigned int cpu)

arch/x86/events/intel/bts.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,12 @@ static size_t buf_size(struct page *page)
7777
}
7878

7979
static void *
80-
bts_buffer_setup_aux(int cpu, void **pages, int nr_pages, bool overwrite)
80+
bts_buffer_setup_aux(struct perf_event *event, void **pages,
81+
int nr_pages, bool overwrite)
8182
{
8283
struct bts_buffer *buf;
8384
struct page *page;
85+
int cpu = event->cpu;
8486
int node = (cpu == -1) ? cpu : cpu_to_node(cpu);
8587
unsigned long offset;
8688
size_t size = nr_pages << PAGE_SHIFT;

0 commit comments

Comments
 (0)