mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robert Richter <robert.richter@amd.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Tony Luck <tony.luck@intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Robert Richter <robert.richter@amd.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Mike Travis <travis@sgi.com>
Subject: [PATCH] cpumask: modifiy oprofile initialization
Date: Thu, 22 Jan 2009 14:14:14 +0100	[thread overview]
Message-ID: <1232630055-32451-1-git-send-email-robert.richter@amd.com> (raw)
In-Reply-To: <20090122131153.GP21604@erda.amd.com>

Delta patch to f7df8ed164996cd2c6aca9674388be6ef78d8b37 for
tip/cpus4096.

Moved initialization to sync_start()/sync_stop(). No changes needed in
buffer_sync.h and oprof.c anymore.

Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Mike Travis <travis@sgi.com>
Signed-off-by: Robert Richter <robert.richter@amd.com>
---
 drivers/oprofile/buffer_sync.c |   20 ++++++--------------
 drivers/oprofile/buffer_sync.h |    4 ----
 drivers/oprofile/oprof.c       |    9 +--------
 3 files changed, 7 insertions(+), 26 deletions(-)

diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c
index c3ea5fa..8574622 100644
--- a/drivers/oprofile/buffer_sync.c
+++ b/drivers/oprofile/buffer_sync.c
@@ -154,6 +154,10 @@ int sync_start(void)
 {
 	int err;
 
+	if (!alloc_cpumask_var(&marked_cpus, GFP_KERNEL))
+		return -ENOMEM;
+	cpumask_clear(marked_cpus);
+
 	start_cpu_work();
 
 	err = task_handoff_register(&task_free_nb);
@@ -179,6 +183,7 @@ out2:
 	task_handoff_unregister(&task_free_nb);
 out1:
 	end_sync();
+	free_cpumask_var(marked_cpus);
 	goto out;
 }
 
@@ -190,6 +195,7 @@ void sync_stop(void)
 	profile_event_unregister(PROFILE_TASK_EXIT, &task_exit_nb);
 	task_handoff_unregister(&task_free_nb);
 	end_sync();
+	free_cpumask_var(marked_cpus);
 }
 
 
@@ -565,20 +571,6 @@ void sync_buffer(int cpu)
 	mutex_unlock(&buffer_mutex);
 }
 
-int __init buffer_sync_init(void)
-{
-	if (!alloc_cpumask_var(&marked_cpus, GFP_KERNEL))
-		return -ENOMEM;
-
-	cpumask_clear(marked_cpus);
-		return 0;
-}
-
-void __exit buffer_sync_cleanup(void)
-{
-	free_cpumask_var(marked_cpus);
-}
-
 /* The function can be used to add a buffer worth of data directly to
  * the kernel buffer. The buffer is assumed to be a circular buffer.
  * Take the entries from index start and end at index end, wrapping
diff --git a/drivers/oprofile/buffer_sync.h b/drivers/oprofile/buffer_sync.h
index 0ebf5db..3110732 100644
--- a/drivers/oprofile/buffer_sync.h
+++ b/drivers/oprofile/buffer_sync.h
@@ -19,8 +19,4 @@ void sync_stop(void);
 /* sync the given CPU's buffer */
 void sync_buffer(int cpu);
 
-/* initialize/destroy the buffer system. */
-int buffer_sync_init(void);
-void buffer_sync_cleanup(void);
-
 #endif /* OPROFILE_BUFFER_SYNC_H */
diff --git a/drivers/oprofile/oprof.c b/drivers/oprofile/oprof.c
index ced39f6..3cffce9 100644
--- a/drivers/oprofile/oprof.c
+++ b/drivers/oprofile/oprof.c
@@ -183,10 +183,6 @@ static int __init oprofile_init(void)
 {
 	int err;
 
-	err = buffer_sync_init();
-	if (err)
-		return err;
-
 	err = oprofile_arch_init(&oprofile_ops);
 
 	if (err < 0 || timer) {
@@ -195,10 +191,8 @@ static int __init oprofile_init(void)
 	}
 
 	err = oprofilefs_register();
-	if (err) {
+	if (err)
 		oprofile_arch_exit();
-		buffer_sync_cleanup();
-	}
 
 	return err;
 }
@@ -208,7 +202,6 @@ static void __exit oprofile_exit(void)
 {
 	oprofilefs_unregister();
 	oprofile_arch_exit();
-	buffer_sync_cleanup();
 }
 
 
-- 
1.6.1



  reply	other threads:[~2009-01-22 13:16 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-07 19:58 [PATCH 0/5] cpumask: more cpumask updates Mike Travis
2009-01-07 19:58 ` [PATCH 1/5] cpumask: update irq_desc to use cpumask_var_t Mike Travis
2009-01-07 20:27   ` Yinghai Lu
2009-01-07 22:32     ` Mike Travis
2009-01-08  3:15       ` Yinghai Lu
2009-01-08 15:45         ` Mike Travis
2009-01-08 19:31           ` Yinghai Lu
2009-01-08 18:40         ` [PATCH 1/5] cpumask: update irq_desc to use cpumask_var_t: fix Mike Travis
2009-01-07 19:58 ` [PATCH 2/5] cpumask: Use topology_core_cpumask()/topology_thread_cpumask() Mike Travis
2009-01-19 17:11   ` Ben Hutchings
2009-01-07 19:58 ` [PATCH 3/5] cpumask: convert misc driver functions Mike Travis
2009-01-10 10:57   ` Rusty Russell
2009-01-16 18:42   ` Tony Luck
2009-01-16 18:55     ` Mike Travis
2009-01-16 22:02     ` Mike Travis
2009-01-22 13:11   ` Robert Richter
2009-01-22 13:14     ` Robert Richter [this message]
2009-01-22 13:37       ` [PATCH] cpumask: modifiy oprofile initialization Ingo Molnar
2009-01-22 17:20         ` Mike Travis
2009-01-22 17:40           ` Ingo Molnar
2009-01-22 19:41         ` Mike Travis
2009-01-22 16:56       ` Mike Travis
2009-01-23 14:12         ` Robert Richter
2009-01-07 19:58 ` [PATCH 4/5] cpumask: convert drivers/net/sfc Mike Travis
2009-01-19 17:08   ` Ben Hutchings
     [not found]     ` <200901201209.34854.rusty@rustcorp.com.au>
2009-01-20 18:26       ` [PATCH 4/5] cpumask: convert drivers/net/sfc [PATCH supplied] Mike Travis
2009-01-26 15:04       ` [PATCH] sfc: modify allocation error message Mike Travis
2009-01-27 12:13         ` Ben Hutchings
2009-01-07 19:58 ` [PATCH 5/5] cpumask: convert other misc kernel functions Mike Travis
2009-01-07 20:52 ` [PATCH 0/5] cpumask: more cpumask updates Ingo Molnar
2009-01-07 21:20   ` Mike Travis

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=1232630055-32451-1-git-send-email-robert.richter@amd.com \
    --to=robert.richter@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rusty@rustcorp.com.au \
    --cc=tony.luck@intel.com \
    --cc=travis@sgi.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®