Skip to content

Commit 975e32c

Browse files
committed
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf: Do no try to schedule task events if there are none lockdep, kmemcheck: Annotate ->lock in lockdep_init_map() perf header: Use event_name() to get an event name perf stat: Failure with "Operation not supported"
2 parents 031af16 + 167e33c commit 975e32c

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

kernel/events/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2174,11 +2174,11 @@ static void perf_event_context_sched_in(struct perf_event_context *ctx,
21742174
*/
21752175
cpu_ctx_sched_out(cpuctx, EVENT_FLEXIBLE);
21762176

2177-
perf_event_sched_in(cpuctx, ctx, task);
2178-
21792177
if (ctx->nr_events)
21802178
cpuctx->task_ctx = ctx;
21812179

2180+
perf_event_sched_in(cpuctx, cpuctx->task_ctx, task);
2181+
21822182
perf_pmu_enable(ctx->pmu);
21832183
perf_ctx_unlock(cpuctx, ctx);
21842184

kernel/lockdep.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include <linux/stringify.h>
4545
#include <linux/bitops.h>
4646
#include <linux/gfp.h>
47+
#include <linux/kmemcheck.h>
4748

4849
#include <asm/sections.h>
4950

@@ -2948,7 +2949,12 @@ static int mark_lock(struct task_struct *curr, struct held_lock *this,
29482949
void lockdep_init_map(struct lockdep_map *lock, const char *name,
29492950
struct lock_class_key *key, int subclass)
29502951
{
2951-
memset(lock, 0, sizeof(*lock));
2952+
int i;
2953+
2954+
kmemcheck_mark_initialized(lock, sizeof(*lock));
2955+
2956+
for (i = 0; i < NR_LOCKDEP_CACHING_CLASSES; i++)
2957+
lock->class_cache[i] = NULL;
29522958

29532959
#ifdef CONFIG_LOCK_STAT
29542960
lock->cpu = raw_smp_processor_id();

tools/perf/builtin-stat.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,8 @@ static int run_perf_stat(int argc __used, const char **argv)
463463

464464
list_for_each_entry(counter, &evsel_list->entries, node) {
465465
if (create_perf_stat_counter(counter, first) < 0) {
466-
if (errno == EINVAL || errno == ENOSYS || errno == ENOENT) {
466+
if (errno == EINVAL || errno == ENOSYS ||
467+
errno == ENOENT || errno == EOPNOTSUPP) {
467468
if (verbose)
468469
ui__warning("%s event is not supported by the kernel.\n",
469470
event_name(counter));

tools/perf/util/header.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ static int write_event_desc(int fd, struct perf_header *h __used,
388388
/*
389389
* write event string as passed on cmdline
390390
*/
391-
ret = do_write_string(fd, attr->name);
391+
ret = do_write_string(fd, event_name(attr));
392392
if (ret < 0)
393393
return ret;
394394
/*

0 commit comments

Comments
 (0)