All of lore.kernel.org
 help / color / mirror / Atom feed
* [Report] crash tool cannot resolve struct dm_table properly
@ 2017-04-13  2:01 Eric Ren
  2017-04-13 10:22 ` Steffen Maier
  2017-04-13 11:28 ` Mikulas Patocka
  0 siblings, 2 replies; 9+ messages in thread
From: Eric Ren @ 2017-04-13  2:01 UTC (permalink / raw)
  To: device-mapper development, Mikulas Patocka

Hi Mikulas,

When inspecting on coredump with crash tool, I find that 'dm_table' cannot be resolved 
properly as follows:

===
crash> struct dm_table
struct dm_table {
     int undefined__;
}
SIZE: 4
===

Looks this issue is introduced by 83d5e5b (dm: optimize use SRCU and RCU) with this code:
===
+/*
+ * A dummy definition to make RCU happy.
+ * struct dm_table should never be dereferenced in this file.
  + */ +struct dm_table {
+ int undefined__;
+};
+
===

It stops me from looking into dm_table when analyzing coredump. Is there any workaround?
or can be fixed somehow?

Regards,
Eric

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

* Re: [Report] crash tool cannot resolve struct dm_table properly
  2017-04-13  2:01 [Report] crash tool cannot resolve struct dm_table properly Eric Ren
@ 2017-04-13 10:22 ` Steffen Maier
  2017-04-13 10:29   ` Steffen Maier
  2017-06-13 10:06   ` Eric Ren
  2017-04-13 11:28 ` Mikulas Patocka
  1 sibling, 2 replies; 9+ messages in thread
From: Steffen Maier @ 2017-04-13 10:22 UTC (permalink / raw)
  To: Eric Ren, device-mapper development, Mikulas Patocka

On 04/13/2017 04:01 AM, Eric Ren wrote:
> Hi Mikulas,
>
> When inspecting on coredump with crash tool, I find that 'dm_table'
> cannot be resolved properly as follows:
>
> ===
> crash> struct dm_table
> struct dm_table {
>     int undefined__;
> }
> SIZE: 4
> ===
>
> Looks this issue is introduced by 83d5e5b (dm: optimize use SRCU and
> RCU) with this code:
> ===
> +/*
> + * A dummy definition to make RCU happy.
> + * struct dm_table should never be dereferenced in this file.
>  + */ +struct dm_table {
> + int undefined__;
> +};
> +
> ===
>
> It stops me from looking into dm_table when analyzing coredump. Is there
> any workaround?
> or can be fixed somehow?

Does this help somewhat?:

https://www.redhat.com/archives/dm-devel/2015-December/msg00042.html

As workaround for eppic scripts in crash, we currently re-define struct 
dm_table in eppic scripts, because "set scope dm_table_create" has not 
always worked as we liked. Sometimes "whatis dm_table_create" and again 
"set scope dm_table_create" worked and we put this in .crashrc, but 
eventually gave up and kept our struct re-define.

-- 
Mit freundlichen Grüßen / Kind regards
Steffen Maier

Linux on z Systems Development

IBM Deutschland Research & Development GmbH
Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschaeftsfuehrung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294

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

* Re: [Report] crash tool cannot resolve struct dm_table properly
  2017-04-13 10:22 ` Steffen Maier
@ 2017-04-13 10:29   ` Steffen Maier
  2017-04-13 14:35     ` Eric Ren
  2017-06-13 10:06   ` Eric Ren
  1 sibling, 1 reply; 9+ messages in thread
From: Steffen Maier @ 2017-04-13 10:29 UTC (permalink / raw)
  To: Eric Ren, device-mapper development, Mikulas Patocka

On 04/13/2017 12:22 PM, Steffen Maier wrote:
> On 04/13/2017 04:01 AM, Eric Ren wrote:
>> Hi Mikulas,
>>
>> When inspecting on coredump with crash tool, I find that 'dm_table'
>> cannot be resolved properly as follows:
>>
>> ===
>> crash> struct dm_table
>> struct dm_table {
>>     int undefined__;
>> }
>> SIZE: 4
>> ===
>>
>> Looks this issue is introduced by 83d5e5b (dm: optimize use SRCU and
>> RCU) with this code:
>> ===
>> +/*
>> + * A dummy definition to make RCU happy.
>> + * struct dm_table should never be dereferenced in this file.
>>  + */ +struct dm_table {
>> + int undefined__;
>> +};
>> +
>> ===
>>
>> It stops me from looking into dm_table when analyzing coredump. Is there
>> any workaround?
>> or can be fixed somehow?
>
> Does this help somewhat?:
>
> https://www.redhat.com/archives/dm-devel/2015-December/msg00042.html
>
> As workaround for eppic scripts in crash, we currently re-define struct
> dm_table in eppic scripts, because "set scope dm_table_create" has not
> always worked as we liked. Sometimes "whatis dm_table_create" and again
> "set scope dm_table_create" worked and we put this in .crashrc, but
> eventually gave up and kept our struct re-define.

Before we wrote above posting, we tried this; maybe it helps in your case:

crash> set gdb on
gdb: on
gdb> ptype struct dm_table
type = struct dm_table {
     int undefined__;
}
gdb> ptype 'drivers/md/dm-table.c'::dm_table
No symbol "dm_table" in specified context.
gdb: gdb request failed: ptype 'drivers/md/dm-table.c'::dm_table
gdb> ptype struct dm_table
type = struct dm_table {
     uint64_t features;
     struct mapped_device *md;
     unsigned int type;
...

-- 
Mit freundlichen Grüßen / Kind regards
Steffen Maier

Linux on z Systems Development

IBM Deutschland Research & Development GmbH
Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschaeftsfuehrung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294

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

* Re: [Report] crash tool cannot resolve struct dm_table properly
  2017-04-13  2:01 [Report] crash tool cannot resolve struct dm_table properly Eric Ren
  2017-04-13 10:22 ` Steffen Maier
@ 2017-04-13 11:28 ` Mikulas Patocka
  2017-04-13 11:56   ` Eric Ren
  1 sibling, 1 reply; 9+ messages in thread
From: Mikulas Patocka @ 2017-04-13 11:28 UTC (permalink / raw)
  To: Eric Ren; +Cc: device-mapper development



On Thu, 13 Apr 2017, Eric Ren wrote:

> Hi Mikulas,
> 
> When inspecting on coredump with crash tool, I find that 'dm_table' cannot be
> resolved properly as follows:
> 
> ===
> crash> struct dm_table
> struct dm_table {
>     int undefined__;
> }
> SIZE: 4
> ===
> 
> Looks this issue is introduced by 83d5e5b (dm: optimize use SRCU and RCU) with
> this code:
> ===
> +/*
> + * A dummy definition to make RCU happy.
> + * struct dm_table should never be dereferenced in this file.
>  + */ +struct dm_table {
> + int undefined__;
> +};
> +
> ===
> 
> It stops me from looking into dm_table when analyzing coredump. Is there any
> workaround?
> or can be fixed somehow?
> 
> Regards,
> Eric

So, move dm_table definition to drivers/md/dm.h

Mikulas

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

* Re: [Report] crash tool cannot resolve struct dm_table properly
  2017-04-13 11:28 ` Mikulas Patocka
@ 2017-04-13 11:56   ` Eric Ren
  2017-04-13 21:53     ` [PATCH] " Mikulas Patocka
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Ren @ 2017-04-13 11:56 UTC (permalink / raw)
  To: Mikulas Patocka; +Cc: device-mapper development

Hi,


On 04/13/2017 07:28 PM, Mikulas Patocka wrote:
>
> On Thu, 13 Apr 2017, Eric Ren wrote:
>
>> Hi Mikulas,
>>
>> When inspecting on coredump with crash tool, I find that 'dm_table' cannot be
>> resolved properly as follows:
>>
>> ===
>> crash> struct dm_table
>> struct dm_table {
>>      int undefined__;
>> }
>> SIZE: 4
>> ===
>>
>> Looks this issue is introduced by 83d5e5b (dm: optimize use SRCU and RCU) with
>> this code:
>> ===
>> +/*
>> + * A dummy definition to make RCU happy.
>> + * struct dm_table should never be dereferenced in this file.
>>   + */ +struct dm_table {
>> + int undefined__;
>> +};
>> +
>> ===
>>
>> It stops me from looking into dm_table when analyzing coredump. Is there any
>> workaround?
>> or can be fixed somehow?
>>
>> Regards,
>> Eric
> So, move dm_table definition to drivers/md/dm.h
Thanks. So, are your going to fix this? Or should I test on your suggestion
and send a patch if it works?

Regards,
Eric
>
> Mikulas
>

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

* Re: [Report] crash tool cannot resolve struct dm_table properly
  2017-04-13 10:29   ` Steffen Maier
@ 2017-04-13 14:35     ` Eric Ren
  0 siblings, 0 replies; 9+ messages in thread
From: Eric Ren @ 2017-04-13 14:35 UTC (permalink / raw)
  To: Steffen Maier, device-mapper development, Mikulas Patocka

Hey!


On 04/13/2017 06:29 PM, Steffen Maier wrote:
> On 04/13/2017 12:22 PM, Steffen Maier wrote:
>> [...snip...]
>>
>> Does this help somewhat?:
>>
>> https://www.redhat.com/archives/dm-devel/2015-December/msg00042.html
Thanks, I didn't notice that thread. Yes, it will help!
>>
>> As workaround for eppic scripts in crash, we currently re-define struct
>> dm_table in eppic scripts, because "set scope dm_table_create" has not
>> always worked as we liked. Sometimes "whatis dm_table_create" and again
>> "set scope dm_table_create" worked and we put this in .crashrc, but
>> eventually gave up and kept our struct re-define.
>
> Before we wrote above posting, we tried this; maybe it helps in your 
> case:
>
> crash> set gdb on
> gdb: on
> gdb> ptype struct dm_table
> type = struct dm_table {
>     int undefined__;
> }
> gdb> ptype 'drivers/md/dm-table.c'::dm_table
> No symbol "dm_table" in specified context.
> gdb: gdb request failed: ptype 'drivers/md/dm-table.c'::dm_table
> gdb> ptype struct dm_table
> type = struct dm_table {
>     uint64_t features;
>     struct mapped_device *md;
>     unsigned int type;
> ...
>
Great! thanks for your sharing:-)

Regards,
Eric

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

* [PATCH] Re: [Report] crash tool cannot resolve struct dm_table properly
  2017-04-13 11:56   ` Eric Ren
@ 2017-04-13 21:53     ` Mikulas Patocka
  2017-04-14  1:42       ` Eric Ren
  0 siblings, 1 reply; 9+ messages in thread
From: Mikulas Patocka @ 2017-04-13 21:53 UTC (permalink / raw)
  To: Eric Ren, Mike Snitzer; +Cc: device-mapper development



On Thu, 13 Apr 2017, Eric Ren wrote:

> Hi,
> 
> 
> On 04/13/2017 07:28 PM, Mikulas Patocka wrote:
> > 
> > On Thu, 13 Apr 2017, Eric Ren wrote:
> > 
> > > Hi Mikulas,
> > > 
> > > When inspecting on coredump with crash tool, I find that 'dm_table' cannot
> > > be
> > > resolved properly as follows:
> > > 
> > > ===
> > > crash> struct dm_table
> > > struct dm_table {
> > >      int undefined__;
> > > }
> > > SIZE: 4
> > > ===
> > > 
> > > Looks this issue is introduced by 83d5e5b (dm: optimize use SRCU and RCU)
> > > with
> > > this code:
> > > ===
> > > +/*
> > > + * A dummy definition to make RCU happy.
> > > + * struct dm_table should never be dereferenced in this file.
> > >   + */ +struct dm_table {
> > > + int undefined__;
> > > +};
> > > +
> > > ===
> > > 
> > > It stops me from looking into dm_table when analyzing coredump. Is there
> > > any
> > > workaround?
> > > or can be fixed somehow?
> > > 
> > > Regards,
> > > Eric
> > So, move dm_table definition to drivers/md/dm.h
> Thanks. So, are your going to fix this? Or should I test on your suggestion
> and send a patch if it works?
> 
> Regards,
> Eric
> > 
> > Mikulas
> > 
> 

Hi

It turned out that the RCU macros changed and the dummy definition is no 
longer needed. So, we can remove it.



From: Mikulas Patocka <mpatocka@redhat.com>

dm: remove dummy dm_table definition

This dummy structure definition was required for RCU macros, but it
doesn't seem to be required anymore, so delete it.

The dummy definition confuses the crash tool, see
https://www.redhat.com/archives/dm-devel/2017-April/msg00197.html

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

---
 drivers/md/dm-ioctl.c |    8 --------
 1 file changed, 8 deletions(-)

Index: linux-2.6/drivers/md/dm-ioctl.c
===================================================================
--- linux-2.6.orig/drivers/md/dm-ioctl.c
+++ linux-2.6/drivers/md/dm-ioctl.c
@@ -37,14 +37,6 @@ struct hash_cell {
 	struct dm_table *new_map;
 };
 
-/*
- * A dummy definition to make RCU happy.
- * struct dm_table should never be dereferenced in this file.
- */
-struct dm_table {
-	int undefined__;
-};
-
 struct vers_iter {
     size_t param_size;
     struct dm_target_versions *vers, *old_vers;

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

* Re: [PATCH] Re: [Report] crash tool cannot resolve struct dm_table properly
  2017-04-13 21:53     ` [PATCH] " Mikulas Patocka
@ 2017-04-14  1:42       ` Eric Ren
  0 siblings, 0 replies; 9+ messages in thread
From: Eric Ren @ 2017-04-14  1:42 UTC (permalink / raw)
  To: Mikulas Patocka, Mike Snitzer; +Cc: device-mapper development

On 04/14/2017 05:53 AM, Mikulas Patocka wrote:
>
> On Thu, 13 Apr 2017, Eric Ren wrote:
>
>> Hi,
>>
>>
>> On 04/13/2017 07:28 PM, Mikulas Patocka wrote:
>>> On Thu, 13 Apr 2017, Eric Ren wrote:
>>>
>>>> Hi Mikulas,
>>>>
>>>> When inspecting on coredump with crash tool, I find that 'dm_table' cannot
>>>> be
>>>> resolved properly as follows:
>>>>
>>>> ===
>>>> crash> struct dm_table
>>>> struct dm_table {
>>>>       int undefined__;
>>>> }
>>>> SIZE: 4
>>>> ===
>>>>
>>>> Looks this issue is introduced by 83d5e5b (dm: optimize use SRCU and RCU)
>>>> with
>>>> this code:
>>>> ===
>>>> +/*
>>>> + * A dummy definition to make RCU happy.
>>>> + * struct dm_table should never be dereferenced in this file.
>>>>    + */ +struct dm_table {
>>>> + int undefined__;
>>>> +};
>>>> +
>>>> ===
>>>>
>>>> It stops me from looking into dm_table when analyzing coredump. Is there
>>>> any
>>>> workaround?
>>>> or can be fixed somehow?
>>>>
>>>> Regards,
>>>> Eric
>>> So, move dm_table definition to drivers/md/dm.h
>> Thanks. So, are your going to fix this? Or should I test on your suggestion
>> and send a patch if it works?
>>
>> Regards,
>> Eric
>>> Mikulas
>>>
> Hi
>
> It turned out that the RCU macros changed and the dummy definition is no
> longer needed. So, we can remove it.
Hi!

That's great, thanks!

Regards,
Eric
>
>
>
> From: Mikulas Patocka <mpatocka@redhat.com>
>
> dm: remove dummy dm_table definition
>
> This dummy structure definition was required for RCU macros, but it
> doesn't seem to be required anymore, so delete it.
>
> The dummy definition confuses the crash tool, see
> https://www.redhat.com/archives/dm-devel/2017-April/msg00197.html
>
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
>
> ---
>   drivers/md/dm-ioctl.c |    8 --------
>   1 file changed, 8 deletions(-)
>
> Index: linux-2.6/drivers/md/dm-ioctl.c
> ===================================================================
> --- linux-2.6.orig/drivers/md/dm-ioctl.c
> +++ linux-2.6/drivers/md/dm-ioctl.c
> @@ -37,14 +37,6 @@ struct hash_cell {
>   	struct dm_table *new_map;
>   };
>   
> -/*
> - * A dummy definition to make RCU happy.
> - * struct dm_table should never be dereferenced in this file.
> - */
> -struct dm_table {
> -	int undefined__;
> -};
> -
>   struct vers_iter {
>       size_t param_size;
>       struct dm_target_versions *vers, *old_vers;
>

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

* Re: [Report] crash tool cannot resolve struct dm_table properly
  2017-04-13 10:22 ` Steffen Maier
  2017-04-13 10:29   ` Steffen Maier
@ 2017-06-13 10:06   ` Eric Ren
  1 sibling, 0 replies; 9+ messages in thread
From: Eric Ren @ 2017-06-13 10:06 UTC (permalink / raw)
  To: Steffen Maier, device-mapper development

Hi Steffen,

On 04/13/17 18:22, Steffen Maier wrote:
> On 04/13/2017 04:01 AM, Eric Ren wrote:
>> Hi Mikulas,
>>
>> When inspecting on coredump with crash tool, I find that 'dm_table'
>> cannot be resolved properly as follows:
>>
>> ===
>> crash> struct dm_table
>> struct dm_table {
>>     int undefined__;
>> }
>> SIZE: 4
>> ===
>>
>> Looks this issue is introduced by 83d5e5b (dm: optimize use SRCU and
>> RCU) with this code:
>> ===
>> +/*
>> + * A dummy definition to make RCU happy.
>> + * struct dm_table should never be dereferenced in this file.
>>  + */ +struct dm_table {
>> + int undefined__;
>> +};
>> +
>> ===
>>
>> It stops me from looking into dm_table when analyzing coredump. Is there
>> any workaround?
>> or can be fixed somehow?
>
> Does this help somewhat?:
>
> https://www.redhat.com/archives/dm-devel/2015-December/msg00042.html
>
> As workaround for eppic scripts in crash, we currently re-define struct dm_table in eppic 
> scripts, because "set scope dm_table_create" has not always worked as we liked. Sometimes 
> "whatis dm_table_create" and again "set scope dm_table_create" worked and we put this in 
> .crashrc, but eventually gave up and kept our struct re-define.

Yes, playing with "set" or "gdb ptype" commands doesn't always work. Could you please share 
your eppic scripts and steps how to use it?

Thanks in advance,
Eric

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

end of thread, other threads:[~2017-06-13 10:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-13  2:01 [Report] crash tool cannot resolve struct dm_table properly Eric Ren
2017-04-13 10:22 ` Steffen Maier
2017-04-13 10:29   ` Steffen Maier
2017-04-13 14:35     ` Eric Ren
2017-06-13 10:06   ` Eric Ren
2017-04-13 11:28 ` Mikulas Patocka
2017-04-13 11:56   ` Eric Ren
2017-04-13 21:53     ` [PATCH] " Mikulas Patocka
2017-04-14  1:42       ` Eric Ren

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.