当前位置:首页>Linux>Linux内核数据结构专题

Linux内核数据结构专题

  • 2026-02-10 09:20:30
Linux内核数据结构专题

概述

Linux内核使用了大量精心设计的数据结构来管理复杂的系统资源。这些数据结构经过高度优化,能够在各种场景下提供优异的性能。本专题深入剖析内核中最常用的数据结构。


一、链表(list_head)

1.1 基本结构

// include/linux/list.h
structlist_head {
structlist_head *next, *prev;
};

1.2 链表操作实现

// list_demo.c - 内核链表使用示例
#include<linux/init.h>
#include<linux/module.h>
#include<linux/kernel.h>
#include<linux/slab.h>
#include<linux/list.h>

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Kernel Linked List Demo");

// 定义数据结构
structstudent {
int id;
char name[32];
int score;
structlist_headlist;// 链表节点
};

// 定义链表头
staticLIST_HEAD(student_list);

// 添加学生
staticvoidadd_student(int id, constchar *name, int score)
{
structstudent *stu;

    stu = kmalloc(sizeof(*stu), GFP_KERNEL);
if (!stu)
return;

    stu->id = id;
strncpy(stu->name, name, sizeof(stu->name) - 1);
    stu->score = score;

// 初始化链表节点
    INIT_LIST_HEAD(&stu->list);

// 添加到链表
    list_add_tail(&stu->list, &student_list);

    printk(KERN_INFO "Added student: %d - %s\n", id, name);
}

// 遍历链表
staticvoidshow_students(void)
{
structstudent *stu;

    printk(KERN_INFO "=== Student List ===\n");

// 正向遍历
    list_for_each_entry(stu, &student_list, list) {
        printk(KERN_INFO "ID: %d, Name: %s, Score: %d\n",
               stu->id, stu->name, stu->score);
    }

// 反向遍历
    printk(KERN_INFO "=== Reverse Order ===\n");
    list_for_each_entry_reverse(stu, &student_list, list) {
        printk(KERN_INFO "ID: %d, Name: %s\n", stu->id, stu->name);
    }
}

// 查找学生
staticstruct student *find_student(int id)
{
structstudent *stu;

    list_for_each_entry(stu, &student_list, list) {
if (stu->id == id)
return stu;
    }

returnNULL;
}

// 删除学生
staticvoiddelete_student(int id)
{
structstudent *stu = find_student(id);

if (stu) {
        list_del(&stu->list);
        printk(KERN_INFO "Deleted student: %d\n", id);
        kfree(stu);
    }
}

// 安全遍历并删除
staticvoiddelete_all_students(void)
{
structstudent *stu, *tmp;

// 安全遍历(允许删除)
    list_for_each_entry_safe(stu, tmp, &student_list, list) {
        list_del(&stu->list);
        kfree(stu);
    }
}

staticint __init list_demo_init(void)
{
    printk(KERN_INFO "List Demo Module Loaded\n");

// 添加测试数据
    add_student(1001"Alice"95);
    add_student(1002"Bob"88);
    add_student(1003"Charlie"92);

// 显示所有学生
    show_students();

// 查找测试
structstudent *found = find_student(1002);
if (found)
        printk(KERN_INFO "Found: %s\n", found->name);

return0;
}

staticvoid __exit list_demo_exit(void)
{
    delete_all_students();
    printk(KERN_INFO "List Demo Module Unloaded\n");
}

module_init(list_demo_init);
module_exit(list_demo_exit);

1.3 高级链表操作

// list_advanced.c - 链表高级操作
#include<linux/list.h>

// 链表合并
staticvoidlist_demo_splice(void)
{
    LIST_HEAD(list1);
    LIST_HEAD(list2);

// ... 添加元素到 list1 和 list2 ...

// 将list2合并到list1
    list_splice(&list2, &list1);

// 合并并重新初始化list2
    list_splice_init(&list2, &list1);
}

// 链表替换
staticvoidlist_demo_replace(void)
{
structlist_head *old_entry, *new_entry;

// 替换链表中的节点
    list_replace(old_entry, new_entry);

// 替换并重新初始化old
    list_replace_init(old_entry, new_entry);
}

// 移动节点
staticvoidlist_demo_move(void)
{
structlist_head *entry, *head;

// 移动到头部
    list_move(entry, head);

// 移动到尾部
    list_move_tail(entry, head);
}

// 判断链表状态
staticvoidlist_demo_check(void)
{
structlist_head *head, *entry;

// 检查链表是否为空
if (list_empty(head))
        printk("List is empty\n");

// 检查是否是最后一个元素
if (list_is_last(entry, head))
        printk("This is the last entry\n");

// 检查是否只有一个元素
if (list_is_singular(head))
        printk("List has only one entry\n");
}

二、哈希链表(hlist)

2.1 基本结构

// include/linux/list.h
structhlist_head {
structhlist_node *first;
};

structhlist_node {
structhlist_node *next, **pprev;
};

2.2 哈希表实现

