当前位置:首页>Linux>Linux 底层读写函数解析

Linux 底层读写函数解析

  • 2026-01-20 19:16:39
Linux 底层读写函数解析
大家好,我是王鸽,今天总结一下底层驱动这块读写函数代码总结,有个大概的认识,驱动和硬件的交互,最后都要回归到寄存器的读写操作上,所以对驱动的读写函数了解还是很必要的。

那就开始介绍几种读写。

内存映射I/O (MMIO)

Linux 设备驱动中最基础的硬件交互方式,用于直接访问CPU内存空间的寄存器(如片上外设),提供了最高效的硬件控制手段。

// 读操作u8 readb(constvolatilevoid __iomem *addr);  // 8位u16 readw(constvolatilevoid __iomem *addr)// 16位u32 readl(constvolatilevoid __iomem *addr)// 32位// 写操作voidwriteb(u8 valuevolatilevoid __iomem *addr);voidwritew(u16 valuevolatilevoid __iomem *addr);voidwritel(u32 valuevolatilevoid __iomem *addr);

底层实现:

通过ioremap()将物理地址映射到内核虚拟地址。

底层使用汇编指令(如ARM的ldr/str,x86的mov)直接操作内存。

包含内存屏障(如__iormb()/__iowmb())保证访问顺序。

具体的例子

void writeb(u8 value, volatile void __iomem *addr);

功能

向指定内存映射 I/O 地址写入 1 字节(8位) 数据。

参数

参数

类型

说明

value

u8 (unsigned char)

要写入的 8 位数据

addr

volatile void __iomem *

内存映射 I/O 的目标地址

关键特性

volatile:告诉编译器不要优化此操作(硬件寄存器值可能随时改变)

__iomem:表示这是 I/O 内存地址(非普通内存)

原子操作:保证单次写入不可分割

无返回值:只执行写入操作

代码示例

// 启用设备中断 (设置寄存器的第 0 位)void enable_interrupts(struct device *dev){    u8 ctrl_reg;    // 1. 读取当前控制寄存器值    ctrl_reg = readb(dev->regs + CONTROL_REG_OFFSET);    // 2. 设置中断使能位 (BIT0)    ctrl_reg |= 0x01;    // 3. 写回控制寄存器    writeb(ctrl_reg, dev->regs + CONTROL_REG_OFFSET);}// 发送命令到设备void send_device_command(struct device *dev, u8 cmd){    // 直接写入命令寄存器    writeb(cmd, dev->regs + COMMAND_REG_OFFSET);}

而u16 readw(const volatile void __iomem *addr); // 16位使用

// 读取设备状态寄存器u16 get_device_status(struct device *dev){    // 直接读取16位状态寄存器    return readw(dev->regs + STATUS_REG_OFFSET);}// 从数据寄存器读取温度值intread_temperature(struct device *dev){    u16 raw_value;    // 1. 启动温度转换    writeb(START_CONV_CMD, dev->regs + COMMAND_REG);    // 2. 等待转换完成    while (!(readw(dev->regs + STATUS_REG) & CONV_COMPLETE_BIT))        udelay(10);    // 3. 读取16位温度值    raw_value = readw(dev->regs + DATA_REG);    return convert_raw_temp(raw_value);}

另外读取出来的数据需要考虑大小端转化,字节序处理。

u16 val = readw(addr);u16 host_val = le16_to_cpu(val); // 小端设备转主机序

位操作

// 安全修改特定位u8 reg = readb(ctrl_reg);reg |= BIT(3);    // 设置第3位reg &= ~BIT(5);   // 清除第5位writeb(reg, ctrl_reg);

I2C总线读写

通过I2C协议读写从设备寄存器。

函数

// 单次读写inti2c_master_send(struct i2c_client *client, constchar *buf, int count);inti2c_master_recv(struct i2c_client *client, char *buf, int count);// SMBus封装(推荐)s32 i2c_smbus_read_byte_data(struct i2c_client *client, u8 reg);s32 i2c_smbus_write_byte_data(struct i2c_client *client, u8 reg, u8 value);s32 i2c_smbus_read_word_data(struct i2c_client *client, u8 reg);

SMBus 是基于 I2C 的变种协议,常用于主板上的低速设备管理(如温度传感器、电源管理等)。SMBus 是 I2C 的子集,有更严格的时序要求,所有 SMBus 设备兼容 I2C,但反之不一定成立。SMBus 统一不同 I2C 控制器的访问方式。

I2C总线底层的实现

i2c_smbus_read_byte_data(const struct i2c_client *client, u8 command)函数

s32 i2c_smbus_read_byte_data(conststruct i2c_client *client, u8 command){ union i2c_smbus_data data; int status; status = i2c_smbus_xfer(client->adapter, client->addr, client->flags, I2C_SMBUS_READ, command, I2C_SMBUS_BYTE_DATA, &data); return (status < 0) ? status : data.byte;}EXPORT_SYMBOL(i2c_smbus_read_byte_data);

client:指向 I2C 设备的结构体指针,command:要读取的寄存器地址或命令码。

I2C_SMBUS_READ:指定读操作
I2C_SMBUS_BYTE_DATA:指定传输类型
&data:用于存储读取结果

其中i2c_smbus_xfer函数是这样子的:

i2c_smbus_read_byte_data工作流程

使用场景

// 读取温度传感器(地址0x48)的温度寄存器(命令码0x00)struct i2c_client *client = ...u8 temp_reg = 0x00;int temperature = i2c_smbus_read_byte_data(client, temp_reg);if (temperature < 0) {    dev_err(&client->dev, "读取失败: %d\n", temperature);else {    dev_info(&client->dev, "当前温度: %d°C\n", temperature);}

s32 i2c_smbus_write_byte_data函数

s32 i2c_smbus_write_byte_data(const struct i2c_client *client, u8 command,      u8 value){ union i2c_smbus_data data; data.byte = value; return i2c_smbus_xfer(client->adapter, client->addr, client->flags,      I2C_SMBUS_WRITE, command,      I2C_SMBUS_BYTE_DATA, &data);}EXPORT_SYMBOL(i2c_smbus_write_byte_data);

I2C_SMBUS_BYTE_DATA这个是参数类型

传输类型对照

函数类型
协议
I2C_SMBUS_BYTE_DATA
Write Byte + Read Byte
I2C_SMBUS_WORD_DATA
Write Byte + Read Word
I2C_SMBUS_BLOCK_DATA
Write Byte + Read Block

错误码示例

-EIO:总线通信错误

-ENODEV:设备无响应

-EAGAIN:临时错误(可重试)

status = i2c_smbus_xfer(client->adapter, client->addr, client->flags,                              I2C_SMBUS_READ, command,                                I2C_SMBUS_WORD_DATA, &data);

SPI总线读写

通过SPI协议读写从设备寄存器。

// 单次传输intspi_write(struct spi_device *spi, constvoid *buf, size_t len);intspi_read(struct spi_device *spi, void *buf, size_t len);// 先写后读(常用)intspi_write_then_read(struct spi_device *spi, constvoid *txbuf, size_t n_tx, void *rxbuf, size_t n_rx);

SPI总线读写底层实现

介绍一下SPI的传输结构体

spi_write函数是 Linux 内核中用于同步 SPI 数据写入的标准实现。它是一个简化封装函数,用于通过 SPI 总线发送数据。spi_write向指定的 SPI 设备同步写入数据(阻塞式操作,直到传输完成)

staticinlineintspi_write(struct spi_device *spi, constvoid *buf, size_t len){ struct spi_transfer t = {  //描述单个 SPI 传输操作的结构体 .tx_buf = buf, // 发送数据缓冲区 .len = len, // 发送数据长度 }; struct spi_message m; spi_message_init(&m); // 初始化 SPI 消息 spi_message_add_tail(&t, &m); // 将传输加入消息队列 return spi_sync(spi, &m); //阻塞式函数,会等待整个传输完成 0 表示成功,负数表示错误码       //实际驱动中应检查 spi_sync() 的错误码,根据错误码判断问题。}

具体的工作流程

同样的spi_read代码

staticinlineintspi_read(struct spi_device *spi, void *buf, size_t len){ struct spi_transfer t = { .rx_buf = buf, .len = len, }; struct spi_message m; spi_message_init(&m); spi_message_add_tail(&t, &m); return spi_sync(spi, &m);}

// 先写后读(常用)

int spi_write_then_read(struct spi_device *spi, const void *txbuf, size_t n_tx, void *rxbuf, size_t n_rx);

staticinlineintspi_write_and_read(struct spi_device *spi, constvoid *tx_buf, void *rx_buf, size_t len){        struct spi_transfer     t = {                        .tx_buf         = tx_buf,                        .rx_buf         = rx_buf,                        .len            = len,                };        struct spi_message      m;        spi_message_init(&m);        spi_message_add_tail(&t, &m);        return spi_sync(spi, &m);}

通用的读写API

简化寄存器访问的统一框架,支持I2C/SPI/MMIO等总线。管它什么外设,直接就一套API。

// 初始化Regmapstruct regmap_config config = {.reg_bits = 8// 寄存器地址位数.val_bits = 16// 寄存器值位数};
struct regmap *regmap = devm_regmap_init_i2c(client, &config); // I2C设备// 读写寄存器intregmap_write(struct regmap *map, unsignedint reg, unsignedint val);intregmap_read(struct regmap *map, unsignedint reg, unsignedint *val);

regmap_write函数原型

/** * regmap_write(): Write a value to a single register * * @map: Register map to write to * @reg: Register to write to * @val: Value to be written * * A value of zero will be returned on success, a negative errno will * be returned in error cases. */int regmap_write(struct regmap *map, unsigned int reg, unsigned int val){ int ret; if (reg % map->reg_stride) return -EINVAL; map->lock(map->lock_arg); ret = _regmap_write(map, reg, val); map->unlock(map->lock_arg); return ret;}EXPORT_SYMBOL_GPL(regmap_write);

regmap_write的底层调用流程

regmap_read函数原型

/** * regmap_read(): Read a value from a single register * * @map: Register map to write to * @reg: Register to be read from * @val: Pointer to store read value * * A value of zero will be returned on success, a negative errno will * be returned in error cases. */int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val){ int ret; if (reg % map->reg_stride) return -EINVAL; map->lock(map->lock_arg); ret = _regmap_read(map, reg, val); map->unlock(map->lock_arg); return ret;}EXPORT_SYMBOL_GPL(regmap_read);

优势:

自动处理总线细节(如I2C的Repeated Start)。

提供缓存、批量读写等高级功能。

底层共通机制

互斥锁:所有传输函数内部使用锁保证线程安全。
延时处理:SPI/I2C函数可能休眠,不可用于原子上下文。

错误处理:返回负数错误码(如-EIO表示传输失败);

DMA支持:大块数据可能通过DMA传输(如SPI的dma_map_single()

总结

访问类型
核心函数
适用场景
MMIO
readl()/writel()
内存映射寄存器
I2C
i2c_smbus_read_byte_data()
I2C传感器、编解码器
SPI
spi_write_then_read()
SPI Flash、ADC/DAC
Regmap
regmap_read()/regmap_write()
跨总线统一访问

实际开发中:

优先使用Regmap:简化代码,支持多种总线。
注意上下文:SPI/I2C函数可能休眠,中断上下文需使用spi_async()等异步接口。
检查返回值:所有函数返回非零需处理错误。
就到这里,谢谢点赞关注。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-08 11:05:12 HTTP/2.0 GET : https://f.mffb.com.cn/a/465603.html
  2. 运行时间 : 0.222899s [ 吞吐率:4.49req/s ] 内存消耗:4,508.79kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=0129f9560980d11c803bc3b0401052b4
  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.000907s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001413s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.006571s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.002988s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001494s ]
  6. SELECT * FROM `set` [ RunTime:0.000992s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001527s ]
  8. SELECT * FROM `article` WHERE `id` = 465603 LIMIT 1 [ RunTime:0.009085s ]
  9. UPDATE `article` SET `lasttime` = 1770519912 WHERE `id` = 465603 [ RunTime:0.011610s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.001496s ]
  11. SELECT * FROM `article` WHERE `id` < 465603 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.016394s ]
  12. SELECT * FROM `article` WHERE `id` > 465603 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.012531s ]
  13. SELECT * FROM `article` WHERE `id` < 465603 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.018451s ]
  14. SELECT * FROM `article` WHERE `id` < 465603 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.030105s ]
  15. SELECT * FROM `article` WHERE `id` < 465603 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.023641s ]
0.224452s