List Info

Thread: Identifying structures related to memory , semaphores using crash utility




Identifying structures related to memory , semaphores using crash utility
user name
2006-12-11 15:21:49
ram ba wrote:
Hi all,I was running crash to analyse a vmcore generated by a  2.6.16.21-0.8.uis.1-smp kernel ( on x86_64 architecture). During this I came to know that we get a list of all kernel symbols with the help of "sym -l" command. With the help of "whatis" command we can know the symbol definition.But applying "whatis" command to each symbol and checking its definition appears to be tedious. Is there any other way to identify as to which symbols represent structures?        Also I wanted to isolate the structures related to memory, semaphores, tasks. Since I am new to crash utility, I couldn't get much information. Could you please provide some suggestions as to how to go about it.Thanks,Ramya
Need a quick answer? Get one in minutes from people who know. Ask your question on Yahoo! Answers.


Ask "Yahoo! Answers"?   

Anyway, it's not clear to me what you're asking for?

If a symbol-name is an instance of a data structure, or an array of data
structures, you can simply enter:

  crash> p symbol-name

If the symbol refers to an array of structures, you can pick
an individual structure by its index:

  crash> p symbol-name[index]

Or if the symbol is a pointer to a data strucutre, you display
what it points to with:

  crash> p *symbol-name

The above simply take advantage of the embedded gdb module
pre-determining what the data type of a symbol is, and then printing it.

When you ask that you want to "isolate the structures related to
memory, semaphores, tasks", again, I don't understand what you
are asking for.

I'm probably missing your point, but, in any case, there's certainly no
existing command that walks the symbol list and tells you what kind of
data structure each one is -- if that's what you're expecting.

Depending upon what you want, you could probably (1) cobble together
an input script that you can in turn feed to crash, or (2) write an "extend"
module that gathers the data that you specifically need.

Dave
 
 

Identifying structures related to memory , semaphores using crash utility
user name
2006-12-12 04:19:32
Hi Dave,
         ;  I am thankful to you for your immediate response. Since we know that symbols can be either structures, arrays, ordinary variables or functions, I want to fetch the values of only those symbols that are structures. Well when we execute sym -l  command, we get the second field as symbol type as shown below.
 
ffffffff80107000 (T) level3_physmem_pgt
ffffffff80108000 (t) rest_init
.....
ffffffff80333000 (D) cpu_gdt_table
ffffffff80333080 (d) gdt_end
.....
ffffffff802d93a0 (A) __stop___ex_table
ffffffff802da000 (A) __start_rodata
ffffffff802da000 (R) linux_banner
ffffffff802da0c0 (r) p.13105
ffffffff802da100 (r) border
 I wanted to ensure whether we can use this information to identify whether a given symbol is a structure or a function or an ordinary variable.( can i assume that all symbols present in text segment are functions?)
 
         Also I wanted to know if there is any command wherein I can get a listing of all symbols that are related to memory, semaphores and tasks.
Thanks,
Ramya

Dave Anderson <andersonredhat.com> wrote:
ram ba wrote:
Hi all,I was running crash to analyse a vmcore generated by a  2.6.16.21-0.8.uis.1-smp kernel ( on x86_64 architecture). During this I came to know that we get a list of all kernel symbols with the help of "sym -l" command. With the help of "whatis" command we can know the symbol definition.But applying "whatis" command to each symbol and checking its definition appears to be tedious. Is there any other way to identify as to which symbols represent structures? &nbsp; &nbsp; &nbsp;  Also I wanted to isolate the structures related to memory, semaphores, tasks. Since I am new to crash utility, I couldn't get much information. Could you please provide some suggestions as to how to go about it.Thanks,Ramya
Need a quick answer? Get one in minutes from people who know. Ask your question on Yahoo! Answers.

Ask "Yahoo! Answers"?&nbsp;  
Anyway, it's not clear to me what you're asking for?
If a symbol-name is an instance of a data structure, or an array of data
structures, you can simply enter:
  crash> p symbol-name
If the symbol refers to an array of structures, you can pick
an individual structure by its index:
  crash> p symbol-name[index]
Or if the symbol is a pointer to a data strucutre, you display
what it points to with:
  crash> p *symbol-name
The above simply take advantage of the embedded gdb module
pre-determining what the data type of a symbol is, and then printing it.
When you ask that you want to "isolate the structures related to
memory, semaphores, tasks", again, I don't understand what you
are asking for.
I'm probably missing your point, but, in any case, there's certainly no
existing command that walks the symbol list and tells you what kind of
data structure each one is -- if that's what you're expecting.
Depending upon what you want, you could probably (1) cobble together
an input script that you can in turn feed to crash, or (2) write an "extend"
module that gathers the data that you specifically need.
Dave
 
  --
