From d60f20339175619c0dd8b90aac184e4382ad6a74 Mon Sep 17 00:00:00 2001
From: Luis Gerhorst <luis.gerhorst@fau.de>
Date: Thu, 28 Jun 2018 21:29:41 +0200
Subject: [PATCH] measuremore: insert checkpoint into tracepoint macro

Required to discover conditions that lead to measurement results
delivered by measuremore core.

By hooking into the existing kernel tracpoints macro, we can record a
checkpoint whenever it is used. Kernel checkpoints exist at various
places inside existing kernel code, thus this allows for a detailed
analysis but in return introduces more overhead than the default
measuremore checkpoints.
---
 include/linux/tracepoint.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index be586c632a0c0..28ac87d84f054 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -20,6 +20,7 @@
 #include <linux/cpumask.h>
 #include <linux/rcupdate.h>
 #include <linux/tracepoint-defs.h>
+#include <linux/measuremore.h>
 
 struct module;
 struct tracepoint;
@@ -182,6 +183,7 @@ extern void syscall_unregfunc(void);
 	extern struct tracepoint __tracepoint_##name;			\
 	static inline void trace_##name(proto)				\
 	{								\
+		memo_checkpoint("trace_" #name);			\
 		if (static_key_false(&__tracepoint_##name.key))		\
 			__DO_TRACE(&__tracepoint_##name,		\
 				TP_PROTO(data_proto),			\
-- 
GitLab