public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts/gdb: Fix loading of modules information
@ 2016-03-29  6:41 Daniel Wagner
  2016-03-29  6:58 ` [PATCH v2] " Daniel Wagner
  2016-03-29  6:59 ` [PATCH] " Jan Kiszka
  0 siblings, 2 replies; 6+ messages in thread
From: Daniel Wagner @ 2016-03-29  6:41 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: linux-kernel, Daniel Wagner, Jiri Kosina, Rusty Russell

From: Daniel Wagner <daniel.wagner@bmw-carit.de>

The module_core symbols is not available due to

7523e4dc5057 ("module: use a structure to encapsulate layout.")

The base address of the module is now stored inside
struct module_layout.

Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Rusty Russell <rusty@rustcorp.com.au>
---
 scripts/gdb/linux/modules.py | 3 ++-
 scripts/gdb/linux/symbols.py | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/scripts/gdb/linux/modules.py b/scripts/gdb/linux/modules.py
index 25db8cf..cffe078 100644
--- a/scripts/gdb/linux/modules.py
+++ b/scripts/gdb/linux/modules.py
@@ -74,7 +74,8 @@ class LxLsmod(gdb.Command):
 
         for module in module_list():
             gdb.write("{address} {name:<19} {size:>8}  {ref}".format(
-                address=str(module['module_core']).split()[0],
+                module_layout=module['core_layout']
+                addressr=str(module_layout['base'])
                 name=module['name'].string(),
                 size=str(module['core_size']),
                 ref=str(module['refcnt']['counter'])))
diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py
index 627750c..8650ede 100644
--- a/scripts/gdb/linux/symbols.py
+++ b/scripts/gdb/linux/symbols.py
@@ -108,7 +108,8 @@ lx-symbols command."""
 
     def load_module_symbols(self, module):
         module_name = module['name'].string()
-        module_addr = str(module['module_core']).split()[0]
+        module_layout = module['core_layout']
+        module_addr = str(module_layout['base'])
 
         module_file = self._get_module_file(module_name)
         if not module_file and not self.module_files_updated:
-- 
2.5.5

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

* [PATCH v2] scripts/gdb: Fix loading of modules information
  2016-03-29  6:41 [PATCH] scripts/gdb: Fix loading of modules information Daniel Wagner
@ 2016-03-29  6:58 ` Daniel Wagner
  2016-03-29  6:59 ` [PATCH] " Jan Kiszka
  1 sibling, 0 replies; 6+ messages in thread
From: Daniel Wagner @ 2016-03-29  6:58 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: linux-kernel, Daniel Wagner, Jiri Kosina, Rusty Russell

From: Daniel Wagner <daniel.wagner@bmw-carit.de>

The module_core symbols is not available due to

7523e4dc5057 ("module: use a structure to encapsulate layout.")

The base address of the module is now stored inside
struct module_layout.

Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Rusty Russell <rusty@rustcorp.com.au>
---
Obviously, it's too early to send patches. This times it even works.

scripts/gdb/linux/modules.py | 3 ++-
 scripts/gdb/linux/symbols.py | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/scripts/gdb/linux/modules.py b/scripts/gdb/linux/modules.py
index 25db8cf..a1ec0f3 100644
--- a/scripts/gdb/linux/modules.py
+++ b/scripts/gdb/linux/modules.py
@@ -73,8 +73,9 @@ class LxLsmod(gdb.Command):
                 "        " if utils.get_long_type().sizeof == 8 else ""))
 
         for module in module_list():
+            module_layout=module['core_layout']
             gdb.write("{address} {name:<19} {size:>8}  {ref}".format(
-                address=str(module['module_core']).split()[0],
+                address=str(module_layout['base']),
                 name=module['name'].string(),
                 size=str(module['core_size']),
                 ref=str(module['refcnt']['counter'])))
diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py
index 627750c..8650ede 100644
--- a/scripts/gdb/linux/symbols.py
+++ b/scripts/gdb/linux/symbols.py
@@ -108,7 +108,8 @@ lx-symbols command."""
 
     def load_module_symbols(self, module):
         module_name = module['name'].string()
