zoukankan      html  css  js  c++  java
  • kernel/panic.c

    /*
     *  linux/kernel/panic.c
     *
     *  Copyright (C) 1991, 1992  Linus Torvalds
     */

    /*
     * This function is used through-out the kernel (includeinh mm and fs)
     * to indicate a major problem.
     */
    #include <stdarg.h>

    #include <linux/kernel.h>
    #include <linux/sched.h>

    asmlinkage void sys_sync(void);    /* it's really int */

    extern int vsprintf(char * buf, const char * fmt, va_list args);

    //内核出错的处理
    NORET_TYPE void panic(const char * fmt, ...)
    {
        static char buf[1024];
        va_list args;

        va_start(args, fmt);
        vsprintf(buf, fmt, args);
        va_end(args);
        printk(KERN_EMERG "Kernel panic: %s ",buf);
        if (current == task[0])
            printk(KERN_EMERG "In swapper task - not syncing ");
        else
            sys_sync();
        for(;;);
    }

  • 相关阅读:
    监控Nginx
    监控Tomcat
    监控memcache
    监控Redis
    14-SpringCloud Bus
    13-SpringCloud Config
    12-SpringCloud GateWay
    11-SpringCloud Hystrix
    10-SpringCloud OpenFeign
    09-SpringCloud Ribbon
  • 原文地址:https://www.cnblogs.com/xiaofengwei/p/3774004.html
Copyright © 2011-2022 走看看