aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2014-11-04 21:56:01 -0500
committerIngo Molnar <mingo@kernel.org>2015-02-18 11:16:05 -0500
commit4af57ef28c2c1047fda9e1a5be02aa7a6a69cf9e (patch)
treed186ebdcb589686170bfac7dc97b5d1c613dab9c /include
parente9d7f7cd97c45e2c612d3b38be05b4cfb27939ee (diff)
perf: Add pmu specific data for perf task context
Introduce a new flag PERF_ATTACH_TASK_DATA for perf event's attach stata. The flag is set by PMU's event_init() callback, it indicates that perf event needs PMU specific data. The PMU specific data are initialized to zeros. Later patches will use PMU specific data to save LBR stack. Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com> Signed-off-by: Kan Liang <kan.liang@intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Paul Mackerras <paulus@samba.org> Cc: eranian@google.com Cc: jolsa@redhat.com Link: http://lkml.kernel.org/r/1415156173-10035-6-git-send-email-kan.liang@intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/perf_event.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index c7007a564440..270cd0173e61 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -271,6 +271,10 @@ struct pmu {
271 */ 271 */
272 void (*sched_task) (struct perf_event_context *ctx, 272 void (*sched_task) (struct perf_event_context *ctx,
273 bool sched_in); 273 bool sched_in);
274 /*
275 * PMU specific data size
276 */
277 size_t task_ctx_size;
274 278
275}; 279};
276 280
@@ -307,6 +311,7 @@ struct swevent_hlist {
307#define PERF_ATTACH_CONTEXT 0x01 311#define PERF_ATTACH_CONTEXT 0x01
308#define PERF_ATTACH_GROUP 0x02 312#define PERF_ATTACH_GROUP 0x02
309#define PERF_ATTACH_TASK 0x04 313#define PERF_ATTACH_TASK 0x04
314#define PERF_ATTACH_TASK_DATA 0x08
310 315
311struct perf_cgroup; 316struct perf_cgroup;
312struct ring_buffer; 317struct ring_buffer;
@@ -511,6 +516,7 @@ struct perf_event_context {
511 u64 generation; 516 u64 generation;
512 int pin_count; 517 int pin_count;
513 int nr_cgroups; /* cgroup evts */ 518 int nr_cgroups; /* cgroup evts */
519 void *task_ctx_data; /* pmu specific data */
514 struct rcu_head rcu_head; 520 struct rcu_head rcu_head;
515 521
516 struct delayed_work orphans_remove; 522 struct delayed_work orphans_remove;