FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Crash Utility

 
 
LinkBack Thread Tools
 
Old 11-08-2010, 03:58 AM
Toshikazu Nakayama
 
Default module's percpu basic procedure.

- Initialize new member at module_init()
- Make static SEC_FOUND to .data..percpu and .data.percpu sections
at store_section_data()
These can not read from /dev/mem or core file.
(not include in kallsyms nor module_core.)
- Install syms into st->mod_load_namespace at store_load_module_symbols()
module's percpu section include bfd of module object.
The syment.value is sum of bfd value and module.percpu.

Signed-off-by: Toshikazu Nakayama <nakayama.ts@ncos.nec.co.jp>
---
kernel.c | 1 +
symbols.c | 12 +++++++++++-
2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/kernel.c b/kernel.c
index 9ba0dc4..3439c5a 100755
--- a/kernel.c
+++ b/kernel.c
@@ -2694,6 +2694,7 @@ module_init(void)
MEMBER_OFFSET_INIT(module_init_size, "module", "init_size");
MEMBER_OFFSET_INIT(module_init_text_size, "module",
"init_text_size");
+ MEMBER_OFFSET_INIT(module_percpu, "module", "percpu");

/*
* Make sure to pick the kernel "modules" list_head symbol,
diff --git a/symbols.c b/symbols.c
index ec9c893..0a1d170 100755
--- a/symbols.c
+++ b/symbols.c
@@ -1349,6 +1349,7 @@ store_module_symbols_v2(ulong total, int mods_installed)
lm->mod_ext_symcnt = mcnt;
lm->mod_init_module_ptr = ULONG(modbuf +
OFFSET(module_module_init));
+ lm->mod_percpu = ULONG(modbuf + OFFSET(module_percpu));
if (THIS_KERNEL_VERSION >= LINUX(2,6,27)) {
lm->mod_etext_guess = lm->mod_base +
UINT(modbuf + OFFSET(module_core_text_size));
@@ -8346,6 +8347,10 @@ store_section_data(struct load_module *lm, bfd *bfd, asection *section)
lm->mod_section_data[i].section = section;
lm->mod_section_data[i].priority = prio;
lm->mod_section_data[i].flags = section->flags & ~SEC_FOUND;
+ /* percpu section isn't included in kallsyms nor module_core area. */
+ if (lm->mod_percpu &&
+ (STREQ(name,".data.percpu") || STREQ(name, ".data..percpu")))
+ lm->mod_section_data[i].flags |= SEC_FOUND;
lm->mod_section_data[i].size = bfd_section_size(bfd, section);
lm->mod_section_data[i].offset = 0;
if (strlen(name) < MAX_MOD_SEC_NAME)
@@ -9314,7 +9319,12 @@ store_load_module_symbols(bfd *bfd, int dynamic, void *minisyms,
else if ((spx = kallsyms_module_symbol(lm, &syminfo))) {
syminfo.value = spx->value;
found = TRUE;
- } else {
+ } else if (lm->mod_percpu &&
+ (STREQ(secname, ".data.percpu") ||
+ STREQ(secname, ".data..percpu"))) {
+ syminfo.value += lm->mod_percpu;
+ found = TRUE;
+ } else {
syminfo.value += lm->mod_section_data[i].offset + lm->mod_base;
found = TRUE;
}
--
1.7.3.2.161.g3089c

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 

Thread Tools




All times are GMT. The time now is 12:58 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org