<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/trace/Makefile, branch v2.6.28</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v2.6.28</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.28'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2008-10-20T16:27:03Z</updated>
<entry>
<title>ftrace: rename FTRACE to FUNCTION_TRACER</title>
<updated>2008-10-20T16:27:03Z</updated>
<author>
<name>Steven Rostedt</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2008-10-06T23:06:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=606576ce816603d9fe1fb453a88bc6eea16ca709'/>
<id>urn:sha1:606576ce816603d9fe1fb453a88bc6eea16ca709</id>
<content type='text'>
Due to confusion between the ftrace infrastructure and the gcc profiling
tracer "ftrace", this patch renames the config options from FTRACE to
FUNCTION_TRACER.  The other two names that are offspring from FTRACE
DYNAMIC_FTRACE and FTRACE_MCOUNT_RECORD will stay the same.

This patch was generated mostly by script, and partially by hand.

Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing: unified trace buffer</title>
<updated>2008-10-14T08:38:54Z</updated>
<author>
<name>Steven Rostedt</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2008-09-30T03:02:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7a8e76a3829f1067b70f715771ff88baf2fbf3c3'/>
<id>urn:sha1:7a8e76a3829f1067b70f715771ff88baf2fbf3c3</id>
<content type='text'>
This is a unified tracing buffer that implements a ring buffer that
hopefully everyone will eventually be able to use.

The events recorded into the buffer have the following structure:

  struct ring_buffer_event {
	u32 type:2, len:3, time_delta:27;
	u32 array[];
  };

The minimum size of an event is 8 bytes. All events are 4 byte
aligned inside the buffer.

There are 4 types (all internal use for the ring buffer, only
the data type is exported to the interface users).

 RINGBUF_TYPE_PADDING: this type is used to note extra space at the end
	of a buffer page.

 RINGBUF_TYPE_TIME_EXTENT: This type is used when the time between events
	is greater than the 27 bit delta can hold. We add another
	32 bits, and record that in its own event (8 byte size).

 RINGBUF_TYPE_TIME_STAMP: (Not implemented yet). This will hold data to
	help keep the buffer timestamps in sync.

RINGBUF_TYPE_DATA: The event actually holds user data.

The "len" field is only three bits. Since the data must be
4 byte aligned, this field is shifted left by 2, giving a
max length of 28 bytes. If the data load is greater than 28
bytes, the first array field holds the full length of the
data load and the len field is set to zero.

Example, data size of 7 bytes:

	type = RINGBUF_TYPE_DATA
	len = 2
	time_delta: &lt;time-stamp&gt; - &lt;prev_event-time-stamp&gt;
	array[0..1]: &lt;7 bytes of data&gt; &lt;1 byte empty&gt;

This event is saved in 12 bytes of the buffer.

An event with 82 bytes of data:

	type = RINGBUF_TYPE_DATA
	len = 0
	time_delta: &lt;time-stamp&gt; - &lt;prev_event-time-stamp&gt;
	array[0]: 84 (Note the alignment)
	array[1..14]: &lt;82 bytes of data&gt; &lt;2 bytes empty&gt;

The above event is saved in 92 bytes (if my math is correct).
82 bytes of data, 2 bytes empty, 4 byte header, 4 byte length.

Do not reference the above event struct directly. Use the following
functions to gain access to the event table, since the
ring_buffer_event structure may change in the future.

ring_buffer_event_length(event): get the length of the event.
	This is the size of the memory used to record this
	event, and not the size of the data pay load.

ring_buffer_time_delta(event): get the time delta of the event
	This returns the delta time stamp since the last event.
	Note: Even though this is in the header, there should
		be no reason to access this directly, accept
		for debugging.

ring_buffer_event_data(event): get the data from the event
	This is the function to use to get the actual data
	from the event. Note, it is only a pointer to the
	data inside the buffer. This data must be copied to
	another location otherwise you risk it being written
	over in the buffer.

ring_buffer_lock: A way to lock the entire buffer.
ring_buffer_unlock: unlock the buffer.

ring_buffer_alloc: create a new ring buffer. Can choose between
	overwrite or consumer/producer mode. Overwrite will
	overwrite old data, where as consumer producer will
	throw away new data if the consumer catches up with the
	producer.  The consumer/producer is the default.

ring_buffer_free: free the ring buffer.

ring_buffer_resize: resize the buffer. Changes the size of each cpu
	buffer. Note, it is up to the caller to provide that
	the buffer is not being used while this is happening.
	This requirement may go away but do not count on it.

ring_buffer_lock_reserve: locks the ring buffer and allocates an
	entry on the buffer to write to.
ring_buffer_unlock_commit: unlocks the ring buffer and commits it to
	the buffer.

ring_buffer_write: writes some data into the ring buffer.

ring_buffer_peek: Look at a next item in the cpu buffer.
ring_buffer_consume: get the next item in the cpu buffer and
	consume it. That is, this function increments the head
	pointer.

ring_buffer_read_start: Start an iterator of a cpu buffer.
	For now, this disables the cpu buffer, until you issue
	a finish. This is just because we do not want the iterator
	to be overwritten. This restriction may change in the future.
	But note, this is used for static reading of a buffer which
	is usually done "after" a trace. Live readings would want
	to use the ring_buffer_consume above, which will not
	disable the ring buffer.

ring_buffer_read_finish: Finishes the read iterator and reenables
	the ring buffer.

ring_buffer_iter_peek: Look at the next item in the cpu iterator.
ring_buffer_read: Read the iterator and increment it.
ring_buffer_iter_reset: Reset the iterator to point to the beginning
	of the cpu buffer.
ring_buffer_iter_empty: Returns true if the iterator is at the end
	of the cpu buffer.

ring_buffer_size: returns the size in bytes of each cpu buffer.
	Note, the real size is this times the number of CPUs.

ring_buffer_reset_cpu: Sets the cpu buffer to empty
ring_buffer_reset: sets all cpu buffers to empty

ring_buffer_swap_cpu: swaps a cpu buffer from one buffer with a
	cpu buffer of another buffer. This is handy when you
	want to take a snap shot of a running trace on just one
	cpu. Having a backup buffer, to swap with facilitates this.
	Ftrace max latencies use this.

ring_buffer_empty: Returns true if the ring buffer is empty.
ring_buffer_empty_cpu: Returns true if the cpu buffer is empty.

ring_buffer_record_disable: disable all cpu buffers (read only)
ring_buffer_record_disable_cpu: disable a single cpu buffer (read only)
ring_buffer_record_enable: enable all cpu buffers.
ring_buffer_record_enabl_cpu: enable a single cpu buffer.

ring_buffer_entries: The number of entries in a ring buffer.
ring_buffer_overruns: The number of entries removed due to writing wrap.

ring_buffer_time_stamp: Get the time stamp used by the ring buffer
ring_buffer_normalize_time_stamp: normalize the ring buffer time stamp
	into nanosecs.

I still need to implement the GTOD feature. But we need support from
the cpu frequency infrastructure.  But this can be done at a later
time without affecting the ring buffer interface.

Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing/ftrace: give an entry on the config for boot tracer</title>
<updated>2008-10-14T08:38:49Z</updated>
<author>
<name>Frédéric Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2008-09-23T10:36:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1f5c2abbdeb2bb07b20c6a66bfecefe6c867b1ee'/>
<id>urn:sha1:1f5c2abbdeb2bb07b20c6a66bfecefe6c867b1ee</id>
<content type='text'>
Bring the entry to choose the boot tracer on the kernel config.

Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>ftrace: add nop tracer</title>
<updated>2008-10-14T08:37:43Z</updated>
<author>
<name>Steven Noonan</name>
<email>steven@uplinklabs.net</email>
</author>
<published>2008-09-19T10:06:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fb1b6d8b5154c692172a424e45fbd0573295cb93'/>
<id>urn:sha1:fb1b6d8b5154c692172a424e45fbd0573295cb93</id>
<content type='text'>
A no-op tracer which can serve two purposes:

 1. A template for development of a new tracer.
 2. A convenient way to see ftrace_printk() calls without
    an irrelevant trace making the output messy.

[ mingo@elte.hu: resolved conflicts ]
Signed-off-by: Steven Noonan &lt;steven@uplinklabs.net&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>ftrace: add stack tracer</title>
<updated>2008-10-14T08:36:19Z</updated>
<author>
<name>Steven Rostedt</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2008-08-28T03:31:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e5a81b629ea8feb9e7530cfac35cfb41c45facf3'/>
<id>urn:sha1:e5a81b629ea8feb9e7530cfac35cfb41c45facf3</id>
<content type='text'>
This is another tracer using the ftrace infrastructure, that examines
at each function call the size of the stack. If the stack use is greater
than the previous max it is recorded.

You can always see (and set) the max stack size seen. By setting it
to zero will start the recording again. The backtrace is also available.

For example:

# cat /debug/tracing/stack_max_size
1856