// hash_table.c - 哈希表实现
#include<linux/init.h>
#include<linux/module.h>
#include<linux/hashtable.h>
#include<linux/slab.h>

MODULE_LICENSE("GPL");

// 定义哈希表大小(2的幂)
#define HASH_BITS 8
DECLARE_HASHTABLE(my_hash_table, HASH_BITS);

// 数据结构
structhash_entry {
int key;
char data[64];
structhlist_nodenode;
};

// 初始化哈希表
staticvoidinit_hash_table(void)
{
    hash_init(my_hash_table);
}

// 添加元素
staticvoidhash_add_entry(int key, constchar *data)
{
structhash_entry *entry;

    entry = kmalloc(sizeof(*entry), GFP_KERNEL);
if (!entry)
return;

    entry->key = key;
strncpy(entry->data, data, sizeof(entry->data) - 1);

// 添加到哈希表
    hash_add(my_hash_table, &entry->node, key);

    printk(KERN_INFO "Added: key=%d, data=%s\n", key, data);
}

// 查找元素
staticstruct hash_entry *hash_find_entry(int key)
{
structhash_entry *entry;

    hash_for_each_possible(my_hash_table, entry, node, key) {
if (entry->key == key)
return entry;
    }

returnNULL;
}

// 删除元素
staticvoidhash_del_entry(int key)
{
structhash_entry *entry = hash_find_entry(key);

if (entry) {
        hash_del(&entry->node);
        kfree(entry);
        printk(KERN_INFO "Deleted: key=%d\n", key);
    }
}

// 遍历哈希表
staticvoidhash_traverse(void)
{
structhash_entry *entry;
structhlist_node *tmp;
int bkt;

    printk(KERN_INFO "=== Hash Table Contents ===\n");

    hash_for_each_safe(my_hash_table, bkt, tmp, entry, node) {
        printk(KERN_INFO "Bucket[%d]: key=%d, data=%s\n",
               bkt, entry->key, entry->data);
    }
}

// 清空哈希表
staticvoidhash_cleanup(void)
{
structhash_entry *entry;
structhlist_node *tmp;
int bkt;

    hash_for_each_safe(my_hash_table, bkt, tmp, entry, node) {
        hash_del(&entry->node);
        kfree(entry);
    }
}

staticint __init hash_demo_init(void)
{
    printk(KERN_INFO "Hash Table Demo Loaded\n");

    init_hash_table();

// 添加测试数据
    hash_add_entry(100"Data for key 100");
    hash_add_entry(200"Data for key 200");
    hash_add_entry(150"Data for key 150");

// 遍历显示
    hash_traverse();

// 查找测试
structhash_entry *found = hash_find_entry(200);
if (found)
        printk(KERN_INFO "Found: %s\n", found->data);

return0;
}

staticvoid __exit hash_demo_exit(void)
{
    hash_cleanup();
    printk(KERN_INFO "Hash Table Demo Unloaded\n");
}

module_init(hash_demo_init);
module_exit(hash_demo_exit);

三、红黑树(rbtree)

3.1 基本结构

// include/linux/rbtree.h
structrb_node {
unsignedlong  __rb_parent_color;
structrb_node *rb_right;
structrb_node *rb_left;
};

structrb_root {
structrb_node *rb_node;
};

3.2 红黑树实现

// rbtree_demo.c - 红黑树使用示例
#include<linux/init.h>
#include<linux/module.h>
#include<linux/rbtree.h>
#include<linux/slab.h>

MODULE_LICENSE("GPL");

// 数据节点
structrb_object {
int key;
char data[64];
structrb_nodenode;
};

// 红黑树根
staticstructrb_rootmy_tree = RB_ROOT;

// 插入节点
staticintrb_insert(struct rb_root *root, struct rb_object *obj)
{
structrb_node **new = &(root->rb_node), *parent = NULL;

// 找到插入位置
while (*new) {
structrb_object *this = container_of(*new, struct rb_object, node);
int result = obj->key - this->key;

        parent = *new;
if (result < 0)
            new = &((*new)->rb_left);
elseif (result > 0)
            new = &((*new)->rb_right);
else
return-1;  // 键已存在
    }

// 链接节点并重新平衡
    rb_link_node(&obj->node, parent, new);
    rb_insert_color(&obj->node, root);

return0;
}

// 查找节点
staticstruct rb_object *rb_search(struct rb_root *root, int key)
{
structrb_node *node = root->rb_node;

while (node) {
structrb_object *obj = container_of(node, struct rb_object, node);
int result = key - obj->key;

if (result < 0)
            node = node->rb_left;
elseif (result > 0)
            node = node->rb_right;
else
return obj;
    }

returnNULL;
}

// 删除节点
staticvoidrb_delete(struct rb_root *root, int key)
{
structrb_object *obj = rb_search(root, key);

if (obj) {
        rb_erase(&obj->node, root);
        kfree(obj);
        printk(KERN_INFO "Deleted node with key: %d\n", key);
    }
}

