当前位置:首页>Linux>详解linux内核链表list_head及其接口应用

详解linux内核链表list_head及其接口应用

  • 2026-02-02 02:35:00
详解linux内核链表list_head及其接口应用

Linux内核中的链表通常都组织成双向循环链表,不同于一般意义上的链表,这里的链表节点只含有链表指针(next和prev),没有链表的数据。Linux内核中使用的链表源代码位于 include/linux/list.h中,下面详细叙述。

1. 链表数据结构 list_head 的定义:

struct list_head{
    structlist_head *next,*prev;
};

【注意】只有前后节点指针,没有数据 !

2. 链表的声明和初始化

2.1 静态方法——编译时

#define LIST_HEAD_INIT(name) { &(name), &(name) }
#define LIST_HEAD(name) \
struct list_head name = LIST_HEAD_INIT(name)  

2.2 动态方法——运行时

static inline voidINIT_LIST_HEAD(structlist_head*list)
{
    list->next = list;
    list->prev = list;
}

图示:

3. 插入/删除/合并

3.1 插入

3.1.1 头插——list_add

static inline void list_add(struct list_head *newstruct list_head *head)
{
    __list_add(new, head, head->next);
}

3.1.2 尾插—— list_add_tail

static inline void list_add_tail(struct list_head *newstruct list_head *head)
{
    __list_add(new, head->prev, head);
}
  • 可以看到他们调用了相同的 __list_add 函数:
//将链表节点new插在prev和next中间
static inline void __list_add(struct list_head*newstruct list_head *prevstruct list_head *next)
{
    next->prev = new;
    new->next = next;
    new->prev = prev;
    prev->next = new;
}

3.2 删除

  • 对链表的删除操作函数有两种:list_del函数list_del_init函数

3.2.1 list_del

static inline void list_del(struct list_head *entry)// entry:要删除的链表的首地址  
{
    __list_del(entry->prev, entry->next);
    entry->next = LIST_POISON1;
    entry->prev = LIST_POISON2;
}

/* 下面是LIST_POISON1和LIST_POISON2的出处:*/
#ifdef CONFIG_ILLEGAL_POINTER_VALUE
#define POISON_POINTER_DELTA_AC(CONFIG_ILLEGAL_POINTER_VALUE, UL)
#else
#define POISON_POINTER_DELTA0
#endif
/* 
 * 通常情况下,非空指针会导致页错误,用于验证没有初始化的list元素。
 * These are non-NULL pointers that will result in page faults
 * under normal circumstances, used to verify that nobody uses
 * non-initialized list entries.
 */

#define LIST_POISON1((void*)0x100+ POISON_POINTER_DELTA)
#define LIST_POISON2((void*)0x200+ POISON_POINTER_DELTA)
  • 将链表节点entry从链表中删除后,list_del函数中又将entry的next和prev指针指向了LIST_POISON1LIST_POISON2位置,使得以后若再对他们进行访问都将引起页故障,以确保不在链表中的节点项不可访问。

3.2.2 list_del_init

static inline void list_del_init(struct list_head *entry)
{
    __list_del_entry(entry);
    INIT_LIST_HEAD(entry);// 运行中初始化链表节点  
}

static inline void__list_del_entry(struct list_head *entry)
{
    __list_del(entry->prev, entry->next);
}
  • 将链表节点entry从链表中删除后,list_del_init函数中又将entry重新初始化了(next和prev指针指向了自己)。在此不再画图,唯一的不同是把删除下来的图的next和prev指针指向了自己的首地址
  • 他们调用了相同的 __list_del 函数
static inline void __list_del(struct list_head* prevstruct list_head* next)
{
    next->prev = prev;
    prev->next = next;
}

3.3 替换

对链表的替换操作有两个:list_replace函数list_replace_init函数

3.3.1 list_replace

static inline void list_replace(struct list_head *oldstruct list_head *new)
{
    new->next = old->next;
    new->next->prev = new;
    new->prev = old->prev;
    new->prev->next = new;
}

3.3.2 list_replace_init

static inline void list_replace_init(struct list_head *oldstruct list_head *new)
{
    list_replace(old, new);
    INIT_LIST_HEAD(old);
}

list_replace_init函数的图形在此处也不再画,区别就是多了初始化换下来的old节点

3.4 搬移

搬移的含义是将原本属于一个链表的节点移动到另一个链表的操作,有两个函数:list_move函数list_move_tail函数

3.4.1 list_move

/*
 * list_move:把节点list从原先链表上搬移到另一个链表head的头部 
 * @list: 我们要移动的节点 
 * @head: 要移动到的另外的一个链表头 
 */

static inline void list_move(struct list_head *liststruct list_head *head)
{
    __list_del_entry(list);
    list_add(list, head);
}

3.4.2 list_move_tail

/*
 * list_move_tail:把节点list从原先链表上搬移到另一个链表head的尾部 
 * @list: the entry to move 
 * @head: the head that will follow our entry 
 */

static inline void list_move_tail(struct list_head *liststruct list_head *head)
{
    __list_del_entry(list);
    list_add_tail(list, head);
}

3.5 合并

合并在这里的意思就是合并了,是将两个独立的链表合并成为一个链表,合并的时候根据合并的位置的不同可以分为:

  • 合并到头部的 list_splice函数
  • 合并到尾部的 list_splice_tail函数

3.5.1 list_splice

/* 
 * list_splice: join two lists, this is designed for stacks 
 * @list: the new list to add. 
 * @head: the place to add it in the first list. 
 */

static inline void list_splice(const struct list_head *liststruct list_head *head){
    if(!list_empty(list))
        __list_splice(list, head, head->next);
}
  • 假设当前有两个链表,表头分别是list1和list2(都是struct list_head变量),当调用list_splice(&list1,&list2)时,只要list1非空,list1链表的内容将被挂接在list2链表上,位于list2和list2.next(原list2表的第一个节点)之间。新list2链表将以原list1表的第一个节点为首节点,而尾节点不变

3.5.2 list_splice_tail

/* 
 * list_splice_tail - join two lists, each list being a queue 
 * @list: the new list to add. 
 * @head: the place to add it in the first list. 
 */

static inline void list_splice_tail(struct list_head *liststruct list_head *head)
{
    if(!list_empty(list))
        __list_splice(list, head->prev, head);
}
  • 假设当前有两个链表,表头分别是list1和list2(都是struct list_head变量),当调用list_splice_tail(&list1,&list2)时,只要list1非空,list1链表的内容将被挂接在list2链表上,位于list2尾节点和list2(原list2头)之间。新list2链表将以原list1表的最后一个节点为尾节点,而头节点不变

3.5.3 list_splice_init

static inline void list_splice_init(struct list_head *liststruct list_head *head)
{
    if(!list_empty(list)){
        __list_splice(list, head, head->next);
    INIT_LIST_HEAD(list);<--- 跟list_splice唯一的不同  
    }
}

3.5.4 list_splice_tail_init

static inline void list_splice_tail_init(struct list_head *liststruct list_head *head)
{
    if(!list_empty(list)){
        __list_splice(list, head->prev, head);
    INIT_LIST_HEAD(list);<--- 跟list_splice_tail唯一的不同  
    }
}
  • 共同的函数__list_splicelist_empty
//将链表list插入到另一个链表的prev和next节点之间
static inline void __list_splice(const struct list_head *liststruct list_head *prevstruct list_head *next)
{
    structlist_head*first = list->next;
    structlist_head*last = list->prev;

    first->prev = prev;
    prev->next = first;

    last->next = next;
    next->prev = last;
}

//判断链表head是否为空
static inline int list_empty(const struct list_head *head)
{
    return head->next == head;
}

4. 找到链表中的数据

前边提到的函数都是操作的链表节点的入口,但是对于我们真正有意义的是节点上的数据,链表的头上没有数据,其他的节点上都是带有数据的。如何从一个链表节点的入口得到节点的数据呢?要用到以下的函数

list_entry函数

/*
 * list_entry - 通过链表地址获得包含该链表的结构体的地址 
 * @ptr:    member的首地址 
 * @type:   容器的类型 
 * @member: 要得到他的容器的某个成员 
 */

#define list_entry(ptr, type, member)\
                container_of(ptr, type, member)


