summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorPekka Enberg <penberg@cs.helsinki.fi>2008-10-10 10:57:44 +0300
committerPekka Enberg <penberg@cs.helsinki.fi>2008-12-29 15:34:16 +0200
commitfaa97abe6a3673af268abb661c6b663252a911aa (patch)
treee0cb3c8279f8175ed5638cdeef348b757e6f1779 /mm
parent2e67624c22321fa40ad3aa89c307c84bd679d9b2 (diff)
downloadop-kernel-dev-faa97abe6a3673af268abb661c6b663252a911aa.zip
op-kernel-dev-faa97abe6a3673af268abb661c6b663252a911aa.tar.gz
kmemtrace: allow kmemtrace to be enabled after boot
The kmemtrace_init() function returns early if kmemtrace is disabled at boot causing kmemtrace_setup_late() to also bail out on NULL channel. This has the unfortunate side effect that none of the debugfs files needed to enable kmemtrace after boot are created. Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Diffstat (limited to 'mm')
-rw-r--r--mm/kmemtrace.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/mm/kmemtrace.c b/mm/kmemtrace.c
index 83ad1cc..f7a49c0 100644
--- a/mm/kmemtrace.c
+++ b/mm/kmemtrace.c
@@ -307,29 +307,29 @@ early_param("kmemtrace.subbufs", kmemtrace_set_subbufs);
void kmemtrace_init(void)
{
- if (!kmemtrace_enabled)
- return;
-
if (!kmemtrace_n_subbufs)
kmemtrace_n_subbufs = KMEMTRACE_DEF_N_SUBBUFS;
kmemtrace_chan = relay_open(NULL, NULL, KMEMTRACE_SUBBUF_SIZE,
kmemtrace_n_subbufs, &relay_callbacks,
NULL);
- if (unlikely(!kmemtrace_chan)) {
+ if (!kmemtrace_chan) {
printk(KERN_ERR "kmemtrace: could not open relay channel.\n");
return;
}
- if (unlikely(kmemtrace_start_probes()))
- goto probe_fail;
-
- printk(KERN_INFO "kmemtrace: early init successful.\n");
-
- return;
+ if (!kmemtrace_enabled) {
+ printk(KERN_INFO "kmemtrace: disabled. Pass "
+ "kemtrace.enable=yes as kernel parameter for "
+ "boot-time tracing.");
+ return;
+ }
+ if (kmemtrace_start_probes()) {
+ printk(KERN_ERR "kmemtrace: could not register marker probes!\n");
+ kmemtrace_cleanup();
+ return;
+ }
-probe_fail:
- printk(KERN_ERR "kmemtrace: could not register marker probes!\n");
- kmemtrace_cleanup();
+ printk(KERN_INFO "kmemtrace: enabled.\n");
}
OpenPOWER on IntegriCloud