aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.h
diff options
context:
space:
mode:
authorNeil Horman <nhorman@tuxdriver.com>2009-08-13 01:23:56 -0400
committerDavid S. Miller <davem@davemloft.net>2009-08-13 19:43:25 -0400
commit9ec04da7489d2c9ae01ea6e9b5fa313ccf3d35fb (patch)
tree487553ef03d65aa6821c2ea7685c5c5e1d430786 /kernel/trace/trace.h
parent5a165657bef7c47e5ff4cd138f7758ef6278e87b (diff)
net: skb ftracer - Add actual ftrace code to kernel (v3)
skb allocation / consumption correlator Add ftracer module to kernel to print out a list that correlates a process id, an skb it read, and the numa nodes on wich the process was running when it was read along with the numa node the skbuff was allocated on. Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Makefile | 1 trace.h | 19 ++++++ trace_skb_sources.c | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 174 insertions(+) Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r--kernel/trace/trace.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 8b9f4f6e9559..8a6281b2330b 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -11,6 +11,7 @@
11#include <trace/boot.h> 11#include <trace/boot.h>
12#include <linux/kmemtrace.h> 12#include <linux/kmemtrace.h>
13#include <trace/power.h> 13#include <trace/power.h>
14#include <trace/events/skb.h>
14 15
15#include <linux/trace_seq.h> 16#include <linux/trace_seq.h>
16#include <linux/ftrace_event.h> 17#include <linux/ftrace_event.h>
@@ -40,6 +41,7 @@ enum trace_type {
40 TRACE_KMEM_FREE, 41 TRACE_KMEM_FREE,
41 TRACE_POWER, 42 TRACE_POWER,
42 TRACE_BLK, 43 TRACE_BLK,
44 TRACE_SKB_SOURCE,
43 45
44 __TRACE_LAST_TYPE, 46 __TRACE_LAST_TYPE,
45}; 47};
@@ -171,6 +173,21 @@ struct trace_power {
171 struct power_trace state_data; 173 struct power_trace state_data;
172}; 174};
173 175
176struct skb_record {
177 pid_t pid; /* pid of the copying process */
178 int anid; /* node where skb was allocated */
179 int cnid; /* node to which skb was copied in userspace */
180 char ifname[IFNAMSIZ]; /* Name of the receiving interface */
181 int rx_queue; /* The rx queue the skb was received on */
182 int ccpu; /* Cpu the application got this frame from */
183 int len; /* length of the data copied */
184};
185
186struct trace_skb_event {
187 struct trace_entry ent;
188 struct skb_record event_data;
189};
190
174enum kmemtrace_type_id { 191enum kmemtrace_type_id {
175 KMEMTRACE_TYPE_KMALLOC = 0, /* kmalloc() or kfree(). */ 192 KMEMTRACE_TYPE_KMALLOC = 0, /* kmalloc() or kfree(). */
176 KMEMTRACE_TYPE_CACHE, /* kmem_cache_*(). */ 193 KMEMTRACE_TYPE_CACHE, /* kmem_cache_*(). */
@@ -323,6 +340,8 @@ extern void __ftrace_bad_type(void);
323 TRACE_SYSCALL_ENTER); \ 340 TRACE_SYSCALL_ENTER); \
324 IF_ASSIGN(var, ent, struct syscall_trace_exit, \ 341 IF_ASSIGN(var, ent, struct syscall_trace_exit, \
325 TRACE_SYSCALL_EXIT); \ 342 TRACE_SYSCALL_EXIT); \
343 IF_ASSIGN(var, ent, struct trace_skb_event, \
344 TRACE_SKB_SOURCE); \
326 __ftrace_bad_type(); \ 345 __ftrace_bad_type(); \
327 } while (0) 346 } while (0)
328 347