From: Peter Zijlstra <peterz@infradead.org>
To: Andrew Vagin <avagin@openvz.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
Paul Mackerras <paulus@samba.org>,
Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
Arun Sharma <asharma@fb.com>
Subject: Re: [PATCH] trace: add ability to set a target task for events (v2)
Date: Wed, 11 Jul 2012 17:09:36 +0200 [thread overview]
Message-ID: <1342019376.3462.166.camel@twins> (raw)
In-Reply-To: <1342016098-213063-1-git-send-email-avagin@openvz.org>
On Wed, 2012-07-11 at 18:14 +0400, Andrew Vagin wrote:
> @@ -5226,6 +5227,29 @@ void perf_tp_event(u64 addr, u64 count, void *record, int entry_size,
> perf_swevent_event(event, count, &data, regs);
> }
>
> + /*
> + * If we got specified a target task, also iterate its context and
> + * deliver this event there too.
> + */
> + if (task && task != current) {
> + struct perf_event_context *ctx;
> + struct trace_entry *entry = record;
> +
> + rcu_read_lock();
> + ctx = rcu_dereference(task->perf_event_ctxp[perf_sw_context]);
> + if (!ctx)
> + goto unlock;
> +
> + list_for_each_entry_rcu(event, &ctx->event_list, event_entry) {
I added:
if (event->attr.type != PERF_TYPE_TRACEPOINT)
continue;
> + if (entry->type != event->attr.config)
> + continue;
> + if (perf_tp_event_match(event, &data, regs))
> + perf_swevent_event(event, count, &data, regs);
> + }
> +unlock:
> + rcu_read_unlock();
> + }
> +
> perf_swevent_put_recursion_context(rctx);
> }
Otherwise I've applied the patch.. Thanks!
next prev parent reply other threads:[~2012-07-11 15:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-11 14:14 [PATCH] trace: add ability to set a target task for events (v2) Andrew Vagin
2012-07-11 14:31 ` Frederic Weisbecker
2012-07-11 14:33 ` Peter Zijlstra
2012-07-11 14:36 ` Frederic Weisbecker
2012-07-11 14:38 ` Peter Zijlstra
2012-07-11 14:48 ` Frederic Weisbecker
2012-07-11 14:55 ` Peter Zijlstra
2012-07-11 15:07 ` Frederic Weisbecker
2012-07-11 15:12 ` Peter Zijlstra
2012-07-11 15:17 ` Frederic Weisbecker
2012-07-11 15:09 ` Peter Zijlstra [this message]
2012-07-31 17:58 ` [tip:perf/urgent] perf/trace: Add ability to set a target task for events tip-bot for Andrew Vagin
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=1342019376.3462.166.camel@twins \
--to=peterz@infradead.org \
--cc=acme@ghostprotocols.net \
--cc=asharma@fb.com \
--cc=avagin@openvz.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=paulus@samba.org \
--cc=rostedt@goodmis.org \
/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