From: tip-bot for Alexander Shishkin <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, acme@redhat.com,
mathieu.poirier@linaro.org, tglx@linutronix.de, mingo@kernel.org,
peterz@infradead.org, alexander.shishkin@linux.intel.com,
eranian@google.com, bp@alien8.de, acme@infradead.org,
vincent.weaver@maine.edu, hpa@zytor.com, jolsa@redhat.com,
torvalds@linux-foundation.org
Subject: [tip:perf/core] perf/core: Extend perf_event_aux_ctx() to optionally iterate through more events
Date: Thu, 5 May 2016 02:46:28 -0700 [thread overview]
Message-ID: <tip-b73e4fefc18adbe4d12ffb746fb16306674c1ac6@git.kernel.org> (raw)
In-Reply-To: <1461771888-10409-5-git-send-email-alexander.shishkin@linux.intel.com>
Commit-ID: b73e4fefc18adbe4d12ffb746fb16306674c1ac6
Gitweb: http://git.kernel.org/tip/b73e4fefc18adbe4d12ffb746fb16306674c1ac6
Author: Alexander Shishkin <alexander.shishkin@linux.intel.com>
AuthorDate: Wed, 27 Apr 2016 18:44:45 +0300
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 5 May 2016 10:13:57 +0200
perf/core: Extend perf_event_aux_ctx() to optionally iterate through more events
Trace filtering code needs an iterator that can go through all events in
a context, including inactive and filtered, to be able to update their
filters' address ranges based on mmap or exec events.
This patch changes perf_event_aux_ctx() to optionally do this.
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: vince@deater.net
Link: http://lkml.kernel.org/r/1461771888-10409-5-git-send-email-alexander.shishkin@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/events/core.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 13956ee..2bb7c47 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -5781,15 +5781,18 @@ typedef void (perf_event_aux_output_cb)(struct perf_event *event, void *data);
static void
perf_event_aux_ctx(struct perf_event_context *ctx,
perf_event_aux_output_cb output,
- void *data)
+ void *data, bool all)
{
struct perf_event *event;
list_for_each_entry_rcu(event, &ctx->event_list, event_entry) {
- if (event->state < PERF_EVENT_STATE_INACTIVE)
- continue;
- if (!event_filter_match(event))
- continue;
+ if (!all) {
+ if (event->state < PERF_EVENT_STATE_INACTIVE)
+ continue;
+ if (!event_filter_match(event))
+ continue;
+ }
+
output(event, data);
}
}
@@ -5800,7 +5803,7 @@ perf_event_aux_task_ctx(perf_event_aux_output_cb output, void *data,
{
rcu_read_lock();
preempt_disable();
- perf_event_aux_ctx(task_ctx, output, data);
+ perf_event_aux_ctx(task_ctx, output, data, false);
preempt_enable();
rcu_read_unlock();
}
@@ -5830,13 +5833,13 @@ perf_event_aux(perf_event_aux_output_cb output, void *data,
cpuctx = get_cpu_ptr(pmu->pmu_cpu_context);
if (cpuctx->unique_pmu != pmu)
goto next;
- perf_event_aux_ctx(&cpuctx->ctx, output, data);
+ perf_event_aux_ctx(&cpuctx->ctx, output, data, false);
ctxn = pmu->task_ctx_nr;
if (ctxn < 0)
goto next;
ctx = rcu_dereference(current->perf_event_ctxp[ctxn]);
if (ctx)
- perf_event_aux_ctx(ctx, output, data);
+ perf_event_aux_ctx(ctx, output, data, false);
next:
put_cpu_ptr(pmu->pmu_cpu_context);
}
@@ -5878,10 +5881,10 @@ static int __perf_pmu_output_stop(void *info)
};
rcu_read_lock();
- perf_event_aux_ctx(&cpuctx->ctx, __perf_event_output_stop, &ro);
+ perf_event_aux_ctx(&cpuctx->ctx, __perf_event_output_stop, &ro, false);
if (cpuctx->task_ctx)
perf_event_aux_ctx(cpuctx->task_ctx, __perf_event_output_stop,
- &ro);
+ &ro, false);
rcu_read_unlock();
return ro.err;
next prev parent reply other threads:[~2016-05-05 9:47 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-27 15:44 [PATCH v2 0/7] perf: Introduce address range filtering Alexander Shishkin
2016-04-27 15:44 ` [PATCH v2 1/7] perf: Move set_filter() from behind EVENT_TRACING Alexander Shishkin
2016-05-05 9:45 ` [tip:perf/core] perf/core: Move set_filter() out of CONFIG_EVENT_TRACING tip-bot for Alexander Shishkin
2016-04-27 15:44 ` [PATCH v2 2/7] perf/x86/intel/pt: Move MSR bit definitions to a private header Alexander Shishkin
2016-05-05 9:45 ` [tip:perf/core] perf/x86/intel/pt: Move PT specific " tip-bot for Alexander Shishkin
2016-04-27 15:44 ` [PATCH v2 3/7] perf/x86/intel/pt: IP filtering register/cpuid bits Alexander Shishkin
2016-05-05 9:46 ` [tip:perf/core] perf/x86/intel/pt: Add IP filtering register/CPUID bits tip-bot for Alexander Shishkin
2016-04-27 15:44 ` [PATCH v2 4/7] perf: Extend perf_event_aux_ctx() to optionally iterate through more events Alexander Shishkin
2016-05-05 9:46 ` tip-bot for Alexander Shishkin [this message]
2016-04-27 15:44 ` [PATCH v2 5/7] perf: Introduce address range filtering Alexander Shishkin
2016-04-28 17:09 ` Peter Zijlstra
2016-04-29 18:12 ` Mathieu Poirier
2016-04-30 4:59 ` Alexander Shishkin
2016-05-02 14:31 ` Mathieu Poirier
2016-05-03 8:56 ` Peter Zijlstra
2016-05-05 9:46 ` [tip:perf/core] perf/core: " tip-bot for Alexander Shishkin
2016-04-27 15:44 ` [PATCH v2 6/7] perf/x86/intel/pt: Add support for address range filtering in PT Alexander Shishkin
2016-05-05 9:47 ` [tip:perf/core] " tip-bot for Alexander Shishkin
2016-04-27 15:44 ` [PATCH v2 7/7] perf: Let userspace know if pmu supports address filters Alexander Shishkin
2016-05-05 9:47 ` [tip:perf/core] perf/core: Let userspace know if the PMU " tip-bot for Alexander Shishkin
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=tip-b73e4fefc18adbe4d12ffb746fb16306674c1ac6@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@infradead.org \
--cc=acme@redhat.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=bp@alien8.de \
--cc=eranian@google.com \
--cc=hpa@zytor.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=vincent.weaver@maine.edu \
/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