当前位置:首页>Linux>Linux 内核数据结构:位图(Bitmap)

Linux 内核数据结构:位图(Bitmap)

  • 2026-03-18 15:19:19
Linux 内核数据结构:位图(Bitmap)

(点击上方公众号,可快速关注)

编译:伯乐在线 - 乔永琪 

点击 → 了解如何加入专栏作者

如需转载,发送「转载」二字查看说明

本系列:

位图和位运算

除了各种链式和树形数据结构,Linux内核还提供了位图接口。位图在Linux内核中大量使用。下面的源代码文件包含这些结构的通用接口:

  • lib/bitmap.c

  • include/linux/bitmap.h

除了这两个文件,还有一个特定的架构头文件,对特定架构的位运算进行优化。对于x86_64架构,使用下面头文件:

  • arch/x86/include/asm/bitops.h

正如我前面提到的,位图在Linux内核中大量使用。比如,位图可以用来存储系统在线/离线处理器,来支持CPU热插拔;再比如,位图在Linux内核等初始化过程中存储已分配的中断请求。

因此,本文重点分析位图在Linux内核中的具体实现。

位图声明

位图接口使用前,应当知晓Linux内核是如何声明位图的。一种简单的位图声明方式,即unsigned long数组。比如:

unsigned long my_bitmap[8]

第二种方式,采用DECLARE_BITMAP宏,此宏位于头文件include/linux/types.h中:

#define DECLARE_BITMAP(name,bits)

unsignedlongname[BITS_TO_LONGS(bits)]

DECLARE_BITMAP宏有两个参数:

  • name – 位图名字;

  • bits – 位图中比特总数目

并且扩展元素大小为BITS_TO_LONGS(bits)、类型unsigned long的数组,而BITS_TO_LONGS宏将位转换为long类型,或者说计算出bits中包含多少byte元素:

#define BITS_PER_BYTE           8

#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))

#define BITS_TO_LONGS(nr)       DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))

例如:DECLARE_BITMAP(my_bitmap, 64)结果为:

>>> (((64) + (64) - 1) / (64))

1

和:

unsigned long my_bitmap[1];

位图声明后,我们就可以使用它了。

特定架构的位运算

我们已经查看了操作位图接口的两个源码文件和一个头文件。位图最重要最广泛的应用接口是特定架构,它位于头文件arch/x86/include/asm/bitops.h中

首先,我们来看两个重要的函数:

  • set_bit;

  • clear_bit.

我认为没有必要介绍这些函数是做什么的,通过函数名就可以知晓。我们来看函数的实现。进入头文件arch/x86/include/asm/bitops.h,你会注意到每个函数分两种类型:原子类型和非原子类型。在深入这些函数实现前,我们需要先了解一些原子性运算。

一言以蔽之,原子性操作保障,位于同一数据上的两个甚至多个运算,不能并发执行。x86架构提供一组原子性指令,如指令xchg、指令cmpxchg。除了原子性指令,一些非原子性指令可借助指令lock进行原子性运算。目前我们了解这些原子性运算就足够了,接下来可以开始考虑set_bit和clear_bit函数。

先从非原子性类型的函数开始,非原子性set_bit和clear_bit函数名始于双下划线。正如你所了解的,所有的函数定义在头文件arch/x86/include/asm/bitops.h中,第一个函数__set_bit:

staticinlinevoid__set_bit(longnr,volatileunsignedlong *addr)

{

asmvolatile("bts %1,%0" : ADDR : "Ir"(nr) : "memory");

}

它拥有两个参数:

  • nr –  位图中比特数目

  • addr –  位图中某个比特需要设值的地址

注意参数addr定义为volatile,告诉编译器此值或许被某个地址改变。而__set_bit容易实现。正如你所见,恰好它包含一行内联汇编代码。本例中,使用指令bts选择位图中的某个比特值作为首个操作数,将已选择比特值存入寄存器CF标签中,并设置此比特。

此处可以看到nr的用法,那addr呢?或许你已猜到其中的奥秘就在ADDR中。而ADDR是定义在头文件中的宏,扩展字符串,在该地址前面加入+m约束:

#define ADDR                BITOP_ADDR(addr)

#define BITOP_ADDR(x) "+m" (*(volatile long *) (x))

