From mboxrd@z Thu Jan 1 00:00:00 1970
From: Pat LaVarre
Subject: Re: favourite vfs globals
Date: 28 Nov 2003 14:43:59 -0700
Sender: linux-fsdevel-owner@vger.kernel.org
Message-ID: <1070055839.3518.6.camel@patrh9>
References: <1070053531.2340.40.camel@patrh9>
<1070054568.2340.50.camel@patrh9>
Mime-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Return-path:
Received: from email-out2.iomega.com ([147.178.1.83]:5579 "EHLO
email.iomega.com") by vger.kernel.org with ESMTP id S263517AbTK1Voc
(ORCPT );
Fri, 28 Nov 2003 16:44:32 -0500
Received: from royntex01.iomegacorp.com (unknown [147.178.90.120])
by email.iomega.com (Postfix) with ESMTP id 15C362669
for ; Fri, 28 Nov 2003 14:44:32 -0700 (MST)
To: linux-fsdevel@vger.kernel.org
In-Reply-To: <1070054568.2340.50.camel@patrh9>
List-Id: linux-fsdevel.vger.kernel.org
> > Which vfs globals are the most fun, in lk like 2.6.0-test11?
"That question I can't yet answer, but":
> > gdb vmlinux /proc/kcore
> > ... this approach to gdb takes a blurry snapshot of kernel memory and
> > then walks us thru a stale copy of all the bits.
>
> ... we ... see the global variables of modules this way,
> ... when the modules share those variables with non-module code i.e.
> code linked into the kernel before boot.
I see directly adding a global to a module does not work:
MODPOST
*** Warning: "hello_gdb" [fs/udf/udf.ko] undefined!
Ouch.
I'll go ask the kernelnewbies list to comment.
Pat LaVarre
diff -Nur linux-2.6.0-test11/drivers/block/ll_rw_blk.c linux/drivers/block/ll_rw_blk.c
--- linux-2.6.0-test11/drivers/block/ll_rw_blk.c 2003-11-26 13:42:58.000000000 -0700
+++ linux/drivers/block/ll_rw_blk.c 2003-11-28 14:29:53.613346536 -0700
@@ -2445,6 +2445,9 @@
}
}
+extern int hello_gdb;
+int hello_gdb = 'P';
+
static int __end_that_request_first(struct request *req, int uptodate,
int nr_bytes)
{
diff -Nur linux-2.6.0-test11/fs/udf/super.c linux/fs/udf/super.c
--- linux-2.6.0-test11/fs/udf/super.c 2003-11-26 13:44:41.000000000 -0700
+++ linux/fs/udf/super.c 2003-11-28 14:25:31.248232096 -0700
@@ -189,10 +189,15 @@
struct nls_table *nls_map;
};
+extern int hello_gdb;
+
static int __init init_udf_fs(void)
{
int err;
printk(KERN_NOTICE "udf: registering filesystem\n");
+ printk(KERN_NOTICE "udf: before incrementing hello_gdb\n");
+ ++hello_gdb;
+ printk(KERN_NOTICE "udf: after incrementing hello_gdb\n");
err = init_inodecache();
if (err)
goto out1;