# cat /debug/tracing/stack_trace
[&lt;c027764d&gt;] stack_trace_call+0x8f/0x101
[&lt;c021b966&gt;] ftrace_call+0x5/0x8
[&lt;c02553cc&gt;] clocksource_get_next+0x12/0x48
[&lt;c02542a5&gt;] update_wall_time+0x538/0x6d1
[&lt;c0245913&gt;] do_timer+0x23/0xb0
[&lt;c0257657&gt;] tick_do_update_jiffies64+0xd9/0xf1
[&lt;c02576b9&gt;] tick_sched_timer+0x4a/0xad
[&lt;c0250fe6&gt;] __run_hrtimer+0x3e/0x75
[&lt;c02518ed&gt;] hrtimer_interrupt+0xf1/0x154
[&lt;c022c870&gt;] smp_apic_timer_interrupt+0x71/0x84
[&lt;c021b7e9&gt;] apic_timer_interrupt+0x2d/0x34
[&lt;c0238597&gt;] finish_task_switch+0x29/0xa0
[&lt;c05abd13&gt;] schedule+0x765/0x7be
[&lt;c05abfca&gt;] schedule_timeout+0x1b/0x90
[&lt;c05ab4d4&gt;] wait_for_common+0xab/0x101
[&lt;c05ab5ac&gt;] wait_for_completion+0x12/0x14
[&lt;c033cfc3&gt;] blk_execute_rq+0x84/0x99
[&lt;c0402470&gt;] scsi_execute+0xc2/0x105
[&lt;c040250a&gt;] scsi_execute_req+0x57/0x7f
[&lt;c043afe0&gt;] sr_test_unit_ready+0x3e/0x97
[&lt;c043bbd6&gt;] sr_media_change+0x43/0x205
[&lt;c046b59f&gt;] media_changed+0x48/0x77
[&lt;c046b5ff&gt;] cdrom_media_changed+0x31/0x37
[&lt;c043b091&gt;] sr_block_media_changed+0x16/0x18
[&lt;c02b9e69&gt;] check_disk_change+0x1b/0x63
[&lt;c046f4c3&gt;] cdrom_open+0x7a1/0x806
[&lt;c043b148&gt;] sr_block_open+0x78/0x8d
[&lt;c02ba4c0&gt;] do_open+0x90/0x257
[&lt;c02ba869&gt;] blkdev_open+0x2d/0x56
[&lt;c0296a1f&gt;] __dentry_open+0x14d/0x23c
[&lt;c0296b32&gt;] nameidata_to_filp+0x24/0x38
[&lt;c02a1c68&gt;] do_filp_open+0x347/0x626
[&lt;c02967ef&gt;] do_sys_open+0x47/0xbc
[&lt;c02968b0&gt;] sys_open+0x23/0x2b
[&lt;c021aadd&gt;] sysenter_do_call+0x12/0x26

I've tested this on both x86_64 and i386.

Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>Merge branch 'tracing/sysprof' into auto-ftrace-next</title>
<updated>2008-07-10T09:43:08Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2008-07-10T09:43:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ec1bb60bbff0386c3ec25360e7a8c72f467a6ff1'/>
<id>urn:sha1:ec1bb60bbff0386c3ec25360e7a8c72f467a6ff1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>ftrace: add mmiotrace plugin</title>
<updated>2008-05-24T09:22:43Z</updated>
<author>
<name>Pekka Paalanen</name>
<email>pq@iki.fi</email>
</author>
<published>2008-05-12T19:20:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f984b51e0779a6dd30feedc41404013ca54e5d05'/>
<id>urn:sha1:f984b51e0779a6dd30feedc41404013ca54e5d05</id>
<content type='text'>
On Sat, 22 Mar 2008 13:07:47 +0100
Ingo Molnar &lt;mingo@elte.hu&gt; wrote:

&gt; &gt; &gt; i'd suggest the following: pull x86.git and sched-devel.git into a
&gt; &gt; &gt; single tree [the two will combine without rejects]. Then try to add a
&gt; &gt; &gt; kernel/tracing/trace_mmiotrace.c ftrace plugin. The trace_sysprof.c
&gt; &gt; &gt; plugin might be a good example.
&gt; &gt;
&gt; &gt; I did this and now I have mmiotrace enabled/disabled via the tracing
&gt; &gt; framework (what do we call this, since ftrace is one of the tracers?).
&gt;
&gt; cool! could you send the patches for that? (even if they are not fully
&gt; functional yet)

Patch attached in the end. Nice to see how much code disappeared. I tried
to mark all the features I had to break with XXX-comments.

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>ftrace: add sysprof plugin</title>
<updated>2008-05-23T21:39:00Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2008-05-12T19:20:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f06c38103ea9dbca27c3f4d77f444ddefb5477cd'/>
<id>urn:sha1:f06c38103ea9dbca27c3f4d77f444ddefb5477cd</id>
<content type='text'>
very first baby version.

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>ftrace: fix dynamic ftrace selftest</title>
<updated>2008-05-23T19:13:23Z</updated>
<author>
<name>Steven Rostedt</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2008-05-12T19:20:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d05cdb25d80f06f77aa6bddb53cd1390d4d91a0b'/>
<id>urn:sha1:d05cdb25d80f06f77aa6bddb53cd1390d4d91a0b</id>
<content type='text'>
With the adding of the configuration changes in the Makefile to prevent
tracing of functions in the ftrace code, all tracing of all the ftrace
code has been removed. Unfortunately, one of the selftests, relied on
a function to be traced. With the new change, the function was no longer
traced and the test failed.

This patch separates out the test function into its own file so that
we can add the "-pg" flag to the compilation of that function and the
adding of the mcount call to that function.

Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>ftrace: disable -pg for the tracer itself</title>
<updated>2008-05-23T18:56:53Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2008-05-12T19:20:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b53dde9d34f2df396540988ebc65c33400f57b04'/>
<id>urn:sha1:b53dde9d34f2df396540988ebc65c33400f57b04</id>
<content type='text'>
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
</feed>