-        module_addr = str(module['module_core']).split()[0]
+        module_layout = module['core_layout']
+        module_addr = str(module_layout['base'])
 
         module_file = self._get_module_file(module_name)
         if not module_file and not self.module_files_updated:
-- 
2.5.5

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

* Re: [PATCH] scripts/gdb: Fix loading of modules information
  2016-03-29  6:41 [PATCH] scripts/gdb: Fix loading of modules information Daniel Wagner
  2016-03-29  6:58 ` [PATCH v2] " Daniel Wagner
@ 2016-03-29  6:59 ` Jan Kiszka
  2016-03-29  7:13   ` Daniel Wagner
  1 sibling, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2016-03-29  6:59 UTC (permalink / raw)
  To: Daniel Wagner; +Cc: linux-kernel, Daniel Wagner, Jiri Kosina, Rusty Russell

On 2016-03-29 08:41, Daniel Wagner wrote:
> From: Daniel Wagner <daniel.wagner@bmw-carit.de>
> 
> The module_core symbols is not available due to
> 
> 7523e4dc5057 ("module: use a structure to encapsulate layout.")
> 
> The base address of the module is now stored inside
> struct module_layout.
> 
> Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
> Cc: Jiri Kosina <jkosina@suse.cz>
> Cc: Rusty Russell <rusty@rustcorp.com.au>
> ---
>  scripts/gdb/linux/modules.py | 3 ++-
>  scripts/gdb/linux/symbols.py | 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/gdb/linux/modules.py b/scripts/gdb/linux/modules.py
> index 25db8cf..cffe078 100644
> --- a/scripts/gdb/linux/modules.py
> +++ b/scripts/gdb/linux/modules.py
> @@ -74,7 +74,8 @@ class LxLsmod(gdb.Command):
>  
>          for module in module_list():
>              gdb.write("{address} {name:<19} {size:>8}  {ref}".format(
> -                address=str(module['module_core']).split()[0],
> +                module_layout=module['core_layout']
> +                addressr=str(module_layout['base'])

This looks untested.

>                  name=module['name'].string(),
>                  size=str(module['core_size']),
>                  ref=str(module['refcnt']['counter'])))
> diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py
> index 627750c..8650ede 100644
> --- a/scripts/gdb/linux/symbols.py
> +++ b/scripts/gdb/linux/symbols.py
> @@ -108,7 +108,8 @@ lx-symbols command."""
>  
>      def load_module_symbols(self, module):
>          module_name = module['name'].string()
> -        module_addr = str(module['module_core']).split()[0]
> +        module_layout = module['core_layout']
> +        module_addr = str(module_layout['base'])
>  
>          module_file = self._get_module_file(module_name)
>          if not module_file and not self.module_files_updated:
> 

Thanks, but ad4db3b24a should already be on its way into stable.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux

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

* Re: [PATCH] scripts/gdb: Fix loading of modules information
  2016-03-29  6:59 ` [PATCH] " Jan Kiszka
@ 2016-03-29  7:13   ` Daniel Wagner
  2016-03-29  7:22     ` Jan Kiszka
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Wagner @ 2016-03-29  7:13 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: linux-kernel, Daniel Wagner, Jiri Kosina, Rusty Russell

