1 #ifndef _LTTNG_WRAPPER_WRITEBACK_H
2 #define _LTTNG_WRAPPER_WRITEBACK_H
7 * wrapper around global_dirty_limit read. Using KALLSYMS with KALLSYMS_ALL
8 * to get its address when available, else we need to have a kernel that
9 * exports this variable to GPL modules.
11 * Copyright (C) 2013 Mentor Graphics Corp.
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Lesser General Public
15 * License as published by the Free Software Foundation; only
16 * version 2.1 of the License.
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Lesser General Public License for more details.
23 * You should have received a copy of the GNU Lesser General Public
24 * License along with this library; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
28 #ifdef CONFIG_KALLSYMS_ALL
30 #include <linux/kallsyms.h>
31 #include <wrapper/kallsyms.h>
33 static unsigned long *global_dirty_limit_sym
;
36 unsigned long wrapper_global_dirty_limit(void)
38 if (!global_dirty_limit_sym
)
39 global_dirty_limit_sym
=
40 (void *) kallsyms_lookup_dataptr("global_dirty_limit");
41 if (global_dirty_limit_sym
) {
42 return *global_dirty_limit_sym
;
44 printk(KERN_WARNING
"LTTng: global_dirty_limit symbol lookup failed.\n");
51 #include <linux/writeback.h>
54 unsigned long wrapper_global_dirty_limit(void)
56 return global_dirty_limit
;
61 #endif /* _LTTNG_WRAPPER_WRITEBACK_H */
This page took 0.033222 seconds and 5 git commands to generate.