#define container_of(ptr, type, member)({\
            consttypeof(((type *)0)->member )*__mptr =(ptr); \ 

            (type *)((char*)__mptr -offsetof(type,member));})

// 将数据结构体放到0地址处,天然的结构体中成员的首地址就是成员在结构体中的偏移量(字节)
#define offsetof(TYPE, MEMBER)((size_t)&((TYPE *)0)->MEMBER)

举例

main.c

#include <stdio.h>
#include <linux/list.h>

LIST_HEAD(device_list);

typedef struct device_struct
{
    unsigned chardevname;
    struct list_head entry;
} device_struct_s;

int main(int argcconstchar*argv[])
{
    device_struct_s led;
    device_struct_s *ledp;
    led.devname ="led";

    /* 添加到链表的前边 */
    list_add(&led.entry,&device_list);

    /* 得到含有链表节点的数据结构体的首地址 */
    ledp =list_entry(device_list.next, device_struct_s, entry);
    printf("led.devname = %s\n", ledp->devname);
    return0;
}

5. 遍历链表

对linux内核的遍历可以分为遍历链表和遍历链表中的结构体:

从头开始遍历链表,list_for_each宏;

从头开始遍历链表中的结构体,list_for_each_entry宏;

5.1 遍历list_head链表

/*
 * list_for_each - 迭代/遍历 链表 
 * @cursor: list_head链表指针. 
 * @head:   要遍历的list_head链表的头
 */

#define list_for_each(cursor, head) \ 
        for(cursor =(head)->next; cursor !=(head); cursor = cursor->next)

/*
 *next: 指向当前crusor指向的结构体的下一个结构体
 */

#define list_for_each_safe(cursor, next, head) \ 
         for(cursor =(head)->next,next = cursor->next;\
         cursor !=(head);\
         cursor = next,next = cursor->next)
  • 注意
    :当我们采用list__for_each()函数遍历list时,如果我们删除元素(即执行list_del(cursor);),就会导致cursor指向的元素的prev=LIST_POISON1,next=LIST_POISON2,当执行到cursor=cursor->next时,就会出现错误。
    • 但是当我们使用list_for_each_safe()函数遍历list时,如果我们也删除元素后,会执行cursor=next,而next=cursor->next(注意:next=cursor->next中的cursor是删除的那个元素),所以虽然删除了元素cursor,但是执行了cursor=next后,cursor指向了正确的遍历位置,所以使用list_for_each_safe()函数遍历list时并不会出现错误。
    • list_for_each_safe()
      在遍历时之所以不会出现错误,是因为我们使用了next暂时保存了cursor(被删除元素所指向的下一个元素),所以用这个宏定义,不会出现遍历时删除元素的错误。

5.2 遍历“含有list_head项的结构体‘链表

/*
 * list_for_each_entry  - 遍历含链表节点入口的结构体 
 * @cursor: 指向“含list_head结构的结构体”的指针. 
 * @head:   要遍历的结构体链表的头节点中的list_head项的指针
 * @member: 结构体中list_head项的名字 
 */

#define list_for_each_entry(cursor, head, member)\
    for(cursor =list_entry((head)->next,typeof(*cursor), member);\
    &cursor->member !=(head);\  

    cursor =list_entry(cursor->member.next,typeof(*cursor), member))
/*
 *next: 指向当前crusor指向的结构体的下一个结构体;
 */

#define list_for_each_entry_safe(cursor, next, head, member)\
    for(cursor =list_entry((head)->next,typeof(*cursor), member),\
    next =list_entry(cursor->member.next,typeof(*cursor), member);\
    &cursor->member !=(head);\  

    cursor = next, next =list_entry(next->member.next,typeof(*cursor), member))
  • 相比于list_for_each_entrylist_for_each_entry_safe用指针next对链表的下一个数据结构进行了临时存储,所以同理,如果在遍历链表的时候需要做删除链表中的当前项操作时,用list_for_each_entry_safe可以安全的删除,而不会影响接下来的遍历过程(用next指针可以继续完成接下来的遍历, 而list_for_each_entry则无法继续遍历,删除后会导致无法继续遍历)。

  • 举例

#include <stdio.h>
#include <linux/list.h>

LIST_HEAD(device_list);//定义并初始化了一个list_head类型的变量device_list

