当前位置:首页>Linux>OS25.【Linux】进程等待 (上)

OS25.【Linux】进程等待 (上)

  • 2026-06-30 23:15:07
OS25.【Linux】进程等待 (上)

目录

1.知识回顾

2.验证僵尸进程无法用kill杀死

3.清理僵尸进程常见的两种方法

杀死父进程

父进程收尸

进程等待

定义

系统调用wait和waitpid的简介

等待单个子进程

等待多个子进程

如果子进程不退出呢?

wait是waitpid的子集

解释wstatus参数

实验1: wstatus的位图

wstatus的位图的详细说明

实验2:手动提取wstatus的位

实验3: 测试进程异常退出

4.退出信息保存的位置

5.waitpid等待失败的情况举例

6.从task_struct看父子进程之间的联系

7.参考资料


1.知识回顾

参见OS20.【Linux】进程状态(2) 僵尸进程、孤儿进程和进程优先级文章复习

2.验证僵尸进程无法用kill杀死

#include<stdio.h>#include<unistd.h>#include<stdlib.h>intmain(){	pid_t ret_id = fork();	if (ret_id == 0)	{        printf("the child process's PID:%d\n",getpid());        exit(0);//父进程不收尸	}	else	{        while(1);	}	return 0;}

运行结果:

结论:僵尸进程无法用kill杀死,因为谁也没有办法杀死一个已经死去的进程

但只要Ctrl+C僵尸进程就被清理了,原因在"清理僵尸进程常见的两种方法"中讲

3.清理僵尸进程常见的两种方法

杀死父进程

上面提到了"但只要Ctrl+C僵尸进程就被清理了",在linuxjournal how-kill-zombie-processes-linux文章有提到:

如果父进程无法收尸,那么就要杀死或者重启父进程,而Ctrl+C就是杀死父进程的一种方式

见下图画线句

父进程收尸

进程等待

定义

父进程通过进程等待的方式来回收子进程资源和获取子进程退出信息,否则子进程会变僵尸进程,僵尸进程的危害参见OS20.【Linux】进程状态(2) 僵尸进程、孤儿进程和进程优先级文章

系统调用wait和waitpid的简介

父进程调用wait或waitpid(这里不讨论waitid)可以对子进程进行状态检测与回收,即wait或waitpid可以等待任意一个进程的退出

父进程获取子进程退出信息必须经过系统调用

错误做法: 定义一个区域,子进程退出前向区域写入数据,父进程负责读取区域数据,这样就可以不经过系统调用

错因:进程具有独立性

返回值:

等待单个子进程

参数status暂时不填,置为NULL

#include<stdio.h>#include<unistd.h>#include<stdlib.h>#include<sys/wait.h>intmain(){    pid_t id = fork();    if(id < 0    {        perror("fork");        return 1;    }    else if(id == 0)//子进程    {        printf("子进程的pid:%d, ppid:%d\n"getpid(), getppid());        exit(0);    }    else//父进程得到子进程的PID    {        sleep(2);        printf("父进程准备回收子进程\n");        sleep(2);        pid_t ret = wait(NULL);        if(ret < 0)//返回-1等待失败        {            perror("wait failed");        }        if (ret == id)         {            printf("父进程回收子进程成功,子进程的pid:%d\n", ret);        }        sleep(2);     }    return 0;}

注:1.调用fork()后,父进程得到子进程的PID,那么父进程就可以通过分析ret是否等于id来判断父进程是否成功回收子进程 2.wait返回值:如果调用成功,wait返回成功退出的子进程的PID;如果调用失败,返回-1

运行结果:

等待多个子进程

父进程可以用循环来等待多个子进程

#include<stdio.h>#include<unistd.h>#include<stdlib.h>#include<sys/wait.h>voidrun_child(){    printf("子进程的pid: %d, ppid:%d\n"getpid(), getppid());}voidcollect_child(){    for(int i = 0; i < 5; i++)    {        sleep(1);        pid_t ret = wait(NULL);//回收任意一个子进程        if(ret < 0)        {            perror("wait failed");        }        else        {            printf("父进程回收子进程成功,子进程的pid:%d\n", ret);        }    }}intmain(){    for(int i = 0; i < 5; i++)    {        pid_t id = fork();        if(id == 0)        {            run_child();            exit(0);//执行run_child后,最子进程会退出        }    }    sleep(1);    printf("父进程准备回收子进程\n");    collect_child();    return 0;}

运行结果:可以看到创建子进程的顺序不一定就是父进程回收的顺序

如果子进程不退出呢?

如果子进程不退出,那么父进程默认在等待的时候,调用这个系统调用的时也就不返回,即父进程默认处于阻塞状态(参见文章OS19.【Linux】进程状态(1)复习),例如以下代码:

#include<stdio.h>#include<unistd.h>#include<stdlib.h>#include<sys/wait.h>intmain(){    for(int i = 0; i < 5; i++)    {        pid_t id = fork();        if(id == 0)        {            for(;;);//子进程一直不退出        }        else        {            sleep(1);            printf("父进程准备回收子进程\n");            sleep(1);            pid_t ret = wait(NULL);//父进程一直等待,处于阻塞状态            if(ret < 0)            {                perror("wait failed");            }            else            {                printf("父进程回收子进程成功,子进程的pid:%d\n", ret);            }        }    }    return 0;}

wait是waitpid的子集

对于waitpid(pid_t pid, int *_Nullable wstatus, int options) Pid==-1,可等待任何一个子进程,此时与wait 效,例如wait(NULL)和waitpid(-1.NULL,0)等价 Pid>0,等待其进程ID与pid形参相等的子进程

解释wstatus参数

子进程的退出状态(退出状态的定义参见OS23.【Linux】进程终止文章)可以通过wstatus的值知晓

pid_t wait(int *_Nullable wstatus);pid_t waitpid(pid_t pid, int *_Nullable wstatus, int options);

1.wstatus的类型为int*,是一个输出型参数(wait或waitpid通过wstatus修改int类型的变量)

2.用_Nullable编译器指示符修饰,顾名思义,告诉编译器: wstatus指针变量可能为NULL

实验1: wstatus的位图

运行以下代码:

#include<stdio.h>#include<unistd.h>#include<stdlib.h>#include<sys/wait.h>intmain(){    pid_t id = fork();    if(id < 0    {        perror("fork");        return 1;    }    else if(id == 0)    {        printf("子进程的pid:%d, ppid:%d\n"getpid(), getppid());        exit(1);//修改了这里    }    else    {        int status;        pid_t ret = wait(&status);        if(ret < 0)        {            perror("wait failed");        }        if (ret == id)         {            printf("父进程回收子进程成功,子进程的pid:%d\n", ret);            printf("status :%d\n", status);//修改了这里        }    }    return 0;}

运行结果:status的值不是exit(1)的1,而是256

256是2的整数倍,换算成二进制数:

猜测二进制数最高位的1就是exit(1)的1

验证猜测:

将exit(1)改成exit(0b1011),0b1011指的是1011是以二进制数表示的,运行结果:

猜测是正确的

进一步分析: 子进程的退出状态(退出状态的定义参见OS23.【Linux】进程终止文章)可以通过wstatus的值知晓,例如: 

1. 子进程是否异常退出

2. 如果没有异常,那么运行结果对吗?

3.如果运行结果不对,那么原因(看退出码)? 不同的退出码表示不同的出错原因

显然*wstatus要拆分成多个部分(位图)

wstatus的位图的详细说明

glibc 2.9库的bits/waitstatus.h中有wstatus各个位的说明:

/* Everything extant so far uses these same bits.  *//* If WIFEXITED(STATUS), the low-order 8 bits of the status.  */#define	__WEXITSTATUS(status)	(((status) & 0xff00) >> 8)/* If WIFSIGNALED(STATUS), the terminating signal.  */#define	__WTERMSIG(status)	((status) & 0x7f)/* If WIFSTOPPED(STATUS), the signal that stopped the child.  */#define	__WSTOPSIG(status)	__WEXITSTATUS(status)/* Nonzero if STATUS indicates normal termination.  */#define	__WIFEXITED(status)	(__WTERMSIG(status) == 0)/* Nonzero if STATUS indicates termination by a signal.  */#define __WIFSIGNALED(status) \  (((signed char) (((status) & 0x7f) + 1) >> 1) > 0)/* Nonzero if STATUS indicates the child is stopped.  */#define	__WIFSTOPPED(status)	(((status) & 0xff) == 0x7f)/* Nonzero if STATUS indicates the child continued after a stop.  We only   define this if <bits/waitflags.h> provides the WCONTINUED flag bit.  */#ifdef WCONTINUEDdefine __WIFCONTINUED(status)	((status) == __W_CONTINUED)#endif/* Nonzero if STATUS indicates the child dumped core.  */#define	__WCOREDUMP(status)	((status) & __WCOREFLAG)/* Macros for constructing status values.  */#define	__W_EXITCODE(ret, sig)	((ret) << 8 | (sig))#define	__W_STOPCODE(sig)	((sig) << 8 | 0x7f)#define __W_CONTINUED		0xffff#define	__WCOREFLAG		0x80

__WEXITSTATUS: 退出状态,在wstatus从右往左数的第二个字节,即退出码,前提是__WIFEXITED(status)为真,

            (((status) & 0xff00) >> 8)只要从右往左数的第二个字节

__WTERMSIG: 终止信号,在wstatus的低7位

         ((status) & 0x7f)中0x7f的二进制表示为0111 1111,只有低7位为1

__WSTOPSIG: 和退出状态是同一个意思

__WCOREDUMP: COREDUMP标志,在wstatus的低8位最高位

        ((status) & __WCOREFLAG)==((status) & 0x80),0x80的二进制表示只有一个1

注:

    1.core dump 指的是核心转储,也可以称之为 "吐核"

    操作系统在进程收到某些信号而终止运行时,将此时进程地址空间的内容以及有关进程状态的其他信息写入到一个磁盘文件中

    目前只需要知道: 该信息是用于调试的

    2.信号的编号从1开始,因此只需要检测中止信号字段是否为0,就能检测是否异常

其他宏:

__WIFEXITED(status)检测进程是否正常退出,如果进程正常退出,则宏值为真;如果进程异常退出,,则宏值为假

提醒:前面也可以不加下划线,<sys/wait.h>含有不带下划线的版本的宏

