diff options
author | Mark Wielaard <mjw@redhat.com> | 2008-10-04 00:02:54 +0200 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2008-10-04 00:02:54 +0200 |
commit | e680089c477ee4b1dbc1bd64b7f2cb6eac61adfc (patch) | |
tree | bc803577ca3b0904c98041644597bd750a775d0e /runtime/procfs.c | |
parent | 748eea887135ac44f5c4b0a7499225d4cb2cbefe (diff) | |
download | systemtap-steved-e680089c477ee4b1dbc1bd64b7f2cb6eac61adfc.tar.gz systemtap-steved-e680089c477ee4b1dbc1bd64b7f2cb6eac61adfc.tar.xz systemtap-steved-e680089c477ee4b1dbc1bd64b7f2cb6eac61adfc.zip |
procfs dir_entry count warning on removal depends on kernel version.
Diffstat (limited to 'runtime/procfs.c')
-rw-r--r-- | runtime/procfs.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/runtime/procfs.c b/runtime/procfs.c index 1b1d5447..8aeda14c 100644 --- a/runtime/procfs.c +++ b/runtime/procfs.c @@ -24,15 +24,22 @@ static struct proc_dir_entry *_stp_proc_root = NULL; void _stp_close_procfs(void); +// 2.6.24 fixed proc_dir_entry refcounting. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) +#define LAST_ENTRY_COUNT 0 +#else +#define LAST_ENTRY_COUNT 1 +#endif + /* * Removes /proc/systemtap/{module_name} and /proc/systemtap (if empty) */ void _stp_rmdir_proc_module(void) { if (_stp_proc_root && _stp_proc_root->subdir == NULL) { - if (atomic_read(&_stp_proc_root->count)) - _stp_warn("Removal of /proc/systemtap/%s\nis deferred until it is no longer in use.\n" - "Systemtap module removal will block.\n", THIS_MODULE->name); + if (atomic_read(&_stp_proc_root->count) != LAST_ENTRY_COUNT) + _stp_warn("(%d,%d)Removal of /proc/systemtap/%s\nis deferred until it is no longer in use.\n" + "Systemtap module removal will block.\n", atomic_read(&_stp_proc_root->count), LAST_ENTRY_COUNT, THIS_MODULE->name); remove_proc_entry(THIS_MODULE->name, _stp_proc_stap); _stp_proc_root = NULL; } |