mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Autoconf --enable-debug-* cleanup
Cleanup the --enable-debug-* configure options, this has been pending for quite some time and I am glad I finally got to it. To summerize: 1) All SPL_AC_DEBUG_* macros were updated to be a more autoconf friendly. This mainly involved shift to the GNU approved usage of AC_ARG_ENABLE and ensuring AS_IF is used rather than directly using an if [ test ] construct. 2) --enable-debug-kmem=yes by default. This simply enabled keeping a running tally of total memory allocated and freed and reporting a memory leak if there was one at module unload. Additionally, it ensure /proc/spl/kmem/slab will exist by default which is handy. The overhead is low for this and it should not impact performance. 3) --enable-debug-kmem-tracking=no by default. This option was added to provide a configure option to enable to detailed memory allocation tracking. This support was always there but you had to know where to turn it on. By default this support is disabled because it is known to badly hurt performence, however it is invaluable when chasing a memory leak. 4) --enable-debug-kstat removed. After further reflection I can't see why you would ever really want to turn this support off. It is now always on which had the nice side effect of simplifying the proc handling code in spl-proc.c. We can now always assume the top level directory will be there. 5) --enable-debug-callb removed. This never really did anything, it was put in provisionally because it might have been needed. It turns out it was not so I am just removing it to prevent confusion.
This commit is contained in:
@@ -8,11 +8,7 @@ extern "C" {
|
||||
#include <linux/module.h>
|
||||
#include <sys/mutex.h>
|
||||
|
||||
#ifdef DEBUG_CALLB
|
||||
#define CALLB_CPR_ASSERT(cp) ASSERT(MUTEX_HELD((cp)->cc_lockp));
|
||||
#else
|
||||
#define CALLB_CPR_ASSERT(cp) (void)0
|
||||
#endif
|
||||
|
||||
typedef struct callb_cpr {
|
||||
kmutex_t *cc_lockp;
|
||||
|
||||
@@ -32,7 +32,6 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#undef DEBUG_KMEM_UNIMPLEMENTED
|
||||
#undef DEBUG_KMEM_TRACKING /* Per-allocation memory tracking */
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
@@ -27,10 +27,6 @@
|
||||
#ifndef _SPL_KSTAT_H
|
||||
#define _SPL_KSTAT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
@@ -155,7 +151,6 @@ typedef struct kstat_timer {
|
||||
int kstat_init(void);
|
||||
void kstat_fini(void);
|
||||
|
||||
#ifdef DEBUG_KSTAT
|
||||
extern kstat_t *__kstat_create(const char *ks_module, int ks_instance,
|
||||
const char *ks_name, const char *ks_class,
|
||||
uchar_t ks_type, uint_t ks_ndata,
|
||||
@@ -167,17 +162,5 @@ extern void __kstat_delete(kstat_t *ksp);
|
||||
#define kstat_install(k) __kstat_install(k)
|
||||
#define kstat_delete(k) __kstat_delete(k)
|
||||
|
||||
#else
|
||||
|
||||
#define kstat_create(m,i,n,c,t,s,f) (NULL)
|
||||
#define kstat_install(k) ((void)0)
|
||||
#define kstat_delete(k) ((void)0)
|
||||
|
||||
#endif /* DEBUG_KSTAT */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _SPL_KSTAT_H */
|
||||
|
||||
|
||||
@@ -48,12 +48,10 @@
|
||||
#define spl_unregister_sysctl_table(t) unregister_sysctl_table(t)
|
||||
#endif /* CONFIG_SYSCTL */
|
||||
|
||||
#ifdef DEBUG_KSTAT
|
||||
extern struct proc_dir_entry *proc_spl_kstat;
|
||||
struct proc_dir_entry *proc_dir_entry_find(struct proc_dir_entry *root,
|
||||
const char *str);
|
||||
int proc_dir_entries(struct proc_dir_entry *root);
|
||||
#endif
|
||||
|
||||
int proc_init(void);
|
||||
void proc_fini(void);
|
||||
|
||||
Reference in New Issue
Block a user