From: Frederic Weisbecker <fweisbec@gmail.com>
To: 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: Tue, 23 Jul 2013 01:51:24 +0200 [thread overview]
Message-ID: <CAFTL4hz1u3dvAJZmSLGg6C9p9A=+dxYZ6JUYwVPbOB3_uEiu6g@mail.gmail.com> (raw)
In-Reply-To: <CAEuYUeofoxasfFS+_oXggXEK5jDKz5S-z0_8Nt6r3bf+J7yE_w@mail.gmail.com>
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.
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() :)
next prev parent reply other threads:[~2013-07-22 23:51 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 [this message]
2013-07-23 0:09 ` David Ahern
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='CAFTL4hz1u3dvAJZmSLGg6C9p9A=+dxYZ6JUYwVPbOB3_uEiu6g@mail.gmail.com' \
--to=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).