mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephane Eranian <eranian@google.com>
To: linux-kernel@vger.kernel.org
Cc: peterz@infradead.org, mingo@elte.hu, ak@linux.intel.com,
	acme@redhat.com, jolsa@redhat.com, zheng.z.yan@intel.com,
	bp@alien8.de, maria.n.dimakopoulou@gmail.com
Subject: [PATCH v4 1/4] perf: add active_entry list head to struct perf_event
Date: Thu, 31 Oct 2013 15:59:39 +0100	[thread overview]
Message-ID: <1383231582-15856-2-git-send-email-eranian@google.com> (raw)
In-Reply-To: <1383231582-15856-1-git-send-email-eranian@google.com>

This patch adds a new field to the struct perf_event.
It is intended to be used to chain events which are
active (enabled). It helps in the hardware layer
for PMUs which do not have actual counter restrictions, i.e.,
free running read-only counters. Active events are chained
as opposed to being tracked via the counter they use.

To save space we use a union with hlist_entry as both
are mutually exclusive (suggested by Jiri Olsa).

Signed-off-by: Stephane Eranian <eranian@google.com>
---
 include/linux/perf_event.h |    5 ++++-
 kernel/events/core.c       |    1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 2e069d1..8f4a70f 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -319,7 +319,10 @@ struct perf_event {
 	 */
 	struct list_head		migrate_entry;
 
-	struct hlist_node		hlist_entry;
+	union {
+		struct hlist_node	hlist_entry;
+		struct list_head	active_entry;
+	};
 	int				nr_siblings;
 	int				group_flags;
 	struct perf_event		*group_leader;
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 17b3c6c..2de509b 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -6663,6 +6663,7 @@ perf_event_alloc(struct perf_event_attr *attr, int cpu,
 	INIT_LIST_HEAD(&event->event_entry);
 	INIT_LIST_HEAD(&event->sibling_list);
 	INIT_LIST_HEAD(&event->rb_entry);
+	INIT_LIST_HEAD(&event->active_entry);
 
 	init_waitqueue_head(&event->waitq);
 	init_irq_work(&event->pending, perf_pending_event);
-- 
1.7.9.5


  reply	other threads:[~2013-10-31 14:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-31 14:59 [PATCH v4 0/4] perf/x86: add Intel RAPL PMU support Stephane Eranian
2013-10-31 14:59 ` Stephane Eranian [this message]
2013-10-31 14:59 ` [PATCH v4 2/4] perf stat: add event unit and scale support Stephane Eranian
2013-11-01 10:57   ` Jiri Olsa
2013-11-04 14:47     ` Stephane Eranian
2013-11-04 14:51       ` Jiri Olsa
2013-11-05 13:34         ` Stephane Eranian
2013-11-05 14:00           ` Jiri Olsa
2013-11-05 14:04             ` Stephane Eranian
2013-11-05 14:16           ` Andi Kleen
2013-11-05 14:17             ` Stephane Eranian
2013-11-05 15:03               ` Stephane Eranian
2013-10-31 14:59 ` [PATCH v4 3/4] perf/x86: add Intel RAPL PMU support Stephane Eranian
2013-10-31 15:14   ` Peter Zijlstra
2013-10-31 14:59 ` [PATCH v4 4/4] perf,x86: add RAPL hrtimer support Stephane Eranian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1383231582-15856-2-git-send-email-eranian@google.com \
    --to=eranian@google.com \
    --cc=acme@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maria.n.dimakopoulou@gmail.com \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=zheng.z.yan@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome