Merge branch 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (105 commits) ring-buffer: only enable ring_buffer_swap_cpu when needed ring-buffer: check for swapped buffers in start of committing tracing: report error in trace if we fail to swap latency buffer tracing: add trace_array_printk for internal tracers to use tracing: pass around ring buffer instead of tracer tracing: make tracing_reset safe for external use tracing: use timestamp to determine start of latency traces tracing: Remove mentioning of legacy latency_trace file from documentation tracing/filters: Defer pred allocation, fix memory leak tracing: remove users of tracing_reset tracing: disable buffers and synchronize_sched before resetting tracing: disable update max tracer while reading trace tracing: print out start and stop in latency traces ring-buffer: disable all cpu buffers when one finds a problem ring-buffer: do not count discarded events ring-buffer: remove ring_buffer_event_discard ring-buffer: fix ring_buffer_read crossing pages ring-buffer: remove unnecessary cpu_relax ring-buffer: do not swap buffers during a commit ring-buffer: do not reset while in a commit ...
This commit is contained in:
126
include/trace/events/module.h
Normal file
126
include/trace/events/module.h
Normal file
@@ -0,0 +1,126 @@
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM module
|
||||
|
||||
#if !defined(_TRACE_MODULE_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||
#define _TRACE_MODULE_H
|
||||
|
||||
#include <linux/tracepoint.h>
|
||||
|
||||
#ifdef CONFIG_MODULES
|
||||
|
||||
struct module;
|
||||
|
||||
#define show_module_flags(flags) __print_flags(flags, "", \
|
||||
{ (1UL << TAINT_PROPRIETARY_MODULE), "P" }, \
|
||||
{ (1UL << TAINT_FORCED_MODULE), "F" }, \
|
||||
{ (1UL << TAINT_CRAP), "C" })
|
||||
|
||||
TRACE_EVENT(module_load,
|
||||
|
||||
TP_PROTO(struct module *mod),
|
||||
|
||||
TP_ARGS(mod),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field( unsigned int, taints )
|
||||
__string( name, mod->name )
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->taints = mod->taints;
|
||||
__assign_str(name, mod->name);
|
||||
),
|
||||
|
||||
TP_printk("%s %s", __get_str(name), show_module_flags(__entry->taints))
|
||||
);
|
||||
|
||||
TRACE_EVENT(module_free,
|
||||
|
||||
TP_PROTO(struct module *mod),
|
||||
|
||||
TP_ARGS(mod),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__string( name, mod->name )
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__assign_str(name, mod->name);
|
||||
),
|
||||
|
||||
TP_printk("%s", __get_str(name))
|
||||
);
|
||||
|
||||
TRACE_EVENT(module_get,
|
||||
|
||||
TP_PROTO(struct module *mod, unsigned long ip, int refcnt),
|
||||
|
||||
TP_ARGS(mod, ip, refcnt),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field( unsigned long, ip )
|
||||
__field( int, refcnt )
|
||||
__string( name, mod->name )
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->ip = ip;
|
||||
__entry->refcnt = refcnt;
|
||||
__assign_str(name, mod->name);
|
||||
),
|
||||
|
||||
TP_printk("%s call_site=%pf refcnt=%d",
|
||||
__get_str(name), (void *)__entry->ip, __entry->refcnt)
|
||||
);
|
||||
|
||||
TRACE_EVENT(module_put,
|
||||
|
||||
TP_PROTO(struct module *mod, unsigned long ip, int refcnt),
|
||||
|
||||
TP_ARGS(mod, ip, refcnt),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field( unsigned long, ip )
|
||||
__field( int, refcnt )
|
||||
__string( name, mod->name )
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->ip = ip;
|
||||
__entry->refcnt = refcnt;
|
||||
__assign_str(name, mod->name);
|
||||
),
|
||||
|
||||
TP_printk("%s call_site=%pf refcnt=%d",
|
||||
__get_str(name), (void *)__entry->ip, __entry->refcnt)
|
||||
);
|
||||
|
||||
TRACE_EVENT(module_request,
|
||||
|
||||
TP_PROTO(char *name, bool wait, unsigned long ip),
|
||||
|
||||
TP_ARGS(name, wait, ip),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field( bool, wait )
|
||||
__field( unsigned long, ip )
|
||||
__string( name, name )
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->wait = wait;
|
||||
__entry->ip = ip;
|
||||
__assign_str(name, name);
|
||||
),
|
||||
|
||||
TP_printk("%s wait=%d call_site=%pf",
|
||||
__get_str(name), (int)__entry->wait, (void *)__entry->ip)
|
||||
);
|
||||
|
||||
#endif /* CONFIG_MODULES */
|
||||
|
||||
#endif /* _TRACE_MODULE_H */
|
||||
|
||||
/* This part must be outside protection */
|
||||
#include <trace/define_trace.h>
|
||||
|
@@ -94,6 +94,7 @@ TRACE_EVENT(sched_wakeup,
|
||||
__field( pid_t, pid )
|
||||
__field( int, prio )
|
||||
__field( int, success )
|
||||
__field( int, cpu )
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
@@ -101,11 +102,12 @@ TRACE_EVENT(sched_wakeup,
|
||||
__entry->pid = p->pid;
|
||||
__entry->prio = p->prio;
|
||||
__entry->success = success;
|
||||
__entry->cpu = task_cpu(p);
|
||||
),
|
||||
|
||||
TP_printk("task %s:%d [%d] success=%d",
|
||||
TP_printk("task %s:%d [%d] success=%d [%03d]",
|
||||
__entry->comm, __entry->pid, __entry->prio,
|
||||
__entry->success)
|
||||
__entry->success, __entry->cpu)
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -125,6 +127,7 @@ TRACE_EVENT(sched_wakeup_new,
|
||||
__field( pid_t, pid )
|
||||
__field( int, prio )
|
||||
__field( int, success )
|
||||
__field( int, cpu )
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
@@ -132,11 +135,12 @@ TRACE_EVENT(sched_wakeup_new,
|
||||
__entry->pid = p->pid;
|
||||
__entry->prio = p->prio;
|
||||
__entry->success = success;
|
||||
__entry->cpu = task_cpu(p);
|
||||
),
|
||||
|
||||
TP_printk("task %s:%d [%d] success=%d",
|
||||
TP_printk("task %s:%d [%d] success=%d [%03d]",
|
||||
__entry->comm, __entry->pid, __entry->prio,
|
||||
__entry->success)
|
||||
__entry->success, __entry->cpu)
|
||||
);
|
||||
|
||||
/*
|
||||
|
70
include/trace/events/syscalls.h
Normal file
70
include/trace/events/syscalls.h
Normal file
@@ -0,0 +1,70 @@
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM syscalls
|
||||
|
||||
#if !defined(_TRACE_EVENTS_SYSCALLS_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||
#define _TRACE_EVENTS_SYSCALLS_H
|
||||
|
||||
#include <linux/tracepoint.h>
|
||||
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/syscall.h>
|
||||
|
||||
|
||||
#ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS
|
||||
|
||||
extern void syscall_regfunc(void);
|
||||
extern void syscall_unregfunc(void);
|
||||
|
||||
TRACE_EVENT_FN(sys_enter,
|
||||
|
||||
TP_PROTO(struct pt_regs *regs, long id),
|
||||
|
||||
TP_ARGS(regs, id),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field( long, id )
|
||||
__array( unsigned long, args, 6 )
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->id = id;
|
||||
syscall_get_arguments(current, regs, 0, 6, __entry->args);
|
||||
),
|
||||
|
||||
TP_printk("NR %ld (%lx, %lx, %lx, %lx, %lx, %lx)",
|
||||
__entry->id,
|
||||
__entry->args[0], __entry->args[1], __entry->args[2],
|
||||
__entry->args[3], __entry->args[4], __entry->args[5]),
|
||||
|
||||
syscall_regfunc, syscall_unregfunc
|
||||
);
|
||||
|
||||
TRACE_EVENT_FN(sys_exit,
|
||||
|
||||
TP_PROTO(struct pt_regs *regs, long ret),
|
||||
|
||||
TP_ARGS(regs, ret),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field( long, id )
|
||||
__field( long, ret )
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->id = syscall_get_nr(current, regs);
|
||||
__entry->ret = ret;
|
||||
),
|
||||
|
||||
TP_printk("NR %ld = %ld",
|
||||
__entry->id, __entry->ret),
|
||||
|
||||
syscall_regfunc, syscall_unregfunc
|
||||
);
|
||||
|
||||
#endif /* CONFIG_HAVE_SYSCALL_TRACEPOINTS */
|
||||
|
||||
#endif /* _TRACE_EVENTS_SYSCALLS_H */
|
||||
|
||||
/* This part must be outside protection */
|
||||
#include <trace/define_trace.h>
|
||||
|
Reference in New Issue
Block a user