Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140597
b: refs/heads/master
c: 818fa7f
h: refs/heads/master
i:
  140595: 6e3415b
v: v3
  • Loading branch information
Ingo Molnar committed Dec 31, 2008
1 parent 9027a3d commit c8e14c9
Show file tree
Hide file tree
Showing 15 changed files with 408 additions and 44 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5fdf7e5975a0b0f6a0370655612c5dca3fd6311b
refs/heads/master: 818fa7f3908c7bd6c0045e9d94dc23a899ef6144
3 changes: 2 additions & 1 deletion trunk/arch/x86/kvm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ config KVM_AMD

config KVM_TRACE
bool "KVM trace support"
depends on KVM && MARKERS && SYSFS
depends on KVM && SYSFS
select MARKERS
select RELAY
select DEBUG_FS
default n
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/slab_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <asm/page.h> /* kmalloc_sizes.h needs PAGE_SIZE */
#include <asm/cache.h> /* kmalloc_sizes.h needs L1_CACHE_BYTES */
#include <linux/compiler.h>
#include <linux/kmemtrace.h>
#include <trace/kmemtrace.h>

/* Size description struct for general caches. */
struct cache_sizes {
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/slub_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <linux/gfp.h>
#include <linux/workqueue.h>
#include <linux/kobject.h>
#include <linux/kmemtrace.h>
#include <trace/kmemtrace.h>

enum stat_item {
ALLOC_FASTPATH, /* Allocation from cpu slab */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,17 @@ enum kmemtrace_type_id {

extern void kmemtrace_init(void);

static inline void kmemtrace_mark_alloc_node(enum kmemtrace_type_id type_id,
extern void kmemtrace_mark_alloc_node(enum kmemtrace_type_id type_id,
unsigned long call_site,
const void *ptr,
size_t bytes_req,
size_t bytes_alloc,
gfp_t gfp_flags,
int node)
{
trace_mark(kmemtrace_alloc, "type_id %d call_site %lu ptr %lu "
"bytes_req %lu bytes_alloc %lu gfp_flags %lu node %d",
type_id, call_site, (unsigned long) ptr,
(unsigned long) bytes_req, (unsigned long) bytes_alloc,
(unsigned long) gfp_flags, node);
}
int node);

static inline void kmemtrace_mark_free(enum kmemtrace_type_id type_id,
extern void kmemtrace_mark_free(enum kmemtrace_type_id type_id,
unsigned long call_site,
const void *ptr)
{
trace_mark(kmemtrace_free, "type_id %d call_site %lu ptr %lu",
type_id, call_site, (unsigned long) ptr);
}
const void *ptr);

#else /* CONFIG_KMEMTRACE */

Expand Down
2 changes: 1 addition & 1 deletion trunk/init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
#include <asm/setup.h>
#include <asm/sections.h>
#include <asm/cacheflush.h>
#include <linux/kmemtrace.h>
#include <trace/kmemtrace.h>

#ifdef CONFIG_X86_LOCAL_APIC
#include <asm/smp.h>
Expand Down
23 changes: 23 additions & 0 deletions trunk/kernel/trace/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,29 @@ config HW_BRANCH_TRACER
This tracer records all branches on the system in a circular
buffer giving access to the last N branches for each cpu.

config KMEMTRACE
bool "Trace SLAB allocations"
select TRACING
select MARKERS
select RELAY
help
kmemtrace provides tracing for slab allocator functions, such as
kmalloc, kfree, kmem_cache_alloc, kmem_cache_free etc.. Collected
data is then fed to the userspace application in order to analyse
allocation hotspots, internal fragmentation and so on, making it
possible to see how well an allocator performs, as well as debug
and profile kernel code.

This requires an userspace application to use. See
Documentation/vm/kmemtrace.txt for more information.

Saying Y will make the kernel somewhat larger and slower. However,
if you disable kmemtrace at run-time or boot-time, the performance
impact is minimal (depending on the arch the kernel is built for).

If unsure, say N.


config DYNAMIC_FTRACE
bool "enable/disable ftrace tracepoints dynamically"
depends on FUNCTION_TRACER
Expand Down
1 change: 1 addition & 0 deletions trunk/kernel/trace/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += trace_functions_graph.o
obj-$(CONFIG_TRACE_BRANCH_PROFILING) += trace_branch.o
obj-$(CONFIG_HW_BRANCH_TRACER) += trace_hw_branches.o
obj-$(CONFIG_POWER_TRACER) += trace_power.o
obj-$(CONFIG_KMEMTRACE) += kmemtrace.o

libftrace-y := ftrace.o
Loading

0 comments on commit c8e14c9

Please sign in to comment.