On 03/29/2016 08:59 AM, Jan Kiszka wrote:
> On 2016-03-29 08:41, Daniel Wagner wrote:
>>          for module in module_list():
>>              gdb.write("{address} {name:<19} {size:>8}  {ref}".format(
>> -                address=str(module['module_core']).split()[0],
>> +                module_layout=module['core_layout']
>> +                addressr=str(module_layout['base'])
> 
> This looks untested.

Yep, I send out the untested version. Need more coffee...

>>                  name=module['name'].string(),
>>                  size=str(module['core_size']),
>>                  ref=str(module['refcnt']['counter'])))
>> diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py
>> index 627750c..8650ede 100644
>> --- a/scripts/gdb/linux/symbols.py
>> +++ b/scripts/gdb/linux/symbols.py
>> @@ -108,7 +108,8 @@ lx-symbols command."""
>>  
>>      def load_module_symbols(self, module):
>>          module_name = module['name'].string()
>> -        module_addr = str(module['module_core']).split()[0]
>> +        module_layout = module['core_layout']
>> +        module_addr = str(module_layout['base'])
>>  
>>          module_file = self._get_module_file(module_name)
>>          if not module_file and not self.module_files_updated:
>>
> 
> Thanks, but ad4db3b24a should already be on its way into stable.

Ah, I haven't got that fix yet because I am still on a older branch.
Also my google-foo didn't help.

Sorry about that noise.

cheers,
daniel

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

* Re: [PATCH] scripts/gdb: Fix loading of modules information
  2016-03-29  7:13   ` Daniel Wagner
@ 2016-03-29  7:22     ` Jan Kiszka
  2016-03-31  6:17       ` Daniel Wagner
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2016-03-29  7:22 UTC (permalink / raw)
  To: Daniel Wagner
  Cc: linux-kernel, Daniel Wagner, Jiri Kosina, Rusty Russell,
	Kieran Bingham

On 2016-03-29 09:13, Daniel Wagner wrote:
> On 03/29/2016 08:59 AM, Jan Kiszka wrote:
>> On 2016-03-29 08:41, Daniel Wagner wrote:
>>>          for module in module_list():
>>>              gdb.write("{address} {name:<19} {size:>8}  {ref}".format(
>>> -                address=str(module['module_core']).split()[0],
>>> +                module_layout=module['core_layout']
>>> +                addressr=str(module_layout['base'])
>>
>> This looks untested.
> 
> Yep, I send out the untested version. Need more coffee...
> 
>>>                  name=module['name'].string(),
>>>                  size=str(module['core_size']),
>>>                  ref=str(module['refcnt']['counter'])))
>>> diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py
>>> index 627750c..8650ede 100644
>>> --- a/scripts/gdb/linux/symbols.py
>>> +++ b/scripts/gdb/linux/symbols.py
>>> @@ -108,7 +108,8 @@ lx-symbols command."""
>>>  
>>>      def load_module_symbols(self, module):
>>>          module_name = module['name'].string()
>>> -        module_addr = str(module['module_core']).split()[0]
>>> +        module_layout = module['core_layout']
>>> +        module_addr = str(module_layout['base'])
>>>  
>>>          module_file = self._get_module_file(module_name)
>>>          if not module_file and not self.module_files_updated:
>>>
>>
>> Thanks, but ad4db3b24a should already be on its way into stable.
> 
> Ah, I haven't got that fix yet because I am still on a older branch.
> Also my google-foo didn't help.
> 
> Sorry about that noise.

No problem. At least we now know another frequent user.

BTW, Kieran and some other people at Linaro started to think about how
to auto-test for such regressions - probably the only reliable way to
catch them.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux

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

* Re: [PATCH] scripts/gdb: Fix loading of modules information
  2016-03-29  7:22     ` Jan Kiszka
@ 2016-03-31  6:17       ` Daniel Wagner
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Wagner @ 2016-03-31  6:17 UTC (permalink / raw)
  To: Jan Kiszka
  Cc: linux-kernel, Daniel Wagner, Jiri Kosina, Rusty Russell,
	Kieran Bingham

On 03/29/2016 09:22 AM, Jan Kiszka wrote:
> No problem. At least we now know another frequent user.

Let's say sometimes :)

> BTW, Kieran and some other people at Linaro started to think about how
> to auto-test for such regressions - probably the only reliable way to
> catch them.

Good idea. I am happy to test if you got something.

cheers,
daniel

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

end of thread, other threads:[~2016-03-31  6:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-29  6:41 [PATCH] scripts/gdb: Fix loading of modules information Daniel Wagner
2016-03-29  6:58 ` [PATCH v2] " Daniel Wagner
2016-03-29  6:59 ` [PATCH] " Jan Kiszka
2016-03-29  7:13   ` Daniel Wagner
2016-03-29  7:22     ` Jan Kiszka
2016-03-31  6:17       ` Daniel Wagner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox