This documentation is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
For more details see the file COPYING in the source distribution of Linux.
Table of Contents
Tracepoints are static probe points that are located in strategic points throughout the kernel. 'Probes' register/unregister with tracepoints via a callback mechanism. The 'probes' are strictly typed functions that are passed a unique set of parameters defined by each tracepoint.
From this simple callback mechanism, 'probes' can be used to profile, debug, and understand kernel behavior. There are a number of tools that provide a framework for using 'probes'. These tools include Systemtap, ftrace, and LTTng.
Tracepoints are defined in a number of header files via various macros. Thus, the purpose of this document is to provide a clear accounting of the available tracepoints. The intention is to understand not only what tracepoints are available but also to understand where future tracepoints might be added.
The API presented has functions of the form:
trace_tracepointname(function parameters). These are the
tracepoints callbacks that are found throughout the code. Registering and
unregistering probes with these callback sites is covered in the
Documentation/trace/* directory.
Table of Contents
trace_irq_handler_entry — called immediately before the irq action handler
void trace_irq_handler_entry ( | irq, | |
action); |
int irq;struct irqaction * action;trace_irq_handler_exit — called immediately after the irq action handler returns
void trace_irq_handler_exit ( | irq, | |
| action, | ||
ret); |
int irq;struct irqaction * action;int ret;
If the ret value is set to IRQ_HANDLED, then we know that the corresponding
action->handler scuccessully handled this irq. Otherwise, the irq might be
a shared irq line, or the irq was not handled successfully. Can be used in
conjunction with the irq_handler_entry to understand irq handler latencies.
trace_softirq_entry — called immediately before the softirq handler
void trace_softirq_entry ( | vec_nr); |
unsigned int vec_nr;Table of Contents
trace_signal_generate — called when a signal is generated
void trace_signal_generate ( | sig, | |
| info, | ||
task); |
int sig;struct siginfo * info;struct task_struct * task;trace_signal_deliver — called when a signal is delivered
void trace_signal_deliver ( | sig, | |
| info, | ||
ka); |
int sig;struct siginfo * info;struct k_sigaction * ka;A 'sig' signal is delivered to current process with 'info' siginfo, and it will be handled by 'ka'. ka->sa.sa_handler can be SIG_IGN or SIG_DFL. Note that some signals reported by signal_generate tracepoint can be lost, ignored or modified (by debugger) before hitting this tracepoint. This means, this can show which signals are actually delivered, but matching generated signals and delivered signals may not be correct.
trace_signal_overflow_fail — called when signal queue is overflow
void trace_signal_overflow_fail ( | sig, | |
| group, | ||
info); |
int sig;int group;struct siginfo * info;Table of Contents
trace_block_rq_abort — abort block operation request
void trace_block_rq_abort ( | q, | |
rq); |
struct request_queue * q;struct request * rq;trace_block_rq_requeue — place block IO request back on a queue
void trace_block_rq_requeue ( | q, | |
rq); |
struct request_queue * q;struct request * rq;trace_block_rq_complete — block IO operation completed by device driver
void trace_block_rq_complete ( | q, | |
rq); |
struct request_queue * q;struct request * rq;
The block_rq_complete tracepoint event indicates that some portion
of operation request has been completed by the device driver. If
the rq->bio is NULL, then there is absolutely no additional work to
do for the request. If rq->bio is non-NULL then there is
additional work required to complete the request.
trace_block_rq_insert — insert block operation request into queue
void trace_block_rq_insert ( | q, | |
rq); |
struct request_queue * q;struct request * rq;trace_block_rq_issue — issue pending block IO request operation to device driver
void trace_block_rq_issue ( | q, | |
rq); |
struct request_queue * q;struct request * rq;trace_block_bio_bounce — used bounce buffer when processing block operation
void trace_block_bio_bounce ( | q, | |
bio); |
struct request_queue * q;struct bio * bio;trace_block_bio_complete — completed all work on the block operation
void trace_block_bio_complete ( | q, | |
| bio, | ||
error); |
struct request_queue * q;struct bio * bio;int error;trace_block_bio_backmerge — merging block operation to the end of an existing operation
void trace_block_bio_backmerge ( | q, | |
bio); |
struct request_queue * q;struct bio * bio;trace_block_bio_frontmerge — merging block operation to the beginning of an existing operation
void trace_block_bio_frontmerge ( | q, | |
bio); |
struct request_queue * q;struct bio * bio;trace_block_bio_queue — putting new block IO operation in queue
void trace_block_bio_queue ( | q, | |
bio); |
struct request_queue * q;struct bio * bio;trace_block_getrq — get a free request entry in queue for block IO operations
void trace_block_getrq ( | q, | |
| bio, | ||
rw); |
struct request_queue * q;struct bio * bio;int rw;trace_block_sleeprq — waiting to get a free request entry in queue for block IO operation
void trace_block_sleeprq ( | q, | |
| bio, | ||
rw); |
struct request_queue * q;struct bio * bio;int rw;trace_block_plug — keep operations requests in request queue
void trace_block_plug ( | q); |
struct request_queue * q;trace_block_unplug — release of operations requests in request queue
void trace_block_unplug ( | q, | |
| depth, | ||
explicit); |
struct request_queue * q;unsigned int depth;bool explicit;trace_block_split — split a single bio struct into two bio structs
void trace_block_split ( | q, | |
| bio, | ||
new_sector); |
struct request_queue * q;struct bio * bio;unsigned int new_sector;trace_block_bio_remap — map request for a logical device to the raw device
void trace_block_bio_remap ( | q, | |
| bio, | ||
| dev, | ||
from); |
struct request_queue * q;struct bio * bio;dev_t dev;sector_t from;trace_block_rq_remap — map request for a block operation request
void trace_block_rq_remap ( | q, | |
| rq, | ||
| dev, | ||
from); |
struct request_queue * q;struct request * rq;dev_t dev;sector_t from;Table of Contents
trace_workqueue_queue_work — called when a work gets queued
void trace_workqueue_queue_work ( | req_cpu, | |
| cwq, | ||
work); |
unsigned int req_cpu;struct cpu_workqueue_struct * cwq;struct work_struct * work;trace_workqueue_activate_work — called when a work gets activated
void trace_workqueue_activate_work ( | work); |
struct work_struct * work;