Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 33726bf2 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'perf-urgent-for-linus' of...

Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  perf: Fix comments in include/linux/perf_event.h
  perf: Comment /proc/sys/kernel/perf_event_paranoid to be part of user ABI
  perf python: Fix argument name list of read_on_cpu()
  perf evlist: Don't die if sample_{id_all|type} is invalid
  perf python: Use exception to propagate errors
  perf evlist: Remove dependency on debug routines
  perf, cgroups: Fix up for new API
parents 5b28f6a2 d7ebe75b
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -137,14 +137,14 @@ enum perf_event_sample_format {
 *
 * struct read_format {
 *	{ u64		value;
 *	  { u64		time_enabled; } && PERF_FORMAT_ENABLED
 *	  { u64		time_running; } && PERF_FORMAT_RUNNING
 *	  { u64		time_enabled; } && PERF_FORMAT_TOTAL_TIME_ENABLED
 *	  { u64		time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING
 *	  { u64		id;           } && PERF_FORMAT_ID
 *	} && !PERF_FORMAT_GROUP
 *
 *	{ u64		nr;
 *	  { u64		time_enabled; } && PERF_FORMAT_ENABLED
 *	  { u64		time_running; } && PERF_FORMAT_RUNNING
 *	  { u64		time_enabled; } && PERF_FORMAT_TOTAL_TIME_ENABLED
 *	  { u64		time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING
 *	  { u64		value;
 *	    { u64	id;           } && PERF_FORMAT_ID
 *	  }		cntr[nr];
+4 −18
Original line number Diff line number Diff line
@@ -7402,26 +7402,12 @@ static int __perf_cgroup_move(void *info)
	return 0;
}

static void perf_cgroup_move(struct task_struct *task)
static void
perf_cgroup_attach_task(struct cgroup *cgrp, struct task_struct *task)
{
	task_function_call(task, __perf_cgroup_move, task);
}

static void perf_cgroup_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
		struct cgroup *old_cgrp, struct task_struct *task,
		bool threadgroup)
{
	perf_cgroup_move(task);
	if (threadgroup) {
		struct task_struct *c;
		rcu_read_lock();
		list_for_each_entry_rcu(c, &task->thread_group, thread_group) {
			perf_cgroup_move(c);
		}
		rcu_read_unlock();
	}
}

static void perf_cgroup_exit(struct cgroup_subsys *ss, struct cgroup *cgrp,
		struct cgroup *old_cgrp, struct task_struct *task)
{
@@ -7433,7 +7419,7 @@ static void perf_cgroup_exit(struct cgroup_subsys *ss, struct cgroup *cgrp,
	if (!(task->flags & PF_EXITING))
		return;

	perf_cgroup_move(task);
	perf_cgroup_attach_task(cgrp, task);
}

struct cgroup_subsys perf_subsys = {
@@ -7442,6 +7428,6 @@ struct cgroup_subsys perf_subsys = {
	.create		= perf_cgroup_create,
	.destroy	= perf_cgroup_destroy,
	.exit		= perf_cgroup_exit,
	.attach		= perf_cgroup_attach,
	.attach_task	= perf_cgroup_attach_task,
};
#endif /* CONFIG_CGROUP_PERF */
+6 −0
Original line number Diff line number Diff line
@@ -938,6 +938,12 @@ static struct ctl_table kern_table[] = {
	},
#endif
#ifdef CONFIG_PERF_EVENTS
	/*
	 * User-space scripts rely on the existence of this file
	 * as a feature check for perf_events being enabled.
	 *
	 * So it's an ABI, do not remove!
	 */
	{
		.procname	= "perf_event_paranoid",
		.data		= &sysctl_perf_event_paranoid,
+1 −1
Original line number Diff line number Diff line
@@ -474,7 +474,7 @@ static int test__basic_mmap(void)
	unsigned int nr_events[nsyscalls],
		     expected_nr_events[nsyscalls], i, j;
	struct perf_evsel *evsels[nsyscalls], *evsel;
	int sample_size = perf_sample_size(attr.sample_type);
	int sample_size = __perf_evsel__sample_size(attr.sample_type);

	for (i = 0; i < nsyscalls; ++i) {
		char name[64];
+0 −16
Original line number Diff line number Diff line
@@ -35,22 +35,6 @@ const char *perf_event__name(unsigned int id)
	return perf_event__names[id];
}

int perf_sample_size(u64 sample_type)
{
	u64 mask = sample_type & PERF_SAMPLE_MASK;
	int size = 0;
	int i;

	for (i = 0; i < 64; i++) {
		if (mask & (1ULL << i))
			size++;
	}

	size *= sizeof(u64);

	return size;
}

static struct perf_sample synth_sample = {
	.pid	   = -1,
	.tid	   = -1,
Loading