Skip to content

Commit

Permalink
perf: Remove include of cgroup.h from perf_event.h
Browse files Browse the repository at this point in the history
Move struct perf_cgroup_info and perf_cgroup to
kernel/perf/core.c, and then we can remove include of cgroup.h.

Signed-off-by: Li Zefan <lizefan@huawei.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tejun Heo <tj@kernel.org>
Link: http://lkml.kernel.org/r/513568A0.6020804@huawei.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Li Zefan authored and Ingo Molnar committed Mar 6, 2013
1 parent 6dbe51c commit 877c685
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
18 changes: 1 addition & 17 deletions include/linux/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
*/

#ifdef CONFIG_PERF_EVENTS
# include <linux/cgroup.h>
# include <asm/perf_event.h>
# include <asm/local64.h>
#endif
Expand Down Expand Up @@ -299,22 +298,7 @@ struct swevent_hlist {
#define PERF_ATTACH_GROUP 0x02
#define PERF_ATTACH_TASK 0x04

#ifdef CONFIG_CGROUP_PERF
/*
* perf_cgroup_info keeps track of time_enabled for a cgroup.
* This is a per-cpu dynamically allocated data structure.
*/
struct perf_cgroup_info {
u64 time;
u64 timestamp;
};

struct perf_cgroup {
struct cgroup_subsys_state css;
struct perf_cgroup_info *info; /* timing info, one per cpu */
};
#endif

struct perf_cgroup;
struct ring_buffer;

/**
Expand Down
15 changes: 15 additions & 0 deletions kernel/events/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <linux/ftrace_event.h>
#include <linux/hw_breakpoint.h>
#include <linux/mm_types.h>
#include <linux/cgroup.h>

#include "internal.h"

Expand Down Expand Up @@ -233,6 +234,20 @@ static void perf_ctx_unlock(struct perf_cpu_context *cpuctx,

#ifdef CONFIG_CGROUP_PERF

/*
* perf_cgroup_info keeps track of time_enabled for a cgroup.
* This is a per-cpu dynamically allocated data structure.
*/
struct perf_cgroup_info {
u64 time;
u64 timestamp;
};

struct perf_cgroup {
struct cgroup_subsys_state css;
struct perf_cgroup_info *info;
};

/*
* Must ensure cgroup is pinned (css_get) before calling
* this function. In other words, we cannot call this function
Expand Down

0 comments on commit 877c685

Please sign in to comment.