当前位置:首页>Linux>Linux驱动-inode,file,file_operations关系

Linux驱动-inode,file,file_operations关系

  • 2026-01-31 19:11:09
Linux驱动-inode,file,file_operations关系

击左上方蓝色“一口Linux”,选择“设为星标

第一时间看干货文章
【干货】嵌入式驱动工程师学习路线
【干货】Linux嵌入式知识点-思维导图-免费获取
【就业】一个可以写到简历的基于Linux物联网综合项目
【就业】简历模版

本文目标

  1. 文件描述符和设备节点之间关系;

  2. 三大结构体inode,file,file_operations之间的关系;

  3. 驱动如何区分出次设备号。

  4. read/write接口函数要能够获得字符设备结构体变量地址。

什么是文件描述符?

Linux 中一切都可以看作文件,包括普通文件、链接文件、Socket 以及设备驱动等,对其进行相关操作时,都可能会创建对应的文件描述符。文件描述符(file descriptor)是内核为了高效管理已被打开的文件所创建的索引,用于指代被打开的文件,对文件所有 I/O 操作相关的系统调用都需要通过文件描述符。

Linux启动后,会默认打开3个文件描述符,分别是:

0:标准输入standard input

1:正确输出standard output

2:错误输出:error output

以后打开文件后。新增文件绑定描述符 可以依次增加(从3开始累加)。每一条shell命令执行,都会继承父进程的文件描述符。因此,所有运行的shell命令,都会有默认3个文件描述符。

l进程级别的文件描述符表:内核为每个进程维护一个文件描述符表,该表记录了文件描述符的相关信息,包括文件描述符、指向打开文件表中记录的指针。

l系统级别的打开文件表:内核对所有打开文件维护的一个进程共享的打开文件描述表,表中存储了处于打开状态文件的相关信息,包括文件类型、访问权限、文件操作函数(file_operations)等。

l系统级别的 i-node 表:i-node 结构体记录了文件相关的信息,包括文件长度,文件所在设备,文件物理位置,创建、修改和更新时间等,"ls -i" 命令可以查看文件 i-node 节点。

进程在Linux内核中是由结构体task_struct维护,进程打开的所有文件描述符都在进程维护的结构体task_struct的files变量中维护:

include\linux\sched.h

该结构体定义如下:

该进程所有打开的文件对应的file指针均由fd_array维护,文件描述符和数组下标一一对应。

文件描述符是一种系统资源,可以通过以下命令来查看文件描述符的上限。

打开文件相关操作

查看所有进程允许打开的最大 fd 数量

查看所有进程已经打开的 fd 数量以及允许的最大数量

查看单个进程允许打开的最大 fd 数量.

查看某个文件被哪些进程打开?

可以借助lsof命令

编写调试代码如下:

该代码只打开文件123.c。

&是程序放在后台运行。

3042:程序进程。

查看某个进程打开了哪些文件?

接着上述的例子,ls -l /proc/{PID}/fd 可以查看某个进程打开了哪些文件。

 可以看到该进程打开了出了123.c之外,还打开了前面所述的3个默认文件。 

实际开发中,可能会遇到 fd 资源超过上限导致的 "Too many open files" 之类的问题,一般都是因为没有及时释放掉 fd,若循环执行超过单个进程允许打开的最大 fd 数量,程序就会出现异常。

Linux设备文件三大结构:inode,file,file_operations

驱动程序就是向下控制硬件,向上提供接口,这里的向上提供的接口最终对应到应用层有三种方式:设备文件,/proc,/sys,其中最常用的就是使用设备文件,而Linux设备中用的最多的就是字符设备,本文就以字符设备为例来分析创建并打开一个字符设备的文件内部机制。

struct inode

Linux中一切皆文件,当我们在Linux中创建一个文件时,就会在相应的文件系统创建一个inode与之对应.

对于不同的文件类型,inode被填充的成员内容也会有所不同,以创建字符设备为例,我们知道,add_chrdev_region其实是把一个驱动对象和一个(一组)设备号联系到一起。而创建设备文件,其实是把设备文件设备号联系到一起。至此,这三者就被绑定在一起了。这样,内核就有能力创建一个struct inode实例了,下面是Linux 3.14内核中的inode。这个inode是VFS的inode,是最具体文件系统的inode的进一步封装,也是驱动开发中关心的inode,针对具体的文件系统,还有struct ext2_inode_info 等结构。

//include/linux/fs.h 596

/*

 * Keep mostly read-only and often accessed (especially for

 * the RCU path lookup and 'stat' data) fields at the beginning

 * of the 'struct inode'

 */

struct inode {

    umode_t            i_mode;

    unsigned short        i_opflags;

    kuid_t            i_uid;

    kgid_t            i_gid;

    unsigned int        i_flags;

    dev_t            i_rdev;

#ifdef CONFIG_FS_POSIX_ACL

    struct posix_acl    *i_acl;

    struct posix_acl    *i_default_acl;

#endif

    const struct inode_operations    *i_op;

    struct super_block    *i_sb;

    struct address_space    *i_mapping;

#ifdef CONFIG_SECURITY

    void            *i_security;

#endif

    /* Stat data, not accessed from path walking */

    unsigned long        i_ino;

    /*

     * Filesystems may only read i_nlink directly.  They shall use the

     * following functions for modification:

     *

     *    (set|clear|inc|drop)_nlink

     *    inode_(inc|dec)_link_count

     */

    union {

        const unsigned int i_nlink;

        unsigned int __i_nlink;

    };

   dev_t            i_rdev;

    loff_t            i_size;

    struct timespec        i_atime;

    struct timespec        i_mtime;

    struct timespec        i_ctime;

    spinlock_t        i_lock;    /* i_blocks, i_bytes, maybe i_size */

    unsigned short          i_bytes;

    unsigned int        i_blkbits;

    blkcnt_t        i_blocks;

#ifdef __NEED_I_SIZE_ORDERED

    seqcount_t        i_size_seqcount;

#endif

    /* Misc */

    unsigned long        i_state;

    struct mutex        i_mutex;

    unsigned long        dirtied_when;    /* jiffies of first dirtying */

    struct hlist_node    i_hash;

    struct list_head    i_wb_list;    /* backing dev IO list */

    struct list_head    i_lru;        /* inode LRU list */

    struct list_head    i_sb_list;

    union {

        struct hlist_head    i_dentry;

        struct rcu_head        i_rcu;

    };

    u64            i_version;

    atomic_t        i_count;

    atomic_t        i_dio_count;

    atomic_t        i_writecount;

    const struct file_operations    *i_fop;    /* former ->i_op->default_file_ops */

    struct file_lock    *i_flock;

    struct address_space    i_data;

#ifdef CONFIG_QUOTA

    struct dquot        *i_dquot[MAXQUOTAS];

#endif

    struct list_head    i_devices;

    union {

        struct pipe_inode_info    *i_pipe;

        struct block_device    *i_bdev;

struct cdev        *i_cdev;

    };

    __u32            i_generation;

#ifdef CONFIG_FSNOTIFY

    __u32            i_fsnotify_mask; /* all events this inode cares about */

    struct hlist_head    i_fsnotify_marks;

#endif

#ifdef CONFIG_IMA

    atomic_t        i_readcount; /* struct files open RO */

#endif

    void            *i_private; /* fs or device private pointer */

};

这里面与本文相关的成员主要有:

struct inode

--602-->i_mode表示访问权限控制

--604-->UID

--605-->GID

--606-->i_flags文件系统标志

--630-->硬链接数计数

--635-->i_size以字节为单位的文件大小

--636-->最后access时间

--637-->最后modify时间

--638-->最后change时间

--669-->i_dentry; //目录项链表

--673-->i_count引用计数,当引用计数变为0时,会释放inode实例

--675-->i_writecount写者计数

--679-->创建设备文件的时候i_fops填充的是def_chr_fops,blk_blk_fops,def_fifo_fops,bad_sock_fops之一,参见创建过程中调用的init_special_inode()

--683-->特殊文件类型的union,pipe,cdev,blk.link etc,i_cdev表示这个inode属于一个字符设备文件,本文中创建设备文件的时候会把与之相关的设备号的驱动对象cdev拿来填充

--702-->inode的私有数据

struct file

Linux内核会为每一个进程维护一个文件描述符表,这个表其实就是struct file[]的索引。open()的过程其实就是根据传入的路径填充好一个file结构并将其赋值到数组中并返回其索引。下面是file的主要内容

struct file {

    union {

        struct llist_node    fu_llist;

        struct rcu_head     fu_rcuhead;

    } f_u;

    struct path        f_path;

#define f_dentry    f_path.dentry

  struct inode        *f_inode;    /* cached value */

    const struct file_operations    *f_op;

    /*

     * Protects f_ep_links, f_flags.

     * Must not be taken from IRQ context.

     */

    spinlock_t        f_lock;

    atomic_long_t        f_count;

    unsigned int         f_flags;

    fmode_t            f_mode;

    struct mutex        f_pos_lock;

    loff_t            f_pos;

    struct fown_struct    f_owner;

    const struct cred    *f_cred;

    struct file_ra_state    f_ra;

    u64            f_version;

#ifdef CONFIG_SECURITY

    void            *f_security;

#endif

    /* needed for tty driver, and maybe others */

    void            *private_data;

#ifdef CONFIG_EPOLL

    /* Used by fs/eventpoll.c to link all the hooks to this file */

    struct list_head    f_ep_links;

    struct list_head    f_tfile_llink;

#endif /* #ifdef CONFIG_EPOLL */

    struct address_space    *f_mapping;

#ifdef CONFIG_DEBUG_WRITECOUNT

    unsigned long f_mnt_write_state;

#endif

} __attribute__((aligned(4)));    /* lest something weird decides that 2 is OK */

struct file

--882-->f_path里存储的是open传入的路径,VFS就是根据这个路径逐层找到相应的inode

--883-->f_inode里存储的是找到的inode

--884-->f_op里存储的就是驱动提供的file_operations对象,这个对象应该在第一次open()的时候被填充,具体地,应用层的open通过层层搜索会调用inode.i_fops->open(),即我们注册的open接口函数chrdev_open()

--891-->f_count的作用是记录对文件对象的引用计数,也即当前有多少个使用CLONE_FILES标志克隆的进程在使用该文件。典型的应用是在POSIX线程中。就像在内核中普通的引用计数模块一样,最后一个进程调用put_files_struct()来释放文件描述符。

--892-->f_flags当打开文件时指定的标志,对应系统调用open的int flags,比如驱动程序为了支持非阻塞型操作需要检查这个标志是否有O_NONBLOCK。

--893-->f_mode;对文件的读写模式,对应系统调用open的mod_t mode参数,比如O_RDWR。如果驱动程序需要这个值,可以直接读取这个字段。

--905-->private_data表示file结构的私有数据

mknod 做了什么事?

本例假定我们创建两个串口com0、com1,他们公用同一个主设备号250,次设备号分别为0、1,他们公用同一个字符设备驱动,那么我们的驱动要能够根据应用进程打开的是设备com0还是com1来操作不同的串口。

首先创建两个设备节点:

mknod /dev/com0 250 0

mknod /dev/com1 250 1

执行结果如下:

内核为了维护这两个文件节点,内核需要创建结构体维护这两个文件,具体如下:

从以上结构图可以得知,当我们通过命令mknod 创建一个字符设备文件,那么内核就会创建好一个inode会存在存储器中,创建和该文件实体一一对应的inode。这个inode和其他的inode一样,用来存储关于这个文件的静态信息(不变的信息),包括这个设备文件对应的设备号,文件的路径以及对应的驱动对象等。

inode作为VFS四大对象之一,在驱动开发中很少需要自己进行填充,更多的是在open()方法中进行查看并根据需要填充我们的file结构。

由上图所示,创建字符设备 /dev/com0、 /dev/com1,只是增加了对应的inode节点,此时VFS层并没有并没有创建file结构体,而且inode和驱动也并没有产生联系。

