From: David Ahern <dsahern@gmail.com>
To: Frederic Weisbecker <fweisbec@gmail.com>,
Peipei Wang <wangpeipei.90@gmail.com>
Cc: perf group <linux-perf-users@vger.kernel.org>
Subject: Re: How do the software events work in perf?
Date: Mon, 22 Jul 2013 18:09:16 -0600 [thread overview]
Message-ID: <51EDC9AC.40002@gmail.com> (raw)
In-Reply-To: <CAFTL4hz1u3dvAJZmSLGg6C9p9A=+dxYZ6JUYwVPbOB3_uEiu6g@mail.gmail.com>
On 7/22/13 5:51 PM, Frederic Weisbecker wrote:
> 2013/7/23 Peipei Wang <wangpeipei.90@gmail.com>:
>> Hi guys,
>> I am curious about how perf get the software events. While hardware
>> events are defined and can be found in architecture manuals, I don't
>> get any information or documentation about how perf get the software
>> events, or how they are collected.
>>
>> Thanks for your help.
>
> Hi,
>
> They are implemented using tracepoints. To summarize, tracepoints are callbacks
> that are called on any interesting point in the code.
Besides tracepoints there a few software events -- cpu-clock,
task-clock, context-switches, page faults, cpu migrations, etc.
David
>
> For example in the context switch path we have a function call
> trace_sched_context_switch() that in turn calls a callback that then
> rely into the perf events susbsystem to record the event in the
> buffer.
>
> In practice it is a bit more complicated, there is a layer in the
> middle with the trace events subsystem.
>
> For more details on tracepoints: Documentation/tracepoints.txt and
> Documentation/events.txt
>
> But really, this is just about function calls that we put when we find
> some interesting code to trace. Like a very enhanced printk() :)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
prev parent reply other threads:[~2013-07-23 0:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-22 23:11 How do the software events work in perf? Peipei Wang
2013-07-22 23:51 ` Frederic Weisbecker
2013-07-23 0:09 ` David Ahern [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=51EDC9AC.40002@gmail.com \
--to=dsahern@gmail.com \
--cc=fweisbec@gmail.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=wangpeipei.90@gmail.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;
as well as URLs for NNTP newsgroup(s).