(摘自https://www.gnu.org/software/libc/manual/html_node/Process-Completion-Status.html)

其实 /usr/include/sys/wait.h中:

/* This will define all the `__W*' macros.  */include<bits/waitstatus.h>define WEXITSTATUS(status)	__WEXITSTATUS (status)define WTERMSIG(status)	__WTERMSIG (status)define WSTOPSIG(status)	__WSTOPSIG (status)define WIFEXITED(status)	__WIFEXITED (status)define WIFSIGNALED(status)	__WIFSIGNALED (status)define WIFSTOPPED(status)	__WIFSTOPPED (status)ifdef __WIFCONTINUED#  define WIFCONTINUED(status)	__WIFCONTINUED (status)

所以WEXITSTATUS(status) == WEXITSTATUS (status)、WTERMSIG(status)  == __WTERMSIG (status)、......

可以得出分布图,其中一个格子表示wstatus的1个比特位:

可以分两种情况看上面这个图:

1.进程正常终止

2.进程被信号所杀

实验2:手动提取wstatus的位

做个测试:

#include <bits/waitstatus.h>//必须写,否则要手动复制粘贴宏#include <stdio.h>int main(){	int wstatus = 0x12345678;	printf("wstatus: 0x%X\n", wstatus);	printf("__WEXITSTATUS: 0x%X\n", __WEXITSTATUS(wstatus));	printf("__WTERMSIG: 0x%X\n", __WTERMSIG(wstatus));	printf("__WSTOPSIG: 0x%X\n", __WSTOPSIG(wstatus));	printf("__WIFEXITED: 0x%X\n", __WIFEXITED(wstatus));	printf("__WIFSIGNALED: 0x%X\n", __WIFSIGNALED(wstatus));	printf("__WIFSTOPPED: 0x%X\n", __WIFSTOPPED(wstatus));	printf("__WCOREDUMP: 0x%X\n", __WCOREDUMP(wstatus));	return 0;}

运行结果:

注: *wstatus的最低8位表示是否异常,暂时不管高16位

结论: wstatus指针指向的int区域是以位图的方式存储进程的退出状态的(这里讲的退出状态不单指__WEXITSTATUS,而是退出码、终止信号和COREDUMP标志

实验3: 测试进程异常退出

#include<stdio.h>#include<unistd.h>#include<stdlib.h>#include<sys/wait.h>#include<bits/waitstatus.h>intmain(){    pid_t id = fork();    if(id < 0    {        perror("fork");        return 1;    }    else if(id == 0)    {        int val = 2/0;        exit(0);    }    else    {        int wstatus;        pid_t ret = wait(&wstatus);        if(ret < 0)        {            perror("wait failed");        }        if (ret == id)         {            printf("wstatus: 0x%X\n", wstatus);            printf("__WEXITSTATUS: 0x%X\n", __WEXITSTATUS(wstatus));            printf("__WTERMSIG: 0x%X\n", __WTERMSIG(wstatus));            printf("__WSTOPSIG: 0x%X\n", __WSTOPSIG(wstatus));            printf("__WIFEXITED: 0x%X\n", __WIFEXITED(wstatus));            printf("__WIFSIGNALED: 0x%X\n", __WIFSIGNALED(wstatus));            printf("__WIFSTOPPED: 0x%X\n", __WIFSTOPPED(wstatus));            printf("__WCOREDUMP: 0x%X\n", __WCOREDUMP(wstatus));        }    }    return 0;}

运行结果:wstatus为0x00 00 00 88,只有最低8位有数据,显然没有退出码,但退出信号为0x8

对应除0错误:

4.退出信息保存的位置

退出信息保存在子进程的PCB中,完整的task_struct的源代码参见OS17.【Linux】进程基础知识(1)文章,这里展示一部分

//......struct mm_struct* mm;struct mm_struct* active_mm;struct address_space* faults_disabled_mapping;int				exit_state;int				exit_code;int				exit_signal;/* The signal sent when the parent dies: */int				pdeath_signal;//......

使用wait时,函数会讲将exit_code、exit_signal和exit_state进行位运算合并到wstatus中

其实子进程退出时其实会向父进程发送信号SIGCHLD,这个之后的文章会分析

5.waitpid等待失败的情况举例

waitpid等待失败的其中一种情况:父进程等待的不是自己的子进程

#include<stdio.h>#include<unistd.h>#include<stdlib.h>#include<sys/wait.h>intmain(){    pid_t id = fork();    if(id < 0    {        perror("fork");        return 1;    }    else if(id == 0)    {        exit(0);    }    else    {        pid_t ret = waitpid(1,NULL,0);//PID=1是init进程        if(ret < 0)        {            perror("wait failed");        }        if (ret == id)         {            printf("wait success\n");        }    }    return 0;}

或者利用__WIFEXITED(status)宏,具体作用见上方说明

运行结果:

6.从task_struct看父子进程之间的联系

父进程怎么知道自己的子进程是谁呢?

答: 父进程task_struct存储了父进程的所有子进程的指针,即进程间的关系存放在进程描述符task_struct中

在《Linux内核的设计和实现 第三版》中的 第3章 进程管理 的 3.2 进程描述符及任务结构 的 3.2.6 进程家族树 中是这样说的:

3.2.6 进程家族树

        Unix 系统的进程之间存在一个明显的继承关系,在 Linux 系统中也是如此。所有的进程都是 PID 为 1 的 init 进程的的后代。内核在系统启动的最后阶段启动 init 进程。该进程读取系统的初始化脚本(initscript)并执行其他的相关程序,最终完成系统启动的整个过程。

        系统中的每个进程必有一个父进程,相应的,每个进程也可以拥有零个或多个子进程。拥有同一个父进程的所有进程被称为兄弟。进程间的关系存放在进程描述符中。每个 task_struct 都包含一个指向其父进程 tast_struct、叫做 parent 的指针,还包含一个称为 children 的子进程链表。所以,对于当前进程,可以通过下面的代码获得其父进程的进程描述符:

struct task_struct *my_parent = current->parent;

同样,也可以按以下方式依次访问子进程:

struct task_struct *task;struct list_head *list;list_for_each(list, &current->children) {    task = list_entry(list, struct task_struct, sibling);    /* task 现在指向当前的某个子进程 */}

init 进程的进程描述符是作为 init_task 静态分配的。下面的代码可以很好地演示所有进程之间的关系:

struct task_struct *task;for (task = current; task != &init_task; task = task->parent);/* task 现在指向 init */

实际上,你可以通过这种继承体系从系统的任何一个进程出发查找到任意指定的其他进程。但大多数时候,只需要通过简单的重复方式就可以遍历系统中的所有进程。这非常容易做到,因为任务队列本来就是一个双向的循环链表。对于给定的进程,获取链表中的下一个进程:

list_entry(task->tasks.next, struct task_struct, tasks)

获取前一个进程的方法与之相同:

list_entry(task->tasks.prev, struct task_struct, tasks)

这两个例程分别通过 next_task(task) 宏和 prev_task(task) 宏实现。而实际上,for_each_process(task) 宏提供了依次访问整个任务队列的能力。每次访问,任务指针都指向链表中的下一个元素:

struct task_struct *task;for_each_process(task{/* 它打印出每一个任务的名称和 PID*/printk("%s[%d]\n", task->comm, task->pid);}

特别提醒 在一个拥有大量进程的系统中通过重复来遍历所有的进程的代价是很大的。因此,如果没有充足的理由(或者别无他法),别这样做。

可以看看Linux v6.19.10的task_struct中关于父子进程的相关字段:

/*    * Pointers to the (original) parent process, youngest child, younger sibling,    * older sibling, respectively.  (p->father can be replaced with    * p->real_parent->pid)*//* Real parent process: */struct task_struct __rcu	*real_parent;/* Recipient of SIGCHLD, wait4() reports: */struct task_struct __rcu	*parent;/*    * Children/sibling form the list of natural children:*/struct list_head		children;

7.参考资料

redhat.com killing-zombies-linux-style

askubuntu what-is-a-defunct-process-and-why-doesnt-it-get-killed

stackoverflow i-used-waitstatus-and-the-value-of-status-is-256-why

gnu libc Process-Completion-Status

有关waitpid的options参数和非阻塞的问题下一篇讲

原文首发于CSDN,点击阅读全文即可查看

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-03 01:04:26 HTTP/2.0 GET : https://f.mffb.com.cn/a/502348.html
  2. 运行时间 : 0.672712s [ 吞吐率:1.49req/s ] 内存消耗:4,761.64kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=0e3dae8a89f19b05f2ace29e4c36d659
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.001300s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001668s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.008177s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.101352s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001639s ]
  6. SELECT * FROM `set` [ RunTime:0.077340s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001588s ]
  8. SELECT * FROM `article` WHERE `id` = 502348 LIMIT 1 [ RunTime:0.030107s ]
  9. UPDATE `article` SET `lasttime` = 1783011866 WHERE `id` = 502348 [ RunTime:0.097545s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.007549s ]
  11. SELECT * FROM `article` WHERE `id` < 502348 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.019788s ]
  12. SELECT * FROM `article` WHERE `id` > 502348 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.006625s ]
  13. SELECT * FROM `article` WHERE `id` < 502348 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.058511s ]
  14. SELECT * FROM `article` WHERE `id` < 502348 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.079604s ]
  15. SELECT * FROM `article` WHERE `id` < 502348 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.010174s ]
0.674396s