Crash-utility mailing list
Crash-utilityredhat.com
https://www.redhat.com/mailman/listinfo/crash-utility

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Identifying structures related to memory , semaphores using crash utility
user name
2006-12-12 05:38:38
On Mon, Dec 11, 2006 at 08:19:32PM -0800, ram ba wrote:
> Hi Dave,
>              I am thankful to you for your immediate
response. Since we know that symbols can be either
structures, arrays, ordinary variables or functions, I want
to fetch the values of only those symbols that are
structures. Well when we execute sym -l  command, we get the
second field as symbol type as shown below.
> 
>   ffffffff80107000 (T) level3_physmem_pgt
> ffffffff80108000 (t) rest_init
>   .....
> ffffffff80333000 (D) cpu_gdt_table
> ffffffff80333080 (d) gdt_end
>   .....
> ffffffff802d93a0 (A) __stop___ex_table
> ffffffff802da000 (A) __start_rodata
> ffffffff802da000 (R) linux_banner
> ffffffff802da0c0 (r) p.13105
> ffffffff802da100 (r) border
> 
>    I wanted to ensure whether we can use this
information to identify whether a given symbol is a
structure or a function or an ordinary variable.( can i
assume that all symbols present in text segment are
functions?)

Hi Ramya

I dont see how one could determine whether a symbol is a
structure or not
just by looking at the sym -l output. This is the same
information one can
get from the System.map file. Probably one way could be to
query 'gdb' for
each of these symbols for their symbol type, as Dave had
mentioned.

Thanks
Rachita

--
Crash-utility mailing list
Crash-utilityredhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
Identifying structures related to memory , semaphores using crash utility
user name
2006-12-12 09:58:27
Hi Rachita,
 &nbsp; &nbsp; &nbsp;  I am referring to the second column of sym -l command output.&nbsp;From sym -l command we get the information about symbol types.As you have specified the same information is present in system.map file as well. Since ;the output of command " nm&nbsp;<vmlinux file>" is placed in system.map file, I checked the man page of "nm" and got to know the symbol types.
 &nbsp; &nbsp; I came to know that types t,T (present in the second column of sym -l command) represent symbols that are located in text segment. Explanation about other data types are also given.&nbsp;I wanted to know whether only functions can reside in text segment or any other variables reside as well. If only functions reside in Text segment, it would be easy to identify the symbols that are functions. And I can easily segregate them from other symbols. So I thought this may help us to identify whether a given symbol name is function or not. I hope you can provide ;a better insight to this.
 &nbsp; &nbsp; &nbsp; As you and Dave had suggested I tried using gdb info command. But it is consuming lot of time. Including that in my script would slow down the entire code. It doesn't suit my need either.
 &nbsp; &nbsp; &nbsp;  If you know any other method (need not be crash utility) to identify the symbol definitions, please let me know.
Thanks,
Ramya
Rachita Kothiyal <rachitain.ibm.com> wrote:
On Mon, Dec 11, 2006 at 08:19:32PM -0800, ram ba wrote:
>; Hi Dave,
> I am thankful to you for your immediate response. Since we know that symbols can be either structures, arrays, ordinary variables or functions, I want to fetch the values of only those symbols that are structures. Well when we execute sym -l command, we get the second field as symbol type as shown below.
>;
> ffffffff80107000 (T) level3_physmem_pgt
&gt; ffffffff80108000 (t) rest_init
> .....
> ffffffff80333000 (D) cpu_gdt_table
> ffffffff80333080 (d) gdt_end
&gt; .....
> ffffffff802d93a0 (A) __stop___ex_table
>; ffffffff802da000 (A) __start_rodata
> ffffffff802da000 (R) linux_banner
> ffffffff802da0c0 (r) p.13105
&gt; ffffffff802da100 (r) border
>;
> I wanted to ensure whether we can use this information to identify whether a given symbol is a structure or a function or an ordinary variable.( can i assume that all symbols present in text segment are functions?)

Hi Ramya

I dont see how one could determine whether a symbol is a structure or not
just by looking at the sym -l output. This is the same information one can
get from the System.map file. Probably one way could be to query 'gdb' for
each of these symbols for their symbol type, as Dave had mentioned.

Thanks
Rachita

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




Have a burning question? Go to Yahoo! Answers and get answers from real people who know.
[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )