kernel
-
Jump into vmcore analysis – Step 7
If the vmcore was generated by human and you want to check who actually was, you might need to check the related process. There are various options in ‘ps’ command, so, you would be able to check it with below steps. crash> ps -a 6326 PID: 6326 TASK: ffff810402165820 CPU: 1 COMMAND: “fuser” ARG: fuser… Continue reading
-
Jump into vmcore analysis – Step 6
The real merit of the vmcore is that you can trace the code with the current value each variable holds. Here you can find one example that traces the filesystem which ended up with the corrupted data entry somehow. http://pagead2.googlesyndication.com/pagead/show_ads.js crash> bt PID: 6326 TASK: ffff810402165820 CPU: 1 COMMAND: “fuser” #0 [ffff8103b54efa80] crash_kexec at ffffffff800b099c… Continue reading
-
Jump into vmcore analysis – Step 5
With ‘bt’ command you can check the processes that occupied the CPU at the time of crash. But, there is the time you want to check other processes’s backtrace to see what interaction had been established between processes. You can check it by using one of below two methods. crash> set 24960 PID: 24960 COMMAND:… Continue reading
-
Jump into vmcore analysis – Step 4
There are times the crash had happened because of the lack of memory. Or times that system had hard time because of the memory issue. To check those, you can use below command. crash> kmem -i PAGES TOTAL PERCENTAGE TOTAL MEM 16464824 62.8 GB —- FREE 3807386 14.5 GB 23% of TOTAL MEM USED 12657438… Continue reading
-
Jump into vmcore analysis – Step 3
Now we are ready to deep dive into vmcore analysis to confirm what went wrong in the system. In general, first thing I’m checking is the system’s log. crash> log …. …. end_request: I/O error, dev sdajm, sector 0 end_request: I/O error, dev sdajm, sector 8 end_request: I/O error, dev sdajm, sector 0 NMI Watchdog… Continue reading
-
Jump into a vmcore analysis – Step 2
As I had mentioned in the previous article, you can launch crash analysis by running the below command $ crash vmcore vmlinux The order of the file doesn’t matter as far as the file exist there. But, there’s a time that crash command fails as a vmcore is highly incomplete. In that case, you can… Continue reading
-
Jump into a vmcore analysis – Step 1
If you have a vmcore needs to be analysed, you should have to download related kernel-debuginfo package unless your kernel does have all the debug information in the live kernel. You might easily check the kernel version of the vmcore by run ‘uname -r’, but safest way would be checking vmcore itself. You can use… Continue reading
-
How to check which applications are using hugepages
You can find how much is allocated and how much is actually used by HugePages by run the following command. $ grep -i huge /proc/meminfo AnonHugePages: 776192 kB HugePages_Total: 241 HugePages_Free: 113 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB But, there’s a time you also want to know which applications are actually used HugePages. You… Continue reading
-
How many threads are in the system
If you want to check how many threads are in the system to compare it with the maximum allowed threads by the system (kernel.threads-max), you can use one of the below two methods. $ cat /proc/loadavg 0.74 0.93 1.04 3/393 31977 4th column in the above output is related to the current threads number. In… Continue reading
-
How to build a module with source codes in separate directories.
If you want to use separate directories for source files and target modules, you can use below scheme. mod_main.c #include #include MODULE_LICENSE(“GPL”); static int __init mod_entry(void) { return 0; } static void __exit mod_exit(void) { return; } module_init(mod_entry); module_exit(mod_exit); sub_mod.c #include #include int sub_func(int i) { printk(“Hello %d”, i); return 0; } EXPORT_SYMBOL(sub_func); http://pagead2.googlesyndication.com/pagead/show_ads.js Makefile… Continue reading
-
Very very very very very simple boot up code.
I think it’s 2003 or 2004 that I made this very simple booting code to demonstrate how OS starts. I paste the output here for the future reference. bootsec.asm ORG 0x7c00 jmp begin_boot bootmesg1 db “Press any to boot KERNEL…..” mesglen equ $ – bootmesg1 drive db 0 [BITS 16] print_mesg: mov ah, 0x13 mov… Continue reading
-
module taint
static char *module_flags(struct module *mod, char *buf) { int bx = 0; if (mod->taints || mod->state == MODULE_STATE_GOING || mod->state == MODULE_STATE_COMING) { buf[bx++] = ‘(‘; if (mod->taints & (1 <taints & (1 <taints & (1 <state == MODULE_STATE_GOING) buf[bx++] = ‘-‘; /* Show a + for module-is-being-loaded */ if (mod->state == MODULE_STATE_COMING) buf[bx++] =… Continue reading
About Me
A software engineer who loves any technologies that makes life easier. That’s why I love Linux and Mac at the same time.