lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 22 Jul 2015 11:46:02 +0800
From:	Chunyan Zhang <zhang.chunyan@...aro.org>
To:	rostedt@...dmis.org, mingo@...nel.org
Cc:	mathieu.poirier@...aro.org, serge.broslavsky@...aro.org,
	broonie@...nel.org, alexander.shishkin@...ux.intel.com,
	linux-kernel@...r.kernel.org
Subject: [PATCH v4 2/3] trace: Introduce trace log output function for STM

This patch introduced a new function to print the trace events logs
to STM buffer when the trace event happens.

Signed-off-by: Chunyan Zhang <zhang.chunyan@...aro.org>
---
 kernel/trace/Makefile           |  1 +
 kernel/trace/trace_output_stm.c | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)
 create mode 100644 kernel/trace/trace_output_stm.c

diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
index 9b1044e..ac6c195 100644
--- a/kernel/trace/Makefile
+++ b/kernel/trace/Makefile
@@ -67,4 +67,5 @@ obj-$(CONFIG_UPROBE_EVENT) += trace_uprobe.o
 
 obj-$(CONFIG_TRACEPOINT_BENCHMARK) += trace_benchmark.o
 
+obj-$(CONFIG_TRACE_EVENT_STM) += trace_output_stm.o
 libftrace-y := ftrace.o
diff --git a/kernel/trace/trace_output_stm.c b/kernel/trace/trace_output_stm.c
new file mode 100644
index 0000000..42d5549
--- /dev/null
+++ b/kernel/trace/trace_output_stm.c
@@ -0,0 +1,22 @@
+#include <linux/trace_events.h>
+#include "trace_output.h"
+
+void trace_event_stm_log(struct trace_event_buffer *buffer)
+{
+	/* use static because iter can be a bit big for the stack */
+	static struct trace_iterator iter;
+	struct trace_entry *entry = (struct trace_entry *)buffer->entry;
+	struct trace_event *event = NULL;
+
+	iter.ent = entry;
+
+	if (entry)
+		event = ftrace_find_event(entry->type);
+
+	if (event && event->funcs) {
+		event->funcs->trace(&iter, 0, event);
+		stm_trace_event_write(iter.seq.buffer, iter.seq.seq.len);
+		iter.seq.seq.len = 0;
+	}
+}
+EXPORT_SYMBOL_GPL(trace_event_stm_log);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