All of lore.kernel.org
 help / color / mirror / Atom feed
* Problems exporting symbols from the main kernel to a module
@ 2015-04-11 15:53 Eduardo Cruz
  2015-04-11 18:16 ` Eduardo Cruz
  0 siblings, 1 reply; 2+ messages in thread
From: Eduardo Cruz @ 2015-04-11 15:53 UTC (permalink / raw)
  To: linux-kernel

I am modifying the kernel to provide some statistics about memory usage.
For that, part of my code is added in the main kernel, and part is in a module.

The kernel version is 2.6.32.
The target machine is an ia64 machine.
Newer kernels do not boot the machine.
I'm using a debian distribution.

In the main kernel, in arch/ia64/mm/fault.c, I added the following
function pointer:

void (*module_task_added)(struct task_struct *) = NULL;
EXPORT_SYMBOL(module_task_added);

In the module, i have:

extern void (*module_task_added)(struct task_struct *);

void handler_func (struct task_struct *task) {
    ...
}

int init_module () {
    module_task_added = handler_func;
}

when I compile the module, i get the following warning:

WARNING: "module_task_added"
[/home/ehmcruz/linux-tammu/tammu-module/tammu.ko] undefined!


when I try to load the module, it fails resolving the symbol module_task_added:

[ 3306.496239] tammu: Unknown symbol module_task_added


I already verified that the symbol is present in /proc/kallsyms:

a000000100ac1b78 S module_task_added

however, I don't know why, the variable doesn't appear in Module.symvers

Anyone can help me?

thanks in advance

-- 
Eduardo Henrique Molina da Cruz
PhD student
Parallel and Distributed Processing Group
Federal University of Rio Grande do Sul (UFRGS)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Problems exporting symbols from the main kernel to a module
  2015-04-11 15:53 Problems exporting symbols from the main kernel to a module Eduardo Cruz
@ 2015-04-11 18:16 ` Eduardo Cruz
  0 siblings, 0 replies; 2+ messages in thread
From: Eduardo Cruz @ 2015-04-11 18:16 UTC (permalink / raw)
  To: linux-kernel

I solved the issue.
Nevermind.

2015-04-11 12:53 GMT-03:00 Eduardo Cruz <eduardohmdacruz@gmail.com>:
> I am modifying the kernel to provide some statistics about memory usage.
> For that, part of my code is added in the main kernel, and part is in a module.
>
> The kernel version is 2.6.32.
> The target machine is an ia64 machine.
> Newer kernels do not boot the machine.
> I'm using a debian distribution.
>
> In the main kernel, in arch/ia64/mm/fault.c, I added the following
> function pointer:
>
> void (*module_task_added)(struct task_struct *) = NULL;
> EXPORT_SYMBOL(module_task_added);
>
> In the module, i have:
>
> extern void (*module_task_added)(struct task_struct *);
>
> void handler_func (struct task_struct *task) {
>     ...
> }
>
> int init_module () {
>     module_task_added = handler_func;
> }
>
> when I compile the module, i get the following warning:
>
> WARNING: "module_task_added"
> [/home/ehmcruz/linux-tammu/tammu-module/tammu.ko] undefined!
>
>
> when I try to load the module, it fails resolving the symbol module_task_added:
>
> [ 3306.496239] tammu: Unknown symbol module_task_added
>
>
> I already verified that the symbol is present in /proc/kallsyms:
>
> a000000100ac1b78 S module_task_added
>
> however, I don't know why, the variable doesn't appear in Module.symvers
>
> Anyone can help me?
>
> thanks in advance
>
> --
> Eduardo Henrique Molina da Cruz
> PhD student
> Parallel and Distributed Processing Group
> Federal University of Rio Grande do Sul (UFRGS)



-- 
Eduardo Henrique Molina da Cruz
PhD student
Parallel and Distributed Processing Group
Federal University of Rio Grande do Sul (UFRGS)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-11 18:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-11 15:53 Problems exporting symbols from the main kernel to a module Eduardo Cruz
2015-04-11 18:16 ` Eduardo Cruz

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.