- Jan 07, 2009
-
-
Robert Richter authored
This function can be used to attach data to a sample. It returns the remaining free buffer size that has been reserved with op_cpu_buffer_write_reserve(). Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
Robert Richter authored
Special events such as task or context switches are marked with an escape code in the cpu buffer followed by an event code or a task identifier. There is one escape code per event. To make escape sequences also available for data samples the internal cpu buffer format must be changed. The current implementation does not allow the extension of event codes since this would lead to collisions with the task identifiers. To avoid this, this patch introduces an event mask that allows the storage of multiple events with one escape code. Now, task identifiers are stored in the data section of the sample. The implementation also allows the usage of custom data in a sample. As a side effect the new code is much more readable and easier to understand. Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
Robert Richter authored
This implements the support of samples with attached data. Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
Robert Richter authored
This function prepares the cpu buffer to write a sample. Struct op_entry is used during operations on the ring buffer while struct op_sample contains the data that is stored in the ring buffer. Struct entry can be uninitialized. The function reserves a data array that is specified by size. Use op_cpu_buffer_write_commit() after preparing the sample. In case of errors a null pointer is returned, otherwise the pointer to the sample. Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
Robert Richter authored
Rename the fucntion to op_add_sample() since there is a collision with another one with the same name in buffer_sync.c. Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
Robert Richter authored
This code is broken since a TRACE_BEGIN_CODE is never sent to the daemon. The data becomes corrupt since the backtrace is interpreted as ibs sample. Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
Robert Richter authored
Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
Robert Richter authored
Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
- Dec 29, 2008
-
-
Robert Richter authored
Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
Robert Richter authored
This patch removes the unused return parameter in oprofile_begin_trace(). Also, oprofile_begin_trace() and oprofile_end_trace() are inline now. Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
Robert Richter authored
This patch adds the inline function __oprofile_add_ext_sample() to cpu_buffer.c and thus reduces overhead when calling oprofile_add_sample(). Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
Robert Richter authored
Reordering code to keep alloc/free functions together. Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
Robert Richter authored
This patch moves ring buffer inline functions to cpu_buffer.c. Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
Robert Richter authored
This patch renames cpu buffer functions to something more oprofile specific names. Functions will be moved to the global name space. Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
- Dec 16, 2008
-
-
Robert Richter authored
This patch renames kernel-wide identifiers to something more oprofile specific names. Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
- Dec 10, 2008
-
-
Robert Richter authored
The number of lost samples could be greater than the number of received samples. This patches fixes this. The implementation introduces return values for add_sample() and add_code(). Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
Robert Richter authored
This function is no longer available after the port to the new ring buffer. Its removal can lead to incomplete sampling sequences since IBS samples and backtraces are transfered in multiple samples. Due to a full buffer, samples could be lost any time. The userspace daemon has to live with such incomplete sampling sequences as long as the data within one sample is consistent. This will be fixed by changing the internal buffer data there all data of one IBS sample or a backtrace is packed in a single ring buffer entry. This is possible since the new ring buffer supports variable data size. Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
Robert Richter authored
This patch replaces the current oprofile cpu buffer implementation with the ring buffer provided by the tracing framework. The motivation here is to leave the pain of implementing ring buffers to others. Oh, no, there are more advantages. Main reason is the support of different sample sizes that could be stored in the buffer. Use cases for this are IBS and Cell spu profiling. Using the new ring buffer ensures valid and complete samples and allows copying the cpu buffer stateless without knowing its content. Second it will use generic kernel API and also reduce code size. And hopefully, there are less bugs. Since the new tracing ring buffer implementation uses spin locks to protect the buffer during read/write access, it is difficult to use the buffer in an NMI handler. In this case, writing to the buffer by the NMI handler (x86) could occur also during critical sections when reading the buffer. To avoid this, there are 2 buffers for independent read and write access. Read access is in process context only, write access only in the NMI handler. If the read buffer runs empty, both buffers are swapped atomically. There is potentially a small window during swapping where the buffers are disabled and samples could be lost. Using 2 buffers is a little bit overhead, but the solution is clear and does not require changes in the ring buffer implementation. It can be changed to a single buffer solution when the ring buffer access is implemented as non-locking atomic code. The new buffer requires more size to store the same amount of samples because each sample includes an u32 header. Also, there is more code to execute for buffer access. Nonetheless, the buffer implementation is proven in the ftrace environment and worth to use also in oprofile. Patches that changes the internal IBS buffer usage will follow. Cc: Steven Rostedt <rostedt@goodmis.org> Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
Robert Richter authored
This is in preparation for changes in the cpu buffer implementation. Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
Robert Richter authored
This is in preparation for changes in the cpu buffer implementation. Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
Robert Richter authored
This is in preparation for changes in the cpu buffer implementation. Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
Robert Richter authored
Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
Robert Richter authored
This fixes the coding style of some comments. Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
- Oct 20, 2008
-
-
Carl Love authored
The issue is the SPU code is not holding the kernel mutex lock while adding samples to the kernel buffer. This patch creates per SPU buffers to hold the data. Data is added to the buffers from in interrupt context. The data is periodically pushed to the kernel buffer via a new Oprofile function oprofile_put_buff(). The oprofile_put_buff() function is called via a work queue enabling the funtion to acquire the mutex lock. The existing user controls for adjusting the per CPU buffer size is used to control the size of the per SPU buffers. Similarly, overflows of the SPU buffers are reported by incrementing the per CPU buffer stats. This eliminates the need to have architecture specific controls for the per SPU buffers which is not acceptable to the OProfile user tool maintainer. The export of the oprofile add_event_entry() is removed as it is no longer needed given this patch. Note, this patch has not addressed the issue of indexing arrays by the spu number. This still needs to be fixed as the spu numbering is not guarenteed to be 0 to max_num_spus-1. Signed-off-by:
Carl Love <carll@us.ibm.com> Signed-off-by:
Maynard Johnson <maynardj@us.ibm.com> Signed-off-by:
Arnd Bergmann <arnd@arndb.de> Acked-by:
Acked-by: Robert Richter <robert.richter@amd.com> Signed-off-by:
Benjamin Herrenschmidt <benh@kernel.crashing.org>
-
- Oct 17, 2008
-
-
Chris J Arges authored
This patch addresses problems when hotplugging cpus while profiling. Instead of allocating only online cpus, all possible cpu buffers are allocated, which allows cpus to be onlined during operation. If a cpu is offlined before profiling is shutdown wq_sync_buffer checks for this condition then cancels this work and does not sync this buffer. Signed-off-by:
Chris J Arges <arges@linux.vnet.ibm.com> Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
- Oct 16, 2008
-
-
Robert Richter authored
Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
- Oct 15, 2008
-
-
Robert Richter authored
Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
Robert Richter authored
Code looks much more cleaner now. Signed-off-by:
Robert Richter <robert.richter@amd.com>
-
- Aug 25, 2008
-
-
Carl Love authored
If an error occurs on opcontrol start, the event and per cpu buffers are released. If later opcontrol shutdown is called then the free function will be called again to free buffers that no longer exist. This results in a kernel oops. The following changes prevent the call to delete buffers that don't exist. Signed-off-by:
Carl Love <carll@us.ibm.com> Signed-off-by:
Arnd Bergmann <arnd@arndb.de> Acked-by:
Robert Richter <robert.richter@amd.com> Signed-off-by:
Paul Mackerras <paulus@samba.org>
-
- Jul 26, 2008
-
-
Robert Richter authored
Signed-off-by:
Robert Richter <robert.richter@amd.com> Cc: oprofile-list <oprofile-list@lists.sourceforge.net> Cc: Robert Richter <robert.richter@amd.com> Cc: Barry Kasindorf <barry.kasindorf@amd.com> Signed-off-by:
Ingo Molnar <mingo@elte.hu>
-
Robert Richter authored
Signed-off-by:
Robert Richter <robert.richter@amd.com> Cc: oprofile-list <oprofile-list@lists.sourceforge.net> Cc: Robert Richter <robert.richter@amd.com> Cc: Barry Kasindorf <barry.kasindorf@amd.com> Signed-off-by:
Ingo Molnar <mingo@elte.hu>
-
Barry Kasindorf authored
This patchset supports the new profiling hardware available in the latest AMD CPUs in the oProfile driver. Signed-off-by:
Barry Kasindorf <barry.kasindorf@amd.com> Signed-off-by:
Robert Richter <robert.richter@amd.com> Cc: oprofile-list <oprofile-list@lists.sourceforge.net> Signed-off-by:
Ingo Molnar <mingo@elte.hu>
-
- May 14, 2008
-
-
Eric Dumazet authored
Alignment was previously requested because cpu_buffer was an [NR_CPUS] array, to avoid cache line sharing between CPUS. After commit 608dfddd (oprofile: change cpu_buffer from array to per_cpu variable ), we dont need to force an alignement anymore since cpu_buffer sits in per_cpu zone. Signed-off-by:
Eric Dumazet <dada1@cosmosbay.com> Cc: Mike Travis <travis@sgi.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- Apr 28, 2008
-
-
Mike Travis authored
Change cpu_buffer from array to per_cpu variable in oprofile functions. [akpm@linux-foundation.org: coding-style fixes] Cc: Philippe Elie <phil.el@wanadoo.fr> Signed-off-by:
Mike Travis <travis@sgi.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- Nov 14, 2007
-
-
Philippe Elie authored
Instruction pointer returned by profile_pc() can be a random value. This break the assumption than we can safely set struct op_sample.eip field to a magic value to signal to the per-cpu buffer reader side special event like task switch ending up in a segfault in get_task_mm() when profile_pc() return ~0UL. Fixed by sanitizing the sampled eip and reject/log invalid eip. Problem reported by Sami Farin, patch tested by him. Signed-off-by:
Philippe Elie <phil.el@wanadoo.fr> Tested-by:
Sami Farin <safari-kernel@safari.iki.fi> Cc: <stable@kernel.org> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- Nov 22, 2006
-
-
David Howells authored
Fix up for make allyesconfig. Signed-Off-By:
David Howells <dhowells@redhat.com>
-
- Mar 28, 2006
-
-
Brian Rogan authored
On ppc64 we look at a profiling register to work out the sample address and if it was in userspace or kernel. The backtrace interface oprofile_add_sample does not allow this. Create oprofile_add_ext_sample and make oprofile_add_sample use it too. Signed-off-by:
Anton Blanchard <anton@samba.org> Cc: Philippe Elie <phil.el@wanadoo.fr> Cc: John Levon <levon@movementarian.org> Signed-off-by:
Andrew Morton <akpm@osdl.org> Signed-off-by:
Linus Torvalds <torvalds@osdl.org>
-
- Mar 23, 2006
-
-
Andrew Morton authored
When we stop allocating percpu memory for not-possible CPUs we must not touch the percpu data for not-possible CPUs at all. The correct way of doing this is to test cpu_possible() or to use for_each_cpu(). This patch is a kernel-wide sweep of all instances of NR_CPUS. I found very few instances of this bug, if any. But the patch converts lots of open-coded test to use the preferred helper macros. Cc: Mikael Starvik <starvik@axis.com> Cc: David Howells <dhowells@redhat.com> Acked-by:
Kyle McMartin <kyle@parisc-linux.org> Cc: Anton Blanchard <anton@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Paul Mundt <lethal@linux-sh.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: William Lee Irwin III <wli@holomorphy.com> Cc: Andi Kleen <ak@muc.de> Cc: Christian Zankel <chris@zankel.net> Cc: Philippe Elie <phil.el@wanadoo.fr> Cc: Nathan Scott <nathans@sgi.com> Cc: Jens Axboe <axboe@suse.de> Cc: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by:
Andrew Morton <akpm@osdl.org> Signed-off-by:
Linus Torvalds <torvalds@osdl.org>
-
- Jan 08, 2006
-
-
Eric Dumazet authored
Make oprofile alloc_cpu_buffers() function NUMA aware, allocating each CPU local buffer in its memory node if possible. Signed-off-by:
Eric Dumazet <dada1@cosmosbay.com> Cc: Philippe Elie <phil.el@wanadoo.fr> Cc: John Levon <levon@movementarian.org> Signed-off-by:
Andrew Morton <akpm@osdl.org> Signed-off-by:
Linus Torvalds <torvalds@osdl.org>
-
- Jul 27, 2005
-
-
Jesper Juhl authored
`gcc -W' likes to complain if the static keyword is not at the beginning of the declaration. This patch fixes all remaining occurrences of "inline static" up with "static inline" in the entire kernel tree (140 occurrences in 47 files). While making this change I came across a few lines with trailing whitespace that I also fixed up, I have also added or removed a blank line or two here and there, but there are no functional changes in the patch. Signed-off-by:
Jesper Juhl <juhl-lkml@dif.dk> Signed-off-by:
Andrew Morton <akpm@osdl.org> Signed-off-by:
Linus Torvalds <torvalds@osdl.org>
-