如果获得次设备号

    对于同种类型设备,比如多个串口、网口等,这些驱动比较类似,仅仅是一些寄存器基地址不一样,所以我们没有必须要为每一个设备单独写一个驱动,这些设备的驱动完全可以共用同一个驱动,我们只需要在驱动中区分出设备的次设备号,然后根据次设备号的访问不同的内存地址空间即可。

如果应用程序执行以下代码

fd0 = open("/dev/com0",O_RDWR);

fd1 = open("/dev/com1",O_RDWR);

当应用程序执行open函数,该函数会调用到内核的sys_open(),该函数会根据该设备节点inode保存的信息,i_flags:文件类型, i_rdev:设备号,初始化结构体inode其他信息,比如inode->i_cdev,此时已经指向我们注册的cdev结构体,。通过设备号,可以很容易找到该设备在设备号全局管理数组chedevs[]的下标,进而找到我们注册的驱动cdev以及file_operations。

同时内核会在VFS层为创建结构体file,该函数调用成功之后,应用层会返回整型值用来和该file对应,就是上图的文件描述符fd0、fd1。

其中:

file->f_dentry->d_inode->i_rdev  保存对应的设备节点的设备号,

file-> f_op保存我们注册的file_operations 字符设备接口函数集合。

由此可得在read和write等其他接口函数中,我们可以通过file来得到次设备号。

【注意】同一个文件如果打开了两次,那么第二次linux内核仍然会重新分配1个新的file结构体。

实现代码如下:

这样我们就可以根据次设备号来操作不同的硬件。

如何获得注册的设备结构体私有地址?

在大多情况下,我们会创建一个自定义的设备信息维护结构体,同时创建一个指针数组用来管理不同的设备。

然后通过成员cdev注册字符设备,

想一个问题:如果我们为每一个同类型设备分配独立的设备结构体,分别注册对应的cdev,假如我打开/dev/com0 进行操作的时候,我怎么知道com0对应我们自己定义的设备管理结构体变量的地址呢?

有问题是好的,我们带着问题出发,看看大牛们是怎么做的。

该函数功能:

字符设备架构调用我们注册的接口函数open会传递参数inode和file,inode->i_cdev指向了我们注册的pmydev[i]->cdev,在open中通过inode->cdev来识别具体的设备,通过container_of来找到对应的pmycdev结构体变量,并将其私有数据隐藏到file结构的private_data中,进而识别同一个驱动操作一类设备

而read,write接口函数可以直接通过file的 private_data获取对应的pmycdev结构体变量。

【补充1】

再来看下contianer_of 接口功能参数如下:

该宏是如何实现的,留给读者自己思考。

【补充2】

我们也可以在回调cdev.fops->open()阶段重新填充file结构的fop,进而实现同一个驱动操作不同的设备,这种思想就是内核驱动中常用的分层!

执行结果如下:

由结果可知,应用程序正确读取了minor的值。

从内核log来看,MINOR(file->f_dentry->d_inode->i_rdev)可以成功读取此设备号。而read接口函数也成功通过file->private_data得到了设备结构体变量(初始化的时候为不同设备的test成员附了不同的值)。

 驱动程序:

#include <linux/init.h>#include <linux/module.h>#include <linux/kdev_t.h>#include <linux/fs.h>#include <linux/cdev.h>#include <linux/slab.h>#include <linux/uaccess.h>static int major = 250;static int minor = 0;static dev_t devno;#define MAX_COM_NUM 2struct mydev{    struct cdev cdev;    char *reg;    int test;};struct mydev *pmydev[MAX_COM_NUM];ssize_t dev_fifo_read (struct file *file, char __user *buf, size_t size, loff_t *pos){    int minor = MINOR(file->f_dentry->d_inode->i_rdev);    struct mydev *cd;    printk("read() MINOR(file->f_dentry->d_inode->i_rdev)=%d\n",minor);    cd = (struct mydev *)file->private_data;    printk("read()       file->private_data         cd->test=%d\n",cd->test);    if(copy_to_user(buf, &minor, size)){        return -EFAULT;    }    return size;}int dev_fifo_close (struct inode *inode, struct file *file){    printk("dev_fifo_close()\n");    return 0;}//打开设备static int dev_fifo_open (struct inode *inode, struct file *file){    struct mydev *cd;    cd = container_of(inode->i_cdev, struct mydev, cdev);    file->private_data = cd;    return 0;}static struct file_operations dev_fifo_ops ={    .open = dev_fifo_open,    .read = dev_fifo_read,    .release = dev_fifo_close,};static int dev_fifo_init(void){    int result;    int error;    int i = 0;    printk("dev_fifo_init \n");    devno = MKDEV(major,minor);        result = register_chrdev_region(devno, MAX_COM_NUM, "test");    if(result<0)    {        printk("register_chrdev_region fail \n");        goto ERR1;    }    for(i=0;i<MAX_COM_NUM;i++)    {        pmydev[i] =kmalloc(sizeof(struct mydev), GFP_KERNEL);    }    for(i=0;i<MAX_COM_NUM;i++)    {        pmydev[i]->test = i;        cdev_init(&pmydev[i]->cdev,&dev_fifo_ops);        devno = MKDEV(major,i);            error = cdev_add(&pmydev[i]->cdev,devno,1);        if(error < 0)        {            printk("cdev_add fail \n");            goto ERR2;        }    }    return 0;ERR2:    devno = MKDEV(major,0);        unregister_chrdev_region(devno,MAX_COM_NUM);    for(i=0;i<MAX_COM_NUM;i++)    {        kfree(pmydev[i]);    }    return error;ERR1:    return result;}static void dev_fifo_exit(void){    int i;    printk("dev_fifo_exit \n");    for(i=0;i<MAX_COM_NUM;i++)    {        cdev_del(&pmydev[i]->cdev);    }    for(i=0;i<MAX_COM_NUM;i++)    {        kfree(pmydev[i]);    }

    devno = MKDEV(major,0);        unregister_chrdev_region(devno,MAX_COM_NUM);    return;}MODULE_LICENSE("GPL");MODULE_AUTHOR("daniel.peng");module_init(dev_fifo_init);module_exit(dev_fifo_exit);

测试程序

#include <stdio.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>main(){    int fd0,fd1;    int minor;    fd0 = open("/dev/com0",O_RDWR);    if(fd0<0)    {        perror("open fail \n");        return;    }    printf("open /dev/com0 OK\n");    read(fd0,&minor,sizeof(minor));    printf("minor of /dev/com0 =%d\n",minor);    close(fd0);    fd1 = open("/dev/com1",O_RDWR);    if(fd1<0)    {        perror("open fail \n");        return;    }    printf("open /dev/com1 OK\n");    read(fd1,&minor,sizeof(minor));    printf("minor of /dev/com1 =%d\n",minor);    close(fd1);

end

一口Linux 

关注,回复【1024】海量Linux资料赠送

精彩文章合集

文章推荐

【专辑】ARM
【专辑】粉丝问答
【专辑】所有原创
专辑linux入门
专辑计算机网络
专辑Linux驱动
【干货】嵌入式驱动工程师学习路线
【干货】Linux嵌入式所有知识点-思维导图

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-07 13:32:19 HTTP/2.0 GET : https://f.mffb.com.cn/a/470281.html
  2. 运行时间 : 0.303343s [ 吞吐率:3.30req/s ] 内存消耗:4,673.77kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=a41fda3f2a581b8cdb5810c2d8e3e3c6
  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.001116s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001594s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000765s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000722s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001357s ]
  6. SELECT * FROM `set` [ RunTime:0.000562s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001444s ]
  8. SELECT * FROM `article` WHERE `id` = 470281 LIMIT 1 [ RunTime:0.014352s ]
  9. UPDATE `article` SET `lasttime` = 1770442339 WHERE `id` = 470281 [ RunTime:0.010543s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.000792s ]
  11. SELECT * FROM `article` WHERE `id` < 470281 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.001128s ]
  12. SELECT * FROM `article` WHERE `id` > 470281 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.005894s ]
  13. SELECT * FROM `article` WHERE `id` < 470281 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.003619s ]
  14. SELECT * FROM `article` WHERE `id` < 470281 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.035966s ]
  15. SELECT * FROM `article` WHERE `id` < 470281 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.049922s ]
0.308436s