LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 05-16-2013, 09:49 AM   #1
lokanathbagh
LQ Newbie
 
Registered: May 2013
Posts: 5

Rep: Reputation: Disabled
How to print Linux kernel structure viz. task, superblock, dentries, inodes, etc.


Hi All,
I am from OpenVMS background. Just started learning about Linux. In OpenVMS there is a tool called SDA. Using SDA you can analyze process private space as well as system space. Is there any tool in Linux to print kernel structure in Raw or formatted? Kernel structure such as task structure, superblock(memory copy), dentries, inodes(memory copy), etc. I failed to google to get any tool. Help with some example will be appreciated much.

Regards,
Lokanath
 
Old 05-17-2013, 07:11 PM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
everything you would ever want to know about your system can usually be found in /proc/ or /sys/. I would suggest starting by reviewing these directories and their usage. Be very careful, you can crash your system if you modify or delete most of the files in these directories. Although, for the most part Linux is smart enough and a reboot will reset/rebuild those files.

/proc/
http://www.tldp.org/LDP/Linux-Filesy...html/proc.html
http://www.thegeekstuff.com/2010/11/...c-file-system/

/sys/
From the Red Hat 6 Administration Guide: https://access.redhat.com/site/docum...ystem-fhs.html

2.2.1.12. The /sys/ Directory
The /sys/ directory utilizes the new sysfs virtual file system specific to the 2.6 kernel. With the increased support for hot plug hardware devices in the 2.6 kernel, the /sys/ directory contains information similar to that held by /proc/, but displays a hierarchical view device information specific to hot plug devices.

Last edited by Kustom42; 05-17-2013 at 07:16 PM.
 
1 members found this post helpful.
Old 05-17-2013, 07:14 PM   #3
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
You know what after reading your question I'm thinking yoru jsut looking for the basics.


Try these commands:

Code:
top
ps auxww
iostat
sar -q # This one may not be installed, do a yum install sysstat or apt-get install sysstat

I try to refrain from posting to third party sites that arent vendors directly related to posts but here is a great blog that discusses some sys admin monitoring tools for Linux:


http://www.cyberciti.biz/tips/top-li...ing-tools.html
 
Old 05-20-2013, 01:39 AM   #4
lokanathbagh
LQ Newbie
 
Registered: May 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Hi Kustom42,

I appreciate your reply. I have already explored those commands. I found them useful in some cases with my little knowledge on Linux.
I want to analyze a hung process and find out why it is hung for? Want to know the complete call chain, frames, etc?

Regards,
Lokanath
 
Old 05-20-2013, 05:06 AM   #5
tux111
Member
 
Registered: Oct 2012
Location: Germany
Distribution: Xubuntu
Posts: 81

Rep: Reputation: Disabled
Quote:
Originally Posted by lokanathbagh View Post
Is there any tool in Linux to print kernel structure in Raw or formatted? Kernel structure such as task structure, superblock(memory copy), dentries, inodes(memory copy), etc.
Volatility.
 
Old 06-02-2013, 08:08 AM   #6
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
It's much better to start with the commands and /sys & /proc outputs. Accesses to kernel structures requires specific locks and that means much care when you're writing the display functions. However, you can look at the source code of the files in /sys, it will be a good learning experience.
 
1 members found this post helpful.
Old 06-22-2013, 10:26 AM   #7
lokanathbagh
LQ Newbie
 
Registered: May 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
My kernel version is 3.5.0-28-generic. I am using Ubuntu. How to run "crash" utility ? When I run I get below error -

root@baghbagh1:/home/lokanathbagh# crash /boot/vmlinuz-3.5.0-28-generic

crash 5.1.6
Copyright (C) 2002-2011 Red Hat, Inc.
Copyright (C) 2004, 2005, 2006 IBM Corporation
Copyright (C) 1999-2006 Hewlett-Packard Co
Copyright (C) 2005, 2006 Fujitsu Limited
Copyright (C) 2006, 2007 VA Linux Systems Japan K.K.
Copyright (C) 2005 NEC Corporation
Copyright (C) 1999, 2002, 2007 Silicon Graphics, Inc.
Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc.
This program is free software, covered by the GNU General Public License,
and you are welcome to change it and/or distribute copies of it under
certain conditions. Enter "help copying" to see the conditions.
This program has absolutely no warranty. Enter "help warranty" for details.

crash: /boot/vmlinuz-3.5.0-28-generic: not a supported file format

Usage:

crash [OPTION]... NAMELIST MEMORY-IMAGE (dumpfile form)
crash [OPTION]... [NAMELIST] (live system form)

Enter "crash -h" for details.

Please help.
 
Old 06-23-2013, 08:49 PM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
"crash" requires debug data for the kernel you are trying to investigate. On Redhat/Fedora that means installing the kernel-debug package for that level - don't know about Ubuntu, but this article has some info you'll need. There are some other useful articles on that wiki by the looks of it.
 
Old 07-13-2013, 09:09 AM   #9
anish2good
LQ Newbie
 
Registered: Jul 2011
Posts: 15

Rep: Reputation: Disabled
uptime - Tell how long the system has been running.

uptime gives a one line display of the following information. The current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes.

top provides an ongoing look at processor activity in real time. It displays a listing of the most CPU-intensive tasks on the system, and can provide an interactive interface for manipulating processes

The mpstat command writes to standard output activities for each available processor, processor 0 being the first one. Global average activities among all processors are also reported. The mpstat command can be used both on SMP and UP machines, but in the latter, only global average activities will be printed. If no activity has been selected, then the default report is the CPU utilization report.


iostat - The iostat command is used for monitoring system input/output device
loading by observing the time the devices are active in relation to
their average transfer rates.

vmstat reports information about processes, memory, paging, block IO, traps, and cpu activity. The first report produced gives averages since the last reboot

free - display information about free and used memory on the system


ping : ping uses the ICMP protocol's mandatory ECHO_REQUEST datagram to elicit an ICMP ECHO_RESPONSE from a host or gateway


Dstat allows you to view all of your system resources instantly, you can eg. compare disk usage in combination with interrupts from your IDE controller, or compare the network bandwidth numbers directly with the disk throughput (in the same interval)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux command to print code structure yjy4321 Linux - Newbie 1 10-16-2012 01:38 PM
does the kernel report wrong number for unused dentries? markseger Linux - Server 1 09-29-2011 01:13 PM
Inodes and the superblock fezzie Linux - Newbie 3 02-26-2010 06:01 AM
when inodes, superblock and data block are created? xcore_on Linux - Newbie 1 05-02-2006 04:54 PM
how to recover from superblock and inodes daemonthread Linux - General 0 06-23-2004 03:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 07:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration