1 /* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
5 * wrapper around global_dirty_limit read. Using KALLSYMS with KALLSYMS_ALL
6 * to get its address when available, else we need to have a kernel that
7 * exports this variable to GPL modules.
9 * Copyright (C) 2013 Mentor Graphics Corp.
12 #ifndef _LTTNG_WRAPPER_WRITEBACK_H
13 #define _LTTNG_WRAPPER_WRITEBACK_H
15 #ifdef CONFIG_KALLSYMS_ALL
17 #include <linux/kallsyms.h>
18 #include <wrapper/kallsyms.h>
20 static struct wb_domain
*global_wb_domain_sym
;
23 unsigned long wrapper_global_dirty_limit(void)
25 if (!global_wb_domain_sym
)
26 global_wb_domain_sym
=
27 (void *) kallsyms_lookup_dataptr("global_wb_domain");
28 if (global_wb_domain_sym
) {
29 return global_wb_domain_sym
->dirty_limit
;
31 printk_once(KERN_WARNING
"LTTng: global_wb_domain symbol lookup failed.\n");
37 * Canary function to check for 'global_wb_domain' at compile time.
39 * From 'include/linux/writeback.h':
41 * extern struct wb_domain global_wb_domain;
44 unsigned long __canary__global_wb_domain(void)
46 return global_wb_domain
.dirty_limit
;
49 #else /* CONFIG_KALLSYMS_ALL */
51 #include <linux/writeback.h>
54 unsigned long wrapper_global_dirty_limit(void)
56 return global_dirty_limit
;
59 #endif /* CONFIG_KALLSYMS_ALL */
61 #endif /* _LTTNG_WRAPPER_WRITEBACK_H */
This page took 0.073781 seconds and 4 git commands to generate.