除了+m,我们可以看到__set_bit函数中其它约束。让我们查看这些约束,试着理解其中的含义:

  • +m – 表示内存操作数,+表示此操作数为输入和输出操作数;

  • I – 表示整数常数;

  • r -表示寄存器操作数

除了这些约束,还看到关键字memory,它会告知编译器此代码会更改内存中的值。接下来,我们来看同样功能,原子类型函数。它看起来要比非原子类型函数复杂得多:

static__always_inline void

set_bit(longnr,volatileunsignedlong *addr)

{

if(IS_IMMEDIATE(nr)){

asmvolatile(LOCK_PREFIX"orb %1,%0"

            : CONST_MASK_ADDR(nr,addr)

            : "iq"((u8)CONST_MASK(nr))

            : "memory");

}else{

asmvolatile(LOCK_PREFIX"bts %1,%0"

            : BITOP_ADDR(addr) : "Ir"(nr) : "memory");

}

}

注意它与函数__set_bit含有相同的参数列表,不同的是函数被标记有属性__always_inline。__always_inline是定义在include/linux/compiler-gcc.h中的宏,只是扩展了always_inline属性:

#define __always_inline inline __attribute__((always_inline))

这意味着函数会被内联以减少Linux内核镜像的大小。接着,我们试着去理解函数set_bit实现。函数set_bit伊始,便对比特数目进行检查。IS_IMMEDIATE是定义在相同头文件中的宏,用于扩展内置函数gcc:

#define IS_IMMEDIATE(nr)        (__builtin_constant_p(nr))

内置函数__builtin_constant_p返回1的条件是此参数在编译期为常数;否则返回0。无需使用指令bts设置比特值,因为编译期比特数目为一常量。仅对已知字节地址进行按位或运算,并对比特数目bits进行掩码,使其高位为1,其它为0. 而比特数目在编译期若非常量,函数__set_bit中运算亦相同。宏CONST_MASK_ADDR:

#define CONST_MASK_ADDR(nr, addr)   BITOP_ADDR((void *)(addr) + ((nr)>>3))

采用偏移量扩展某个地址为包含已知比特的字节。比如地址0x1000,以及比特数目0x9。0x9等于一个字节,加一个比特,地址为addr+1:

>>> hex(0x1000 + (0x9 >> 3))

'0x1001'

宏CONST_MASK表示看做字节的某已知比特数目,高位为1,其它比特为0:

#define CONST_MASK(nr)          (1 << ((nr) & 7))

>>> bin(1 << (0x9 & 7))

'0b10

最后,我们使用按位或运算。假设address为0x4097,需要设置ox9比特:

>>> bin(0x4097)

'0b100000010010111'

>>> bin((0x4097 >> 0x9) | (1 << (0x9 & 7)))

'0b100010'

第九个比特将被设置

注意所有的操作均标记有LOCK_PREFIX,即扩展为指令lock,确保运算以原子方式执行。

如我们所知,除了set_bit和__set_bit运算,Linux内核还提供了两个逆向函数以原子或非原子方式清理比特,clear_bit和__clear_bit。这个两个函数均定义在相同的头文件中,并拥有相同的参数列表。当然不仅是参数相似,函数本身和set_bit以及 __set_bit都很相似。我们先来看非原子性函数__clear_bit

staticinlinevoid__clear_bit(longnr,volatileunsignedlong *addr)

{

asmvolatile("btr %1,%0" : ADDR : "Ir"(nr));

}

正如我们所看到的,它们拥有相同参数列表,以及相似的内联汇编函数块。不同的是__clear_bit采用指令btr代替指令bts。从函数名我们可以看出,函数用来清除某个地址的某个比特值。指令btr与指令bts类似,选择某个比特值作为首个操作数,将其值存入寄存器CF标签中,并清除位图中的这个比特值,且将位图作为指令的第二个操作数。

__clear_bit的原子类型为clear_bit:

static__always_inline void

clear_bit(longnr,volatileunsignedlong *addr)

{

if(IS_IMMEDIATE(nr)){

asmvolatile(LOCK_PREFIX"andb %1,%0"

            : CONST_MASK_ADDR(nr,addr)

            : "iq"((u8)~CONST_MASK(nr)));

}else{

asmvolatile(LOCK_PREFIX"btr %1,%0"

            : BITOP_ADDR(addr)

            : "Ir"(nr));

}

}

正如我们所看到的,它和set_bit相似,仅有两处不同。第一个不同,使用指令btr进行比特清理,而set_bit使用指令bts比特存储。第二个不同,使用消除掩码以及指令and清理某个byte中的bit值,而set_bit使用指令or。

到目前为止,我们可以给任何位图设值、清除或位掩码运算。

位图最常用的运算为Linux内核中位图的设值以及比特值的清除。除了这些运算外,为位图添加额外的运算也是有必要的。Linux内核中,另一个广泛的运算是判定位图是否已设置比特值。可借助test_bit宏进行判定,此宏定义在头文件arch/x86/include/asm/bitops.h中,并依据比特数目,选择调用constant_test_bit 或 variable_test_bit:

#define test_bit(nr, addr)          

(__builtin_constant_p((nr))

?constant_test_bit((nr),(addr))

     : variable_test_bit((nr),(addr)))

若nr在编译期为常数,调用test_bit中函数constant_test_bit,否则调用函数variable_test_bit。我们来看这些函数实现,先从函数variable_test_bit开始:

staticinlineintvariable_test_bit(longnr,volatileconstunsignedlong *addr)

{

intoldbit;

asmvolatile("bt %2,%1nt"

"sbb %0,%0"

             : "=r"(oldbit)

             : "m"(*(unsignedlong *)addr),"Ir"(nr));

returnoldbit;

}

函数variable_test_bit拥有set_bit等函数相似的参数列表。同样,我们看到内联汇编代码,执行指令bt、sbb。指令bt或bit test,从位图中选择某个比特值作为首个操作数,而位图作为第二个操作数,并将选定的比特值存入寄存器CF标签中。而指令sbb则会将首个操作数从第二个操作数中移除,并移除CF标签值。将位图某个比特值写入CF标签寄存器,执行指令sbb,计算CF为00000000 ,最后将结果写入oldbit。

函数constant_test_bit与set_bit相似:

static__always_inline intconstant_test_bit(longnr,constvolatileunsignedlong *addr)

{

return((1UL << (nr & (BITS_PER_LONG-1))) &

(addr[nr >> _BITOPS_LONG_SHIFT])) != 0;

}

它能够产生一个字节,其高位时1,其它比特为0,对这个包含比特数目的字节做按位与运算。

接下来比较广泛的位图运算是,位图中的比特值的改变运算。为此,Linux内核提供两个帮助函数:

  • __change_bit;

  • change_bit.

或许你已能猜到,与set_bit和 __set_bit相似,存在两个类型,原子类型和非原子类型。我们先来看函数__change_bit的实现:

staticinlinevoid__change_bit(longnr,volatileunsignedlong *addr)

{

asmvolatile("btc %1,%0" : ADDR : "Ir"(nr));

}

很容易,难道不是吗?__change_bit与__set_bit拥有相似的实现,不同的是,前者采用的指令btc而非bts。指令选择位图中的某个比特值,然后将此值放入CF中,然后使用补位运算改变其值。若比特值为1则改变后的值为0,反之亦然:

>>> int(not1)

0

>>> int(not0)

1

函数__change_bit的原子版本为函数change_bit:

staticinlinevoidchange_bit(longnr,volatileunsignedlong *addr)

{

if(IS_IMMEDIATE(nr)){

asmvolatile(LOCK_PREFIX"xorb %1,%0"

            : CONST_MASK_ADDR(nr,addr)

            : "iq"((u8)CONST_MASK(nr)));

}else{

asmvolatile(LOCK_PREFIX"btc %1,%0"

            : BITOP_ADDR(addr)

            : "Ir"(nr));

}

}

与函数set_bit相似,但有两处不同。第一处不同的是xor运算而非or;第二处不同的是btc而非bts。

至此,我们了解了最重要的位图架构相关运算,接下来我们来查看通用位图接口。

通用比特运算

除了来自头文件arch/x86/include/asm/bitops.h的特定架构接口,Linux内核还提供了位图的通用接口。从前文就已了解,头文件include/linux/bitmap.h,以及* lib/bitmap.c源码文件。不过在查看源码文件之前,我们先来看头文件include/linux/bitops.h,它提供了一组有用的宏。我们来看其中的一些:

先看下面四个宏:

  • for_each_set_bit

  • for_each_set_bit_from

  • for_each_clear_bit

  • for_each_clear_bit_from

这些宏提供了位图迭代器,首个宏迭代集合set,第二个宏也是,不过从集合指定的比特处开始。后面两个宏也是如此,不同的是迭代清空的比特。我们先来看宏for_each_set_bit的实现:

#define for_each_set_bit(bit, addr, size)

for((bit) = find_first_bit((addr),(size));

(bit) < (size);

(bit) = find_next_bit((addr),(size),(bit) + 1))

正如大家所看到的,此宏拥有三个参数,以及循环从set集合第一个比特开始,到最后一个比特结束,迭代比特数目小于最后一个size,循环最后返回函数find_first_bit。

除了这四个宏,arch/x86/include/asm/bitops.h还提供了64位或32位等值的迭代。

同样,头文件也提供了位图的其它接口。比如下面的这两个函数:

  • bitmap_zero;

  • bitmap_fill.

清除位图,并为其填值1 。我们来看函数bitmap_zero实现:

staticinlinevoidbitmap_zero(unsignedlong *dst,unsignedintnbits)

{

if(small_const_nbits(nbits))

        *dst = 0UL;

else{

unsignedintlen = BITS_TO_LONGS(nbits) * sizeof(unsignedlong);

memset(dst,0,len);

}

}

同样,先检查nbits,函数small_const_nbits定义在相同头文件中的宏,具体如下:

#define small_const_nbits(nbits)

(__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG)

正如大家所见,检查nbits在编译期是否为一常量,nbits值是否超过BITS_PER_LONG或64 。倘若bits的数目没有超出long类型的总量,将其设置为0 。否则,需计算多少个long类型值填入位图中,当然我们借助memset填入。

函数bitmap_fill的实现与bitmap_zero相似,不同的是位图的填值为0xff或0b11111111:

staticinlinevoidbitmap_fill(unsignedlong *dst,unsignedintnbits)

{

unsignedintnlongs = BITS_TO_LONGS(nbits);

if(!small_const_nbits(nbits)){

unsignedintlen = (nlongs - 1) * sizeof(unsignedlong);

memset(dst,0xff,len);

}

dst[nlongs - 1] = BITMAP_LAST_WORD_MASK(nbits);

}

除了函数bitmap_fill和bitmap_zero,头文件include/linux/bitmap.h还提供了函数bitmap_copy,它与bitmap_zero相似,不一样的是使用memcpy而非memset。与此同时,也提供了诸如bitmap_and、bitmap_or, bitamp_xor等函数进行按位运算。考虑到这些函数实现容易理解,在此我们就不做说明;对这些函数感兴趣的读者朋友们,请打开头文件include/linux/bitmap.h进行研究。

觉得本文对你有帮助?请分享给更多人

关注「Linux 爱好者」

看更多 Linux 技术文章

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-03-27 23:15:00 HTTP/2.0 GET : https://f.mffb.com.cn/a/478122.html
  2. 运行时间 : 0.135261s [ 吞吐率:7.39req/s ] 内存消耗:4,646.20kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=16ceba4301eec474c5f6f01ba34691f0
  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.001136s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001863s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000754s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000692s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001630s ]
  6. SELECT * FROM `set` [ RunTime:0.000606s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001734s ]
  8. SELECT * FROM `article` WHERE `id` = 478122 LIMIT 1 [ RunTime:0.001231s ]
  9. UPDATE `article` SET `lasttime` = 1774624500 WHERE `id` = 478122 [ RunTime:0.005731s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.000653s ]
  11. SELECT * FROM `article` WHERE `id` < 478122 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.001143s ]
  12. SELECT * FROM `article` WHERE `id` > 478122 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.001199s ]
  13. SELECT * FROM `article` WHERE `id` < 478122 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.021318s ]
  14. SELECT * FROM `article` WHERE `id` < 478122 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.007313s ]
  15. SELECT * FROM `article` WHERE `id` < 478122 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.001927s ]
0.136896s