当前位置:首页>Linux>Linux(28)-sysfs层次分析

Linux(28)-sysfs层次分析

  • 2026-08-20 22:09:14
Linux(28)-sysfs层次分析

Linux(28)-sysfs层次分析

宏观分析

sysfs 是一个纯粹基于 RAM 的内存文件系统。它将内核内存中抽象的设备模型数据结构,以直观的树状目录形式呈现给用户态。 根目录 /sys 下的各个子目录,分别映射了内核设备模型中的不同维度:

/sys/
├── devices/       # 核心:物理设备的真实级联拓扑树
├── bus/           # 维度一:按总线类型分类(pci, usb, i2c, platform...)
├── class/         # 维度二:按设备功能分类(net, block, sound, input...)
├── dev/           # 维度三:按设备号快速索引(char/, block/)
├── module/        # 视图四:内核已加载模块的状态与导出参数
└── firmware/      # 视图五:系统固件与设备树镜像 (devicetree/base/)
  • devices:它完全按照硬件真实的物理连接级联关系(如:CPU/根复合体 ➔ PCI 桥 ➔ 控制器 ➔ 设备)构建。sysfs 中其他目录下的硬件节点,绝大多数只是指向该目录具体节点的符号链接.

  • bus/(总线视角):按照总线协议划分子目录(如 pci、usb、i2c、platform)。每个总线目录下固定包含两个子目录

    • devices/:挂载在该总线上的所有设备(软链接至 /sys/devices/)
    • drivers/:在当前总线上注册的所有驱动程序。
  • class/(功能类视角):纯粹按设备的功能进行分类,如 net 网卡、sound 声卡、input 输入设备、block 块设备等

  • dev/(设备号快捷索引):包含 block/ 与 char/ 两个子目录,内部以 主设备号:次设备号(例如 8:0)命名的软链接快捷定位设备

  • module/(内核模块视图):展示系统中已加载的每一个内核模块(.ko)及其导出的参数(/sys/module/<mod_name>/parameters/)与运行状态。

  • firmware/(固件与引导视图):展示系统固件暴露的信息。其中最关键的节点是 /sys/firmware/devicetree/base/,它是 Bootloader 在启动阶段传入内核的设备树(Device Tree)二进制镜像在 sysfs 中的完全解包映射。

宏观例子

1.设备树(DTS)定义

以一个常见的 I2C 总线温度传感器(如 TMP102 / MPU6050 类型) 为例,拆解设备树节点从系统启动到最终被应用层使用的全过程。

&i2c1 {
    status = "okay";
    clock-frequency = <100000>;

/* 定义 I2C1 总线下的子设备:温度传感器 */
    my_sensor: tmp102@48 {
        compatible = "ti,tmp102";      /* 核心:与内核驱动进行匹配的标识 */
        reg = <0x48>;                 /* I2C 从机设备地址 */
        interrupt-parent = <&gpio1>;  /* 中断控制器 */
        interrupts = <20 IRQ_TYPE_EDGE_FALLING>; /* 中断引脚 GPIO1_20 */
    };
};

2.内核启动与驱动加载过程

当内核启动并加载了对应的驱动程序(tmp102.ko)后,系统会自动在 sysfs 和 /dev 中进行多维度的映射建立

/sys/devices/:内核根据硬件真实的连接关系建立目录,这是传感器在系统中的唯一真实节点:

/sys/devices/platform/soc/30a20000.i2c/i2c-0/0-0048/
  • 含义:SOC  平台 I2C 控制器(地址 0x30a20000)  I2C 总线 0  地址为 0x48 的从设备。

/sys/bus/:传感器连接在 I2C 总线上,内核在 i2c 总线目录下生成软链接:

/sys/bus/i2c/devices/0-0048 -> ../../../devices/platform/soc/30a20000.i2c/i2c-0/0-0048
/sys/bus/i2c/drivers/tmp102/
  • 含义:devices/ 下通过软链接映射该物理设备,drivers/tmp102/ 目录下展示匹配成功的驱动信息。

3.功能分类层:/sys/class/

驱动在 probe() 函数中将其注册为“硬件监控类(hwmon)”或“工业 IO 类(iio)”,屏蔽总线细节:

/sys/class/hwmon/hwmon0 -> ../../devices/platform/soc/30a20000.i2c/i2c-0/0-0048/hwmon/hwmon0
  • 含义:无论设备挂载在 I2C、SPI 还是 PCIe 上,应用层只需去 /sys/class/hwmon/寻找温度传感器。

4.设备号索引层:/sys/dev/

驱动程序为传感器申请了字符设备号(假设主设备号 241,次设备号 0):

/sys/dev/char/241:0 -> ../../devices/platform/soc/30a20000.i2c/i2c-0/0-0048/hwmon/hwmon0
  • 含义:通过设备号快速查找和定位设备对应的物理节点。

5.模块视图层:/sys/module/加载了驱动模块 tmp102.ko 后:

/sys/module/tmp102/
├── parameters/       # 模块导出参数
├── refcnt           # 引用计数
└── drivers/         # 绑定的驱动列表

6.应用层调用

设备加载完成后,应用层根据业务场景,通过 sysfs 或 字符设备节点 /dev 两种主要方式读写数据。

  • 方式 1:通过 sysfs 属性读取(低频控制 / 查看状态)
    • 传感器驱动在 /sys/class/hwmon/hwmon0/ 目录下创建了 temp1_input 文件(对应 struct attribute 的 show() 回调): Shell 命令行直接读取
$ cat /sys/class/hwmon/hwmon0/temp1_input
25000  # 代表 25.000 ℃(千分之一摄氏度单位)
#include <stdio.h>

int main() {
    FILE *fp = fopen("/sys/class/hwmon/hwmon0/temp1_input""r");
if (!fp) return -1;

    int raw_temp = 0;
    fscanf(fp, "%d", &raw_temp);
    fclose(fp);

printf("当前温度为: %.2f ℃\n", raw_temp / 1000.0);
return 0;
}
  • 方式 2:通过 /dev/ 设备节点读写(大流量数据 / 连续采样)如果驱动向系统注册了 /dev/temp_sensor0 字符设备节点:
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>

int main() {
    // 1. 打开驱动生成的设备节点
    int fd = open("/dev/temp_sensor0", O_RDONLY);
if (fd < 0) return -1;

    // 2. 直接从设备读取原始数据流
    short raw_data = 0;
read(fd, &raw_data, sizeof(raw_data));

    close(fd);
printf("读取到的原始温度寄存器数值: 0x%04X\n", raw_data);
return 0;
}

微观分析

sysfs 严谨的树状目录,在内核 C 语言底层完全由统一设备模型的三大结构体(kobject、kset、attribute)驱动和支撑。

  • kobject:目录的物理实体
    struct kobject 是 Linux 内核设备模型的基石,每个实例在 sysfs 中具象为一个目录。它通过 parent 指针构建树状层级,支撑设备拓扑;内置 struct kref 实现原子级引用计数,保障对象安全释放;其 name 字段直接决定该目录在 sysfs 中的路径名。

  • kset:目录容器与热插拔事件源
    struct kset 作为逻辑容器,聚合同类 kobject(如所有 PCI 设备或所有 USB 类设备),在 sysfs 中表现为分类目录(如 /sys/bus/pci 或 /sys/class/net)。它不仅提供统一的注册/注销入口,更关键的是:当成员 kobject 动态增删时,kset 触发 uevent,向用户态广播事件,驱动 udev 自动同步 /dev/ 下的设备节点。

  • attribute:目录中的文件与读写接口
    struct attribute 映射为 sysfs 目录下的单值文本文件(如 /sys/class/leds/xxx/brightness),严格遵循 One Value Per File 原则。其行为由 struct sysfs_ops 的两个回调定义:show() 将内核数据序列化为字符串供 cat 读取;store() 解析用户写入的字符串,完成参数更新或硬件控制,实现用户态与内核态的轻量交互。

微观例子

kobject 实现sysfs 的目录创建

如上图在sys 下是没办法手动创建任何文件夹因为没有权限,下面使用代码中的kobject 实现sys 下的目录创建。

#include <linux/init.h>
#include <linux/kobject.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/sysfs.h>

static struct kobject *demo_kobj;
static int demo_value;

/* 读取 /sys/study_demo/value 时会进这个回调 */
static ssize_t value_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
{
return scnprintf(buf, PAGE_SIZE, "%d\n", demo_value);
}

/* 向 /sys/study_demo/value echo 123 > /sys/study_demo/value 写入数据时会进这个回调 */
static ssize_t value_store(struct kobject *kobj, struct kobj_attribute *attr,
      const char *buf, size_t count)
{
 int ret;

 ret = kstrtoint(buf, 10, &demo_value);
if (ret)
return ret;

return count;
}

/* 创建一个可读写的 sysfs 属性节点 */
static struct kobj_attribute value_attr = __ATTR(value, 0664, value_show, value_store);

static int __init kobject_demo_init(void)
{
 int ret;

 /* 在 /sys 下创建 study_demo 目录 */
 demo_kobj = kobject_create_and_add("study_demo", NULL);
if (!demo_kobj)
return -ENOMEM;

 /* 在目录里创建 value 属性文件 */
 ret = sysfs_create_file(demo_kobj, &value_attr.attr);
if (ret) {
  kobject_put(demo_kobj);
return ret;
 }

 pr_info("kobject_demo loaded: /sys/study_demo/value\n");
return 0;
}

static void __exit kobject_demo_exit(void)
{
 /* 卸载模块前清理 sysfs 节点和 kobject */
if (demo_kobj) {
  sysfs_remove_file(demo_kobj, &value_attr.attr);
  kobject_put(demo_kobj);
 }

 pr_info("kobject_demo unloaded\n");
}

module_init(kobject_demo_init);
module_exit(kobject_demo_exit);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Xiaoqian");
MODULE_DESCRIPTION("kobject demo for RK3568");

kset 实现目录容器

前面的 kobject 不也是可以实现多层目录结构么,kset 有什么特殊之处?

以内核设备模型中的 “网卡驱动(Network Devices)” 为例,对比单纯使用 kobject 和结合使用 kset 的区别:

如果只是使用kobject 构建目录结构

如果你想在 sysfs 中管理两张网卡 eth0 和 eth1,仅使用 kobject 时:

// 1. 手动创建一个父级目录 kobject
struct kobject *net_parent = kobject_create_and_add("net", NULL);

// 2. 创建 eth0,显式将 parent 指向 net_parent
struct kobject *eth0_obj = kobject_create_and_add("eth0", net_parent);

// 3. 创建 eth1,再次显式指定 net_parent
struct kobject *eth1_obj = kobject_create_and_add("eth1", net_parent);

目录结构结果:

/sys/net/
├── eth0
└── eth1

这种方式只是创建了一个节点,但是节点之间有什么关系并没有体现就会出现下面的问题

  • 无法遍历:内核本身不知道 net_parent 下面到底有哪些子网卡,除非你在驱动里自己写套 eth0_node、eth1_node 链表来存储。
  • 事件孤立:当 eth0 网线插入时,eth0_obj 无法直接通过父节点向用户态(如 NetworkManager)广播网卡状态改变的 uevent 消息。

如果用如果使用 kset 管理网卡集合:

// 1. 创建网卡子系统的 kset 容器
struct kset *net_kset = kset_create_and_add("net", NULL, NULL);

// 2. 创建 eth0 并关联到 net_kset
struct kobject *eth0_obj = kzalloc(sizeof(*eth0_obj), GFP_KERNEL);
eth0_obj->kset = net_kset; // 建立归属关系
kobject_init_and_add(eth0_obj, &net_ktype, NULL, "eth0"); // parent 传 NULL 即可

// 3. 创建 eth1 并关联到 net_kset
struct kobject *eth1_obj = kzalloc(sizeof(*eth1_obj), GFP_KERNEL);
eth1_obj->kset = net_kset;
kobject_init_and_add(eth1_obj, &net_ktype, NULL, "eth1");

目录结构结果:完全相同(/sys/net/eth0 和 /sys/net/eth1)不同的是:

  • 内核内部自动将 eth0_obj 和 eth1_obj 挂载到 net_kset->list 链表上。当系统需要遍历所有网卡时,直接执行:
struct kobject *k;
list_for_each_entry(k, &net_kset->list, entry) {
    // 一键遍历获取 eth0, eth1 并进行统一操作
}
  • 统一响应与广播热插拔事件(uevent)当 eth0 启动或断开时,直接调用:
kobject_uevent(eth0_obj, KOBJ_CHANGE);
  • eth0_obj 会通过其所属的 net_kset 统一的 uevent_ops 机制,向用户态发送广播,促使上层网络服务(如 udevd)响应事件并自动配置 IP 地址。

  • eth0 和 eth1 共享 net_kset 提供的公共 net_ktype。读取 eth0/speed 和 eth1/speed 时,内核统一调用同一套 show/store 函数处理,实现代码复用。

#include<linux/module.h>
#include<linux/kernel.h>
#include<linux/init.h>
#include<linux/kobject.h>
#include<linux/sysfs.h>
#include<linux/slab.h>
#include<linux/list.h>

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Xiaoqian");
MODULE_DESCRIPTION("A simple kernel module demonstrating kset traversal over its kobjects");

staticstructkset *my_kset;
staticstructkobject *kobj1;
staticstructkobject *kobj2;

staticint __init traverse_demo_init(void)
{
int ret;
structkobject *entry;

/* 1. 创建顶层 kset 容器目录:/sys/my_network_kset/ */
    my_kset = kset_create_and_add("my_network_kset"NULLNULL);
if (!my_kset)
return -ENOMEM;

/* 2. 创建并注册第一个子 kobject (eth0) */
    kobj1 = kzalloc(sizeof(*kobj1), GFP_KERNEL);
if (!kobj1) {
        ret = -ENOMEM;
goto err_kset;
    }
    kobj1->kset = my_kset; /* 绑定归属关系 */
    ret = kobject_init_and_add(kobj1, &dynamic_kobj_ktype, NULL"eth0");
if (ret) {
        kobject_put(kobj1);
goto err_kset;
    }

/* 3. 创建并注册第二个子 kobject (eth1) */
    kobj2 = kzalloc(sizeof(*kobj2), GFP_KERNEL);
if (!kobj2) {
        ret = -ENOMEM;
goto err_kobj1;
    }
    kobj2->kset = my_kset; /* 绑定归属关系 */
    ret = kobject_init_and_add(kobj2, &dynamic_kobj_ktype, NULL"eth1");
if (ret) {
        kobject_put(kobj2);
goto err_kobj1;
    }

/* 4. 【核心展示】:通过 kset 的内部链表遍历所有归属的 kobject */
    pr_info("--- Traversal started for kset: %s ---\n", kobject_name(&my_kset->kobj));

/* 互斥锁保护,防止链表在遍历时被动态修改 */
    spin_lock(&my_kset->list_lock);
    list_for_each_entry(entry, &my_kset->list, entry) {
        pr_info("Found kobject: %s (Path: %s)\n",
                kobject_name(entry), kobject_get_path(entry, GFP_ATOMIC));
    }
    spin_unlock(&my_kset->list_lock);

    pr_info("--- Traversal completed ---\n");
return0;

err_kobj1:
    kobject_put(kobj1);
err_kset:
    kset_unregister(my_kset);
return ret;
}

staticvoid __exit traverse_demo_exit(void)
{
/* 清理释放子 kobject 及 kset */
    kobject_put(kobj2);
    kobject_put(kobj1);
    kset_unregister(my_kset);
    pr_info("Module unloaded\n");
}

module_init(traverse_demo_init);
module_exit(traverse_demo_exit);

attribute 实现

下面以一个真实的 LED 亮度控制驱动 为例,拆解 struct attribute、struct sysfs_ops 以及 show() / store() 回调在用户态与内核态交互时的具体工作流程。

    1. 定义数据结构与属性文件
#include <linux/module.h>
#include <linux/kobject.h>
#include <linux/sysfs.h>

/* 定义设备私有数据结构体 */
struct led_device {
    int brightness;        /* 记录当前 LED 亮度值 (0-255) */
    struct kobject kobj;   /* 内嵌 kobject 关联 sysfs 目录 */
};

/* 自定义属性结构体,继承标准的 struct attribute */
struct led_attribute {
    struct attribute attr;
    ssize_t (*show)(struct led_device *dev, char *buf);
    ssize_t (*store)(struct led_device *dev, const char *buf, size_t count);
};
  • 2.实现 show() 与 store() 回调
/* 1. show 回调:响应用户态 cat /sys/demo_led/brightness */
static ssize_t led_brightness_show(struct led_device *dev, char *buf)
{
    // 将内核中的 brightness 数值序列化为文本字符串输出
return sysfs_emit(buf, "%d\n", dev->brightness);
}

/* 2. store 回调:响应用户态 echo 128 > /sys/demo_led/brightness */
static ssize_t led_brightness_store(struct led_device *dev, const char *buf, size_t count)
{
    int val, ret;

    // 解析用户态传入的字符串为整数
    ret = kstrtoint(buf, 10, &val);
if (ret < 0)
return ret;

    // 参数范围检查
if (val < 0 || val > 255)
return -EINVAL;

    // 更新内核状态并模拟控制硬件
    dev->brightness = val;
    pr_info("[LED Driver] Hardware PWM updated to brightness: %d\n", val);

return count; // 返回写入的字节数,告知内核写入成功
}

/* 实例化属性文件:生成名为 "brightness" 的属性,权限为 0664 (可读写) */
static struct led_attribute brightness_attr = {
    .attr = {
        .name = "brightness",
        .mode = 0664,
    },
    .show = led_brightness_show,
    .store = led_brightness_store,
};
    1. 绑定 sysfs_ops 桥接函数sysfs_ops 是连接通用 kobject 与驱动具体属性的桥梁
/* sysfs 操作接口的通用分发函数 */
static ssize_t led_attr_show(struct kobject *kobj, struct attribute *attr, char *buf)
{
    // 通过 container_of 获取外层结构体指针
    struct led_device *dev = container_of(kobj, struct led_device, kobj);
    struct led_attribute *led_attr = container_of(attr, struct led_attribute, attr);

if (led_attr->show)
return led_attr->show(dev, buf);
return -EIO;
}

static ssize_t led_attr_store(struct kobject *kobj, struct attribute *attr, const char *buf, size_t count)
{
    struct led_device *dev = container_of(kobj, struct led_device, kobj);
    struct led_attribute *led_attr = container_of(attr, struct led_attribute, attr);

if (led_attr->store)
return led_attr->store(dev, buf, count);
return -EIO;
}

/* 定义系统的 sysfs_ops */
static const struct sysfs_ops led_sysfs_ops = {
    .show = led_attr_show,
    .store = led_attr_store,
};

static struct kobj_type led_ktype = {
    .sysfs_ops = &led_sysfs_ops,
};

执行交互过程分析

场景 1:读取属性(用户态执行 cat /sys/demo_led/brightness)

场景 2:写入控制(用户态执行 echo 200 > /sys/demo_led/brightness)


最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-08-21 14:33:55 HTTP/2.0 GET : https://f.mffb.com.cn/a/511138.html
  2. 运行时间 : 0.229969s [ 吞吐率:4.35req/s ] 内存消耗:4,535.69kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=a87eab1eb4c8ff11add8efbae3b441ef
  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.000662s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000727s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000639s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000308s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000603s ]
  6. SELECT * FROM `set` [ RunTime:0.000217s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000780s ]
  8. SELECT * FROM `article` WHERE `id` = 511138 LIMIT 1 [ RunTime:0.000954s ]
  9. UPDATE `article` SET `lasttime` = 1787294035 WHERE `id` = 511138 [ RunTime:0.031991s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.003995s ]
  11. SELECT * FROM `article` WHERE `id` < 511138 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.008344s ]
  12. SELECT * FROM `article` WHERE `id` > 511138 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.013386s ]
  13. SELECT * FROM `article` WHERE `id` < 511138 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.001844s ]
  14. SELECT * FROM `article` WHERE `id` < 511138 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.006606s ]
  15. SELECT * FROM `article` WHERE `id` < 511138 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.001739s ]
0.233652s