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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 24 Mar 2009 15:40:17 +0200
From:	Pekka Enberg <penberg@...helsinki.fi>
To:	mingo@...e.hu
Cc:	eduard.munteanu@...ux360.ro, linux-kernel@...r.kernel.org
Subject: [PATCH] kmemtrace: define tracepoints when CONFIG_TRACEPOINTS is
	enabled

From: Pekka Enberg <penberg@...helsinki.fi>

Impact: fix build

If CONFIG_KMEMTRACE is disabled but CONFIG_TRACEPOINTS is enabled, we need to
define the tracepoints; otherwise linkage fails:

    LD      .tmp_vmlinux1
  arch/x86/kernel/built-in.o: In function `sys_ioperm':
  (.text+0x3743): undefined reference to `__tracepoint_kmalloc'
  arch/x86/kernel/built-in.o: In function `sys_ioperm':
  (.text+0x3784): undefined reference to `__tracepoint_kmalloc'
  arch/x86/kernel/built-in.o: In function `cache_sysfs_init':
  intel_cacheinfo.c:(.cpuinit.text+0x5f3): undefined reference to `__tracepoint_kmalloc'
  intel_cacheinfo.c:(.cpuinit.text+0x768): undefined reference to `__tracepoint_kmalloc'
  arch/x86/mm/built-in.o: In function `reserve_memtype':
  (.text+0x2fb3): undefined reference to `__tracepoint_kmalloc'

Cc: Eduard - Gabriel Munteanu <eduard.munteanu@...ux360.ro>
Signed-off-by: Pekka Enberg <penberg@...helsinki.fi>
---
 kernel/trace/kmemtrace.c |   15 ---------------
 mm/util.c                |   16 ++++++++++++++++
 2 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/kernel/trace/kmemtrace.c b/kernel/trace/kmemtrace.c
index 53b9c7c..5011f4d 100644
--- a/kernel/trace/kmemtrace.c
+++ b/kernel/trace/kmemtrace.c
@@ -17,21 +17,6 @@
 #include "trace_output.h"
 #include "trace.h"
 
-/* Tracepoints definitions. */
-DEFINE_TRACE(kmalloc);
-DEFINE_TRACE(kmem_cache_alloc);
-DEFINE_TRACE(kmalloc_node);
-DEFINE_TRACE(kmem_cache_alloc_node);
-DEFINE_TRACE(kfree);
-DEFINE_TRACE(kmem_cache_free);
-
-EXPORT_TRACEPOINT_SYMBOL(kmalloc);
-EXPORT_TRACEPOINT_SYMBOL(kmem_cache_alloc);
-EXPORT_TRACEPOINT_SYMBOL(kmalloc_node);
-EXPORT_TRACEPOINT_SYMBOL(kmem_cache_alloc_node);
-EXPORT_TRACEPOINT_SYMBOL(kfree);
-EXPORT_TRACEPOINT_SYMBOL(kmem_cache_free);
-
 /* Select an alternative, minimalistic output than the original one */
 #define TRACE_KMEM_OPT_MINIMAL	0x1
 
diff --git a/mm/util.c b/mm/util.c
index 37eaccd..8d4b900 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -4,6 +4,7 @@
 #include <linux/module.h>
 #include <linux/err.h>
 #include <linux/sched.h>
+#include <linux/tracepoint.h>
 #include <asm/uaccess.h>
 
 /**
@@ -206,3 +207,18 @@ int __attribute__((weak)) get_user_pages_fast(unsigned long start,
 	return ret;
 }
 EXPORT_SYMBOL_GPL(get_user_pages_fast);
+
+/* Tracepoints definitions. */
+DEFINE_TRACE(kmalloc);
+DEFINE_TRACE(kmem_cache_alloc);
+DEFINE_TRACE(kmalloc_node);
+DEFINE_TRACE(kmem_cache_alloc_node);
+DEFINE_TRACE(kfree);
+DEFINE_TRACE(kmem_cache_free);
+
+EXPORT_TRACEPOINT_SYMBOL(kmalloc);
+EXPORT_TRACEPOINT_SYMBOL(kmem_cache_alloc);
+EXPORT_TRACEPOINT_SYMBOL(kmalloc_node);
+EXPORT_TRACEPOINT_SYMBOL(kmem_cache_alloc_node);
+EXPORT_TRACEPOINT_SYMBOL(kfree);
+EXPORT_TRACEPOINT_SYMBOL(kmem_cache_free);
-- 
1.5.4.3



--
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