[lttng-dev] [PATCH lttng-modules] Fix: Add gfpflags.h wrapper for kernel >= 4.6.0

Michael Jeanson mjeanson at efficios.com
Tue Apr 5 19:07:51 UTC 2016


The gfpflags.h header file was renamed to mmflags.h in the 4.6.0
release, see the upstream commit:

  commit 420adbe9fc1a45187cfa74df9dbfd72272c4e2fa
  Author: Vlastimil Babka <vbabka at suse.cz>
  Date:   Tue Mar 15 14:55:52 2016 -0700

      mm, tracing: unify mm flags handling in tracepoints and printk

Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
 instrumentation/events/lttng-module/btrfs.h      |  2 +-
 instrumentation/events/lttng-module/compaction.h |  2 +-
 wrapper/gfpflags.h                               | 32 ++++++++++++++++++++++++
 3 files changed, 34 insertions(+), 2 deletions(-)
 create mode 100644 wrapper/gfpflags.h

diff --git a/instrumentation/events/lttng-module/btrfs.h b/instrumentation/events/lttng-module/btrfs.h
index 2f67d5f..2088431 100644
--- a/instrumentation/events/lttng-module/btrfs.h
+++ b/instrumentation/events/lttng-module/btrfs.h
@@ -6,7 +6,7 @@
 
 #include <probes/lttng-tracepoint-event.h>
 #include <linux/writeback.h>
-#include <trace/events/gfpflags.h>
+#include <wrapper/gfpflags.h>
 #include <linux/version.h>
 
 #ifndef _TRACE_BTRFS_DEF_
diff --git a/instrumentation/events/lttng-module/compaction.h b/instrumentation/events/lttng-module/compaction.h
index 64579fe..7b4348c 100644
--- a/instrumentation/events/lttng-module/compaction.h
+++ b/instrumentation/events/lttng-module/compaction.h
@@ -7,7 +7,7 @@
 #include <probes/lttng-tracepoint-event.h>
 #include <linux/types.h>
 #include <linux/version.h>
-#include <trace/events/gfpflags.h>
+#include <wrapper/gfpflags.h>
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)
 
diff --git a/wrapper/gfpflags.h b/wrapper/gfpflags.h
new file mode 100644
index 0000000..26e78e6
--- /dev/null
+++ b/wrapper/gfpflags.h
@@ -0,0 +1,32 @@
+#ifndef _LTTNG_WRAPPER_GFPFLAGS_H
+#define _LTTNG_WRAPPER_GFPFLAGS_H
+
+/*
+ * wrapper/gfpflags.h
+ *
+ * wrapper around trace/events/gfpflags.h.
+ *
+ * Copyright (C) 2016 Michael Jeanson <mjeanson at efficios.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; only
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0))
+#include <trace/events/mmflags.h>
+#else
+#include <trace/events/gfpflags.h>
+#endif
+
+#endif /* _LTTNG_WRAPPER_GFPFLAGS_H */
-- 
2.7.4



More information about the lttng-dev mailing list