Skip to contentSkip to conversation

tracing/bkl: Add bkl ftrace events

tip:tracing/core Steven Rostedt 2 participants 2 messages Sep 26, 2009 – Sep 28, 2009 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 5 lines · tip-bot for Frederic Weisbecker

Commit-ID: 96a2c464de07d7c72988db851c029b204fc59108

(quoted diff) +3 -0
+#if !defined(_TRACE_BKL_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_BKL_H
+

Review

Quoted 10 lines
(quoted diff) +10 -0
+#include <linux/tracepoint.h>
+
+TRACE_EVENT(lock_kernel,
+
+	TP_PROTO(const char *func, const char *file, int line),
+
+	TP_ARGS(func, file, line),
+
+	TP_STRUCT__entry(
+		__field(	int,		lock_depth		)

FYI,

By your request I added this as a common field ;-)

With commit:

637e7e864103a7a68c1ce43ada27dfc25c0d113f

But since other utilities outside of ftrace may use this trace point, it may be OK to keep the duplicate information in the kernel lock API trace points.

-- Steve

Quoted 17 lines
(quoted diff) +17 -0
+		__field_ext(	const char *,	func, FILTER_PTR_STRING	)
+		__field_ext(	const char *,	file, FILTER_PTR_STRING	)
+		__field(	int,		line			)
+	),
+
+	TP_fast_assign(
+		/* We want to record the lock_depth after lock is acquired */
+		__entry->lock_depth = current->lock_depth + 1;
+		__entry->func = func;
+		__entry->file = file;
+		__entry->line = line;
+	),
+
+	TP_printk("depth: %d, %s:%d %s()", __entry->lock_depth,
+		  __entry->file, __entry->line, __entry->func)
+);
+
#2 lore raw
Quoted 24 lines · Steven Rostedt
Quoted 5 lines · tip-bot for Frederic Weisbecker

Commit-ID: 96a2c464de07d7c72988db851c029b204fc59108

(quoted diff) +3 -0
+#if !defined(_TRACE_BKL_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_BKL_H
+

Review

Quoted 10 lines
(quoted diff) +10 -0
+#include <linux/tracepoint.h>
+
+TRACE_EVENT(lock_kernel,
+
+	TP_PROTO(const char *func, const char *file, int line),
+
+	TP_ARGS(func, file, line),
+
+	TP_STRUCT__entry(
+		__field(	int,		lock_depth		)

FYI,

By your request I added this as a common field ;-)

With commit:

Quoted 7 lines

637e7e864103a7a68c1ce43ada27dfc25c0d113f

But since other utilities outside of ftrace may use this trace point, it may be OK to keep the duplicate information in the kernel lock API trace points.

-- Steve

Right, or may be we can define this tracepoint as a latency format user by default. It's not possible yet for an event to do that but I guess we can set a flag for this purpose or something...

Thanks.