typedef struct device_struct
{
    unsigned char *devname;
    struct list_head entry;
} device_struct_s;

int main(int argc,constchar*argv[])
{
    device_struct_s led, gpio, beep,*tmp;

    led.devname ="led";
    gpio.devname ="gpio";
    beep.devname ="beep";

/* 一个一个往链表的头部添加 */
list_add(&led.entry,&device_list);// device_list——>led.entry
list_add(&gpio.entry,&device_list);// device_list——>gpio.entry——>led.entry 
list_add(&beep.entry,&device_list);// device_list——>beep.entry——>gpio.entry——>led.entry 

/* 1. 遍历链表 */
structlist_head*cursor;
list_for_each(cursor,&device_list)
{
    tmp =list_entry(cursor, device_struct_s, entry);
    printf("tmp.devname = %s\n", tmp->devname);
}

/* 2. 遍历含链表的结构体 */
device_struct_s *cursor2;
list_for_each_entry(cursor2,&device_list, entry)
{
    printf("cursor2.devname = %s\n", cursor2->devname);
}
return0;
}
  • 输出结果

    tmp.devname = beep  
    tmp.devname = gpio  
    tmp.devname = led  
    j.devname = beep  
    j.devname = gpio  
    j.devname = led

另外:

  1. linux内核的链表中提供了反向遍历链表的宏list_for_each_prevlist_for_each_entry_reverse,他们分别是list_for_eachlist_for_each_entry的反方向的实现,使用方法完全一样。
  2. 如果遍历不是从链表头开始,而是从已知的某个节点pos开始,则要使用list_for_each_entry_continue宏(使用方法同list_for_each_entry宏)。
  3. 如果想实现如果pos有值则从pos开始遍历,如果没有则从链表的头开始遍历,为此,Linux专门提供了一个list_prepare_entry(pos,head,member)宏,将它的返回值作为list_for_each_entry_continue()的pos参数,就可以满足这一要求。
  • 我们将list_for_each_prev和list_for_each_entry_reverse的代码和执行结果也写下来:
/* 3. 反向遍历链表的入口的首地值 */
printf("list_for_each_prev()\n");
struct list_head *cursor3;
list_for_each_prev(cursor3,&device_list)
{
    tmp =list_entry(cursor3, device_struct_s, entry);
    printf("tmp.devname = %s\n", tmp->devname);
}


/* 4. 反向遍历含链表的入口的结构体的首地值 */
printf("list_for_each_reverse()\n");
device_struct_s *cursor4;
list_for_each_entry_reverse(cursor4,&device_list, entry)
{
    printf("cursor4.devname = %s\n", g->evname);
}

结合上边代码的执行结果如下:

list_for_each_prev()<--- 可以看到遍历结果是从尾部遍历到头部  
tmp.devname = led  
tmp.devname = gpio  
tmp.devname = beep  
list_for_each_reverse()<--- 可以看到遍历结果是从尾部遍历到头部  
cursor4.devname = led  
cursor4.devname = gpio  
cursor4.devname = beep  

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-09 04:08:54 HTTP/2.0 GET : https://f.mffb.com.cn/a/460092.html
  2. 运行时间 : 0.157772s [ 吞吐率:6.34req/s ] 内存消耗:4,458.38kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=fbaec14b5ffdc8e5b9fd4f4b1fd777bc
  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.000400s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000744s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.005593s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000457s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000498s ]
  6. SELECT * FROM `set` [ RunTime:0.003836s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000637s ]
  8. SELECT * FROM `article` WHERE `id` = 460092 LIMIT 1 [ RunTime:0.000688s ]
  9. UPDATE `article` SET `lasttime` = 1770581334 WHERE `id` = 460092 [ RunTime:0.008277s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.000886s ]
  11. SELECT * FROM `article` WHERE `id` < 460092 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000432s ]
  12. SELECT * FROM `article` WHERE `id` > 460092 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.004603s ]
  13. SELECT * FROM `article` WHERE `id` < 460092 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.006766s ]
  14. SELECT * FROM `article` WHERE `id` < 460092 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.017392s ]
  15. SELECT * FROM `article` WHERE `id` < 460092 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.041313s ]
0.159343s