All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Xenomai-core@domain.hid
Subject: [Xenomai-core] [PATCH] Fix cleanup of timebase proc entries
Date: Sun, 14 Oct 2007 17:31:53 +0200	[thread overview]
Message-ID: <47123669.8000008@domain.hid> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 265 bytes --]

Let's see how this works out: I've started to post my patches also to
the bug tracker at gna.org.

This one here fixes the broken cleanup of timerstat proc entries. Not
sure if I have caused the whole problem, but at least significant parts
of it. :-]

Jan

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: fix-timebase-proc-cleanup.patch --]
[-- Type: text/x-patch; name="fix-timebase-proc-cleanup.patch", Size: 2612 bytes --]

---
 ChangeLog                  |    5 +++++
 include/nucleus/timebase.h |    2 +-
 ksrc/nucleus/module.c      |   20 ++++++--------------
 3 files changed, 12 insertions(+), 15 deletions(-)

Index: xenomai/ChangeLog
===================================================================
--- xenomai.orig/ChangeLog
+++ xenomai/ChangeLog
@@ -1,3 +1,8 @@
+2007-10-14  Jan Kiszka <jan.kiszka@domain.hid>
+
+	* include/nucleus/timebase.h, ksrc/nucleus/modules.c: Fix cleanup of
+	timebase proc entries.
+
 2007-10-11  Johan Borkhuis  <j.borkhuis@domain.hid>
 
 	* include/rtdm/rtdm_driver.h: Add private data pointer to rtdm_device
Index: xenomai/include/nucleus/timebase.h
===================================================================
--- xenomai.orig/include/nucleus/timebase.h
+++ xenomai/include/nucleus/timebase.h
@@ -363,7 +363,7 @@ do {						\
 
 #define xntbase_umount()			\
 do {						\
-	xnpod_declare_tbase_proc(&nktbase);	\
+	xnpod_discard_tbase_proc(&nktbase);	\
 	removeq(&nktimebaseq, &nktbase.link);	\
 } while (0)
 
Index: xenomai/ksrc/nucleus/module.c
===================================================================
--- xenomai.orig/ksrc/nucleus/module.c
+++ xenomai/ksrc/nucleus/module.c
@@ -1082,18 +1082,10 @@ void xnpod_delete_proc(void)
 	remove_proc_entry("latency", rthal_proc_root);
 	remove_proc_entry("sched", rthal_proc_root);
 #ifdef CONFIG_XENO_OPT_STATS
-	{
-		xnholder_t *holder;
-		xntbase_t *tbase;
-
-		for (holder = getheadq(&nktimebaseq);
-		     holder != NULL; holder = nextq(&nktimebaseq, holder)) {
-			tbase = link2tbase(holder);
-			remove_proc_entry(tbase->name, tmstat_proc_root);
-		}
-		remove_proc_entry("timerstat", rthal_proc_root);
-		remove_proc_entry("stat", rthal_proc_root);
-	}
+	/* All timebases must have been deregistered now. */
+	XENO_ASSERT(NUCLEUS, !getheadq(&nktimebaseq), ;);
+	remove_proc_entry("timerstat", rthal_proc_root);
+	remove_proc_entry("stat", rthal_proc_root);
 #endif /* CONFIG_XENO_OPT_STATS */
 #if defined(CONFIG_SMP) && XENO_DEBUG(NUCLEUS)
 	remove_proc_entry("lock", rthal_proc_root);
@@ -1242,6 +1234,8 @@ void __exit __xeno_sys_exit(void)
 	xnshadow_cleanup();
 #endif /* CONFIG_XENO_OPT_PERVASIVE */
 
+	xntbase_umount();
+
 #if defined(__KERNEL__) &&  defined(CONFIG_PROC_FS)
 	xnpod_delete_proc();
 #endif /* __KERNEL__ && CONFIG_PROC_FS */
@@ -1260,8 +1254,6 @@ void __exit __xeno_sys_exit(void)
 #endif /* CONFIG_LTT */
 #endif /* __KERNEL__ */
 
-	xntbase_umount();
-
 	if (nkmsgbuf)
 		xnarch_free_host_mem(nkmsgbuf, XNPOD_FATAL_BUFSZ);
 

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

                 reply	other threads:[~2007-10-14 15:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47123669.8000008@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=Xenomai-core@domain.hid \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.