// 中序遍历
staticvoidrb_inorder_walk(struct rb_node *node)
{
if (node) {
        rb_inorder_walk(node->rb_left);

structrb_object *obj = container_of(node, struct rb_object, node);
        printk(KERN_INFO "Key: %d, Data: %s\n", obj->key, obj->data);

        rb_inorder_walk(node->rb_right);
    }
}

// 使用rb_first/rb_next遍历
staticvoidrb_iterate(void)
{
structrb_node *node;

    printk(KERN_INFO "=== RB Tree Iterator ===\n");

for (node = rb_first(&my_tree); node; node = rb_next(node)) {
structrb_object *obj = container_of(node, struct rb_object, node);
        printk(KERN_INFO "Key: %d\n", obj->key);
    }
}

// 清理红黑树
staticvoidrb_cleanup(void)
{
structrb_node *node;

while ((node = rb_first(&my_tree))) {
structrb_object *obj = container_of(node, struct rb_object, node);
        rb_erase(node, &my_tree);
        kfree(obj);
    }
}

staticint __init rbtree_demo_init(void)
{
    printk(KERN_INFO "RB Tree Demo Loaded\n");

// 添加测试数据
int keys[] = {50307020406080102535};
int i;

for (i = 0; i < ARRAY_SIZE(keys); i++) {
structrb_object *obj = kmalloc(sizeof(*obj), GFP_KERNEL);
if (obj) {
            obj->key = keys[i];
snprintf(obj->data, sizeof(obj->data), "Data_%d", keys[i]);

if (rb_insert(&my_tree, obj) == 0) {
                printk(KERN_INFO "Inserted: %d\n", keys[i]);
            } else {
                kfree(obj);
            }
        }
    }

    printk(KERN_INFO "=== In-order Traversal ===\n");
    rb_inorder_walk(my_tree.rb_node);

    rb_iterate();

return0;
}

staticvoid __exit rbtree_demo_exit(void)
{
    rb_cleanup();
    printk(KERN_INFO "RB Tree Demo Unloaded\n");
}

module_init(rbtree_demo_init);
module_exit(rbtree_demo_exit);

编译和测试

Makefile

# 内核源码路径
KDIR ?= /lib/modules/$(shell uname -r)/build

# 模块列表
obj-m += list_demo.o
obj-m += hash_table.o
obj-m += rbtree_demo.o

all:
$(MAKE) -C $(KDIR) M=$(PWD) modules

clean:
$(MAKE) -C $(KDIR) M=$(PWD) clean

test:
sudo insmod list_demo.ko
dmesg | tail -20
sudo rmmod list_demo

sudo insmod hash_table.ko
dmesg | tail -20
sudo rmmod hash_table

sudo insmod rbtree_demo.ko
dmesg | tail -20
sudo rmmod rbtree_demo

数据结构选择指南

数据结构
适用场景
时间复杂度
特点
list_head
元素较少,频繁插入/删除
O(n)查找, O(1)插入/删除
双向循环链表
hlist
哈希表冲突链
O(1)平均查找
单指针头节点
rbtree
有序数据,范围查询
O(log n)
自平衡二叉树
XArray
稀疏索引数组
O(log n)
支持RCU,替代radix tree
bitmap
位标记,资源管理
O(1)
空间高效
kfifo
生产者-消费者
O(1)
无锁环形缓冲

实践检查清单

  • [ ] 理解内核链表的侵入式设计
  • [ ] 掌握container_of宏的使用
  • [ ] 实现自定义哈希表
  • [ ] 理解红黑树的平衡机制
  • [ ] 使用XArray管理稀疏数据
  • [ ] 实现无锁数据结构

下一步

学习完内核数据结构后,可以:

  • 研究RCU机制和无锁编程
  • 学习内核内存管理
  • 分析实际内核代码中的数据结构使用

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-10 15:30:15 HTTP/2.0 GET : https://f.mffb.com.cn/a/474723.html
  2. 运行时间 : 0.390595s [ 吞吐率:2.56req/s ] 内存消耗:4,920.95kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=db892f9c8c6bc0c36b8080846ebc866e
  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.001351s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001616s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.001388s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000758s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001478s ]
  6. SELECT * FROM `set` [ RunTime:0.000690s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001500s ]
  8. SELECT * FROM `article` WHERE `id` = 474723 LIMIT 1 [ RunTime:0.038622s ]
  9. UPDATE `article` SET `lasttime` = 1770708616 WHERE `id` = 474723 [ RunTime:0.016655s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.004603s ]
  11. SELECT * FROM `article` WHERE `id` < 474723 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.001618s ]
  12. SELECT * FROM `article` WHERE `id` > 474723 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.007732s ]
  13. SELECT * FROM `article` WHERE `id` < 474723 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.027751s ]
  14. SELECT * FROM `article` WHERE `id` < 474723 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.103946s ]
  15. SELECT * FROM `article` WHERE `id` < 474723 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.014297s ]
0.400567s