How to print Linux kernel structure viz. task, superblock, dentries, inodes, etc.
Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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:
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?
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.
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.
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
"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.
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)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.