public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "zhangwei(Jovi)" <jovi.zhangwei@huawei.com>
To: Karim Yaghmour <karim.yaghmour@opersys.com>
Cc: <linux-kernel@vger.kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>, <mingo@elte.hu>
Subject: Re: Reading perf counters at ftrace trace boundaries
Date: Tue, 13 Aug 2013 15:12:51 +0800	[thread overview]
Message-ID: <5209DC73.8000408@huawei.com> (raw)
In-Reply-To: <5208FEC1.7010206@opersys.com>

On 2013/8/12 23:26, Karim Yaghmour wrote:
> 
> On 13-08-11 11:24 PM, zhangwei(Jovi) wrote:
>> If you want to base on ftrace, below two approach maybe take into use:
>>
>> - register_ftrace_function/unregister_ftrace_function
>>
>> - perf_event_create_kernel_counter (function event id is 1)
>>
>> the first one is simplest, IMO.
> 
> Thx for the pointers.
> 
>> You need to write your own kernel module to use these approach.
> 
> As a proof-of-concept, sure. For something more permanent it would make
> more sense to adapt the various perf/ftrace tools to make this available
> on the command line with other options. But we're far away from that for
> the moment.
> 
If you want to embed pmu reading into ftrace/perf permanently, perhaps
make pmu reading as clock source would be a nice way to go, actually the
question you raised is very common for all of us in practical, sometimes
we want to read cpu cycles both in kvm host and kvm guest, then in that
kvm case, pmu reading for each event is very valuable.

(one issue need to handle specially for making pmu as tracing clock, is
the pmu number overflow, because it relate with ftrace per-cpu ring
buffer sync)

Thanks.

jovi




      reply	other threads:[~2013-08-13  7:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-12  0:03 Reading perf counters at ftrace trace boundaries Karim Yaghmour
2013-08-12  1:23 ` Andi Kleen
2013-08-12  1:39   ` Karim Yaghmour
2013-08-12  1:47     ` Andi Kleen
2013-08-12  1:59       ` Karim Yaghmour
2013-08-12  2:24 ` zhangwei(Jovi)
2013-08-12 15:26   ` Karim Yaghmour
2013-08-13  7:12     ` zhangwei(Jovi) [this message]

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=5209DC73.8000408@huawei.com \
    --to=jovi.zhangwei@huawei.com \
    --cc=karim.yaghmour@opersys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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