aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/oprofile
Commit message (Collapse)AuthorAge
* cpumask: use zalloc_cpumask_var() where possibleLi Zefan2009-09-23
| | | | | | | Remove open-coded zalloc_cpumask_var() and zalloc_cpumask_var_node(). Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* const: mark remaining super_operations constAlexey Dobriyan2009-09-22
| | | | | | Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* oprofile: Adding switch counter to oprofile statistic variablesRobert Richter2009-07-20
| | | | | | | | | This patch moves the multiplexing switch counter from x86 code to common oprofile statistic variables. Now the value will be available and usable for all architectures. The initialization and incrementation also moved to common code. Signed-off-by: Robert Richter <robert.richter@amd.com>
* oprofile: Grouping multiplexing code in oprof.cRobert Richter2009-07-20
| | | | | | | This patch moves multiplexing code to a single section of code. This reduces the use of #ifdefs especially within functions. Signed-off-by: Robert Richter <robert.richter@amd.com>
* oprofile: Remove oprofile_multiplexing_init()Robert Richter2009-07-20
| | | | | | | oprofile_multiplexing_init() can be removed when moving the initialization of oprofile_time_slice to oprofile_create_files(). Signed-off-by: Robert Richter <robert.richter@amd.com>
* oprofile: Rename variable timeout_jiffies and move to oprofile_files.cRobert Richter2009-07-20
| | | | | | | | | | This patch renames timeout_jiffies into an oprofile specific name. The macro MULTIPLEXING_TIMER_DEFAULT is changed too. Also, since this variable is controlled using oprofilefs, its definition is moved to oprofile_files.c. Signed-off-by: Robert Richter <robert.richter@amd.com>
* oprofile: oprofile_set_timeout(), return with error for invalid argsRobert Richter2009-07-20
| | | | | | | Return with -EINVAL for invalid parameters instead of setting the default value in oprofile_set_timeout(). Signed-off-by: Robert Richter <robert.richter@amd.com>
* oprofile: Implement performance counter multiplexingJason Yeh2009-07-20
| | | | | | | | | | | | | | | | | | | | | The number of hardware counters is limited. The multiplexing feature enables OProfile to gather more events than counters are provided by the hardware. This is realized by switching between events at an user specified time interval. A new file (/dev/oprofile/time_slice) is added for the user to specify the timer interval in ms. If the number of events to profile is higher than the number of hardware counters available, the patch will schedule a work queue that switches the event counter and re-writes the different sets of values into it. The switching mechanism needs to be implemented for each architecture to support multiplexing. This patch only implements AMD CPU support, but multiplexing can be easily extended for other models and architectures. There are follow-on patches that rework parts of this patch. Signed-off-by: Jason Yeh <jason.yeh@amd.com> Signed-off-by: Robert Richter <robert.richter@amd.com>
*-. Merge commit 'v2.6.31-rc3'; commit 'tip/oprofile' into oprofile/coreRobert Richter2009-07-14
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: drivers/oprofile/oprofile_stats.c drivers/usb/otg/Kconfig drivers/usb/otg/Makefile Signed-off-by: Robert Richter <robert.richter@amd.com>
| | * Merge branches 'oprofile/fixes', 'oprofile/next' and 'oprofile/master' into ↵Robert Richter2009-06-12
| |/| |/| | | | | | | | oprofile/auto
| | * oprofile: reset bt_lost_no_mapping with other statsMaynard Johnson2009-06-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | The bt_lost_no_mapping is not getting reset at the start of a profiling run, thus the oprofiled.log shows erroneous values for this statistic. The attached patch fixes this problem. Signed-off-by: Maynard Johnson <maynardj@us.ibm.com> Signed-off-by: Robert Richter <robert.richter@amd.com>
| * | oprofile: reset bt_lost_no_mapping with other statsMaynard Johnson2009-07-10
| |/ | | | | | | | | | | | | | | | | | | The bt_lost_no_mapping is not getting reset at the start of a profiling run, thus the oprofiled.log shows erroneous values for this statistic. The attached patch fixes this problem. Signed-off-by: Maynard Johnson <maynardj@us.ibm.com> Signed-off-by: Robert Richter <robert.richter@amd.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* | x86/oprofile: introduce oprofile_add_data64()Robert Richter2009-06-11
| | | | | | | | | | | | | | | | | | The IBS implemention writes 64 bit register values to the cpu buffer by writing two 32 values using oprofile_add_data(). This patch introduces oprofile_add_data64() to write a single 64 bit value to the buffer. Signed-off-by: Robert Richter <robert.richter@amd.com>
* | oprofile: remove obselete include headersRobert Richter2009-06-11
|/ | | | | | | | This became obsolete with this commit: 6dad828 oprofile: port to the new ring_buffer Signed-off-by: Robert Richter <robert.richter@amd.com>
* oprofile: fix cpu buffer sizeRobert Richter2009-05-07
| | | | | | | | | | The unit of oprofile_cpu_buffer_size is in samples, but was allocated in bytes. This led to the allocation of too small cpu buffers. This patch recalculates the buffer size in bytes taking also the ring_buffer_event header size into account. Reported-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Signed-off-by: Robert Richter <robert.richter@amd.com>
* Merge branch 'tracing-for-linus' of ↵Linus Torvalds2009-04-05
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'tracing-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (413 commits) tracing, net: fix net tree and tracing tree merge interaction tracing, powerpc: fix powerpc tree and tracing tree interaction ring-buffer: do not remove reader page from list on ring buffer free function-graph: allow unregistering twice trace: make argument 'mem' of trace_seq_putmem() const tracing: add missing 'extern' keywords to trace_output.h tracing: provide trace_seq_reserve() blktrace: print out BLK_TN_MESSAGE properly blktrace: extract duplidate code blktrace: fix memory leak when freeing struct blk_io_trace blktrace: fix blk_probes_ref chaos blktrace: make classic output more classic blktrace: fix off-by-one bug blktrace: fix the original blktrace blktrace: fix a race when creating blk_tree_root in debugfs blktrace: fix timestamp in binary output tracing, Text Edit Lock: cleanup tracing: filter fix for TRACE_EVENT_FORMAT events ftrace: Using FTRACE_WARN_ON() to check "freed record" in ftrace_release() x86: kretprobe-booster interrupt emulation code fix ... Fix up trivial conflicts in arch/parisc/include/asm/ftrace.h include/linux/memory.h kernel/extable.c kernel/module.c
| * Merge branch 'tracing/core-v2' into tracing-for-linusIngo Molnar2009-04-01
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: include/linux/slub_def.h lib/Kconfig.debug mm/slob.c mm/slub.c
| | * Merge branch 'x86/core' into tracing/texteditIngo Molnar2009-03-06
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: arch/x86/Kconfig block/blktrace.c kernel/irq/handle.c Semantic conflict: kernel/trace/blktrace.c Signed-off-by: Ingo Molnar <mingo@elte.hu>
| | * | ring_buffer: remove unused flags parameter, fixIngo Molnar2009-02-05
| | | | | | | | | | | | | | | | | | | | | | | | Oprofile's ring-buffer use was not considered. Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * | | oprofile: Thou shalt not call __exit functions from __init functionsRussell King2009-03-30
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | Impact: fix ref to discarded function `buffer_sync_cleanup' referenced in section `.init.text' of arch/arm/oprofile/built-in.o: defined in discarded section `.exit.text' of arch/arm/oprofile/built-in.o Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* | | Merge branch 'x86/core' into cpus4096Ingo Molnar2009-03-11
|\| |
| * | Merge branch 'linus' into core/percpuIngo Molnar2009-01-27
| |\| | | | | | | | | | | | | Conflicts: arch/x86/kernel/setup_percpu.c
| | * oprofile: fix uninitialized use of struct op_entryRobert Richter2009-01-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Impact: fix crash In case of losing samples struct op_entry could have been used uninitialized causing e.g. a wrong preemption count or NULL pointer access. This patch fixes this. Signed-off-by: Robert Richter <robert.richter@amd.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* | | cpumask: modifiy oprofile initializationRobert Richter2009-01-22
|/ / | | | | | | | | | | | | | | | | | | | | Delta patch to f7df8ed164996cd2c6aca9674388be6ef78d8b37 for tip/cpus4096. Moved initialization to sync_start()/sync_stop(). No changes needed in buffer_sync.h and oprof.c anymore. Signed-off-by: Robert Richter <robert.richter@amd.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* / cpumask: convert misc driver functionsRusty Russell2009-01-11
|/ | | | | | | | | | | | | | | | | | | | | | Impact: use new cpumask API. Convert misc driver functions to use struct cpumask. To Do: - Convert iucv_buffer_cpumask to cpumask_var_t. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Mike Travis <travis@sgi.com> Acked-by: Dean Nelson <dcn@sgi.com> Cc: Robert Richter <robert.richter@amd.com> Cc: oprofile-list@lists.sf.net Cc: Jeremy Fitzhardinge <jeremy@xensource.com> Cc: Chris Wright <chrisw@sous-sol.org> Cc: virtualization@lists.osdl.org Cc: xen-devel@lists.xensource.com Cc: Ursula Braun <ursula.braun@de.ibm.com> Cc: linux390@de.ibm.com Cc: linux-s390@vger.kernel.org
* Merge branch 'for-linus' of ↵Linus Torvalds2009-01-09
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/rric/oprofile * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rric/oprofile: (31 commits) powerpc/oprofile: fix whitespaces in op_model_cell.c powerpc/oprofile: IBM CELL: add SPU event profiling support powerpc/oprofile: fix cell/pr_util.h powerpc/oprofile: IBM CELL: cleanup and restructuring oprofile: make new cpu buffer functions part of the api oprofile: remove #ifdef CONFIG_OPROFILE_IBS in non-ibs code ring_buffer: fix ring_buffer_event_length() oprofile: use new data sample format for ibs oprofile: add op_cpu_buffer_get_data() oprofile: add op_cpu_buffer_add_data() oprofile: rework implementation of cpu buffer events oprofile: modify op_cpu_buffer_read_entry() oprofile: add op_cpu_buffer_write_reserve() oprofile: rename variables in add_ibs_begin() oprofile: rename add_sample() in cpu_buffer.c oprofile: rename variable ibs_allowed to has_ibs in op_model_amd.c oprofile: making add_sample_entry() inline oprofile: remove backtrace code for ibs oprofile: remove unused ibs macro oprofile: remove unused components in struct oprofile_cpu_buffer ...
| * oprofile: make new cpu buffer functions part of the apiRobert Richter2009-01-07
| | | | | | | | | | | | | | | | | | | | | | | | This patch creates the new functions oprofile_write_reserve() oprofile_add_data() oprofile_write_commit() and makes them part of the oprofile api. Signed-off-by: Robert Richter <robert.richter@amd.com>
| * oprofile: remove #ifdef CONFIG_OPROFILE_IBS in non-ibs codeRobert Richter2009-01-07
| | | | | | | | | | | | | | | | The ifdefs can be removed since the code is no longer ibs specific and can be used for other purposes as well. IBS specific code is only in op_model_amd.c. Signed-off-by: Robert Richter <robert.richter@amd.com>
| * oprofile: use new data sample format for ibsRobert Richter2009-01-07
| | | | | | | | | | | | | | | | | | | | | | | | | | The new ring buffer implementation allows the storage of samples with different size. This patch implements the usage of the new sample format to store ibs samples in the cpu buffer. Until now, writing to the cpu buffer could lead to incomplete sampling sequences since IBS samples were transfered in multiple samples. Due to a full buffer, data could be lost at any time. This can't happen any more since the complete data is reserved in advance and then stored in a single sample. Signed-off-by: Robert Richter <robert.richter@amd.com>
| * oprofile: add op_cpu_buffer_get_data()Robert Richter2009-01-07
| | | | | | | | | | | | | | | | | | This function provides access to attached data of a sample. It returns the size of data including the current value. Also, op_cpu_buffer_get_size() is available to check if there is data attached. Signed-off-by: Robert Richter <robert.richter@amd.com>
| * oprofile: add op_cpu_buffer_add_data()Robert Richter2009-01-07
| | | | | | | | | | | | | | | | 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>
| * oprofile: rework implementation of cpu buffer eventsRobert Richter2009-01-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * oprofile: modify op_cpu_buffer_read_entry()Robert Richter2009-01-07
| | | | | | | | | | | | This implements the support of samples with attached data. Signed-off-by: Robert Richter <robert.richter@amd.com>
| * oprofile: add op_cpu_buffer_write_reserve()Robert Richter2009-01-07
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * oprofile: rename variables in add_ibs_begin()Robert Richter2009-01-07
| | | | | | | | | | | | This unifies usage of variable names within oprofile. Signed-off-by: Robert Richter <robert.richter@amd.com>
| * oprofile: rename add_sample() in cpu_buffer.cRobert Richter2009-01-07
| | | | | | | | | | | | | | 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>
| * oprofile: making add_sample_entry() inlineRobert Richter2009-01-07
| | | | | | | | Signed-off-by: Robert Richter <robert.richter@amd.com>
| * oprofile: remove backtrace code for ibsRobert Richter2009-01-07
| | | | | | | | | | | | | | | | 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>
| * oprofile: remove unused ibs macroRobert Richter2009-01-07
| | | | | | | | Signed-off-by: Robert Richter <robert.richter@amd.com>
| * oprofile: remove unused components in struct oprofile_cpu_bufferRobert Richter2009-01-07
| | | | | | | | Signed-off-by: Robert Richter <robert.richter@amd.com>
| * oprofile: simplify add_ibs_begin()Robert Richter2009-01-07
| | | | | | | | Signed-off-by: Robert Richter <robert.richter@amd.com>
| * oprofile: simplify add_sample() in cpu_buffer.cRobert Richter2008-12-29
| | | | | | | | Signed-off-by: Robert Richter <robert.richter@amd.com>
| * oprofile: simplify oprofile_begin_trace()Robert Richter2008-12-29
| | | | | | | | | | | | | | | | 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>
| * oprofile: simplify sync_buffer()Robert Richter2008-12-29
| | | | | | | | | | | | Make code more readable. No functional changes. Signed-off-by: Robert Richter <robert.richter@amd.com>
| * oprofile: simplify add_sample()Robert Richter2008-12-29
| | | | | | | | | | | | | | This patch removes add_us_sample() and simplifies add_sample(). Code is much more readable now. Signed-off-by: Robert Richter <robert.richter@amd.com>
| * oprofile: add inline function __oprofile_add_ext_sample()Robert Richter2008-12-29
| | | | | | | | | | | | | | | | 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>
| * oprofile: reordering some code in cpu_buffer.cRobert Richter2008-12-29
| | | | | | | | | | | | Reordering code to keep alloc/free functions together. Signed-off-by: Robert Richter <robert.richter@amd.com>
| * oprofile: remove ring buffer inline functions in cpu_buffer.hRobert Richter2008-12-29
| | | | | | | | | | | | | | 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>
| * oprofile: rename cpu buffer functionsRobert Richter2008-12-29
| | | | | | | | | | | | | | | | 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>
| * oprofile: rename kernel-wide identifiersRobert Richter2008-12-16
| | | | | | | | | | | | | | | | 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>