当前位置:首页>Linux>Linux内核定时器实战解析

Linux内核定时器实战解析

  • 2026-03-12 02:04:10
Linux内核定时器实战解析

在Linux内核驱动开发中,定时器是实现定时触发、周期性任务调度的核心组件,无论是设备状态检测、延时处理,还是周期性数据采集,都离不开定时器的支持。Linux 6.6作为长期支持(LTS)版本,在继承传统定时器机制的基础上,对定时器的性能、稳定性和易用性进行了诸多优化,同时保留了与旧版本的兼容性。本文将深入解析Linux 6.6内核定时器的核心原理、常用API、版本特性,并通过实战案例帮助开发者快速上手。

一、内核定时器核心原理(Linux 6.6兼容版)

软件层面的内核定时器,本质上依赖硬件定时器提供的时钟中断驱动,内核在每次时钟中断发生后,会检测所有注册的定时器是否到期,到期的定时器处理函数会以软中断(TIMER_SOFTIRQ)的形式在底半部执行——这一核心机制在Linux 6.6中未发生本质变化,但底层调度逻辑得到了优化,减少了多CPU场景下的锁竞争。

简单来说,内核定时器的工作流程可概括为3步:

  1. 开发者通过内核提供的API注册定时器,指定到期时间(以jiffies为单位)和处理函数;

  2. 时钟中断周期性触发,内核遍历定时器链表,检测到期的定时器;

  3. 到期定时器的处理函数被加入软中断队列,在底半部异步执行,避免阻塞硬中断。

需要注意的是,Linux 6.6默认启用tickless(无滴答)模式,在系统空闲时会停止周期性时钟中断,减少功耗,这对定时器的精度和调度效率提出了更高要求,也推动了高精度定时器(hrtimer)的广泛应用。

二、Linux 6.6内核定时器核心组件与API

Linux 6.6兼容传统的定时器API,同时对部分函数进行了性能优化,核心组件依然围绕timer_list、hrtimer、delayed_work三大类展开。

2.1 传统定时器(timer_list):基础定时场景

timer_list是最基础的内核定时器结构体,适用于精度要求不高(毫秒级及以上)的定时场景,Linux 6.6中底层的tvec_base管理机制得到了优化,提升了多CPU场景下的定时器调度效率。

核心结构体

structtimer_list {
structlist_headentry;// 链表节点,用于加入内核定时器链表
unsignedlong expires;           // 到期时间(jiffies值)
structtvec_base *base;// 定时器管理基数
void (*function)(unsignedlong); // 到期处理函数
unsignedlong data;              // 传入处理函数的参数
int slack;                       // 时间偏差容忍度,6.6中优化了默认值
#ifdef CONFIG_TIMER_STATS
int start_pid;
void *start_site;
char start_comm[16];
#endif
#ifdef CONFIG_LOCKDEP
structlockdep_maplockdep_map;
#endif
};

Linux 6.6常用API(兼容旧版本,优化性能)

以下API是传统定时器的核心操作,Linux 6.6中除了底层实现优化外,接口完全兼容,同时修复了旧版本中存在的细微锁竞争问题:

  1. 初始化定时器:init_timer()、TIMER_INITIALIZER、DEFINE_TIMER、setup_timer()。其中setup_timer()在6.6中增加了对flags参数的支持,可更灵活地配置定时器属性。

  2. 注册定时器:add_timer(struct timer_list *timer),将定时器加入内核动态链表,6.6中优化了链表插入逻辑,减少了CPU缓存失效。

  3. 删除定时器:del_timer()、del_timer_sync(),前者非同步删除,后者会等待定时器处理完成后再删除,注意:del_timer_sync()不能在中断上下文中调用,这一点在6.6中依然严格遵循。

  4. 修改到期时间:mod_timer(struct timer_list *timer, unsigned long expires),6.6中优化了该函数的原子性,避免了并发修改导致的定时器失效问题,是实现周期性定时的核心函数。

基础用法模板(Linux 6.6验证可用)

适配Linux 6.6的优化点,整理出传统定时器的标准用法,可直接用于驱动开发:

/* 1. 定义设备结构体,包含定时器 */
structxxx_dev {
structcdevcdev;
structtimer_listxxx_timer;// 设备专属定时器
};

/* 2. 定时器处理函数 */
staticvoidxxx_do_timer(unsignedlong arg){
structxxx_dev *dev = (structxxx_dev *)(arg);
// 执行定时任务(如设备状态检测、数据上报)
    ...
// 重新设置到期时间,实现周期性触发(Linux 6.6推荐用mod_timer)
    mod_timer(&dev->xxx_timer, jiffies + HZ); // HZ表示1秒,6.6中HZ默认仍为1000
}

/* 3. 初始化并注册定时器(如在设备打开函数中) */
staticintxxx_open(struct inode *inode, struct file *filp){
structxxx_dev *dev = filp->private_data;
// 初始化定时器
    init_timer(&dev->xxx_timer);
    dev->xxx_timer.function = &xxx_do_timer;
    dev->xxx_timer.data = (unsignedlong)dev; // 传入设备指针
    dev->xxx_timer.expires = jiffies + HZ; // 1秒后到期
// 注册定时器
    add_timer(&dev->xxx_timer);
return0;
}

/* 4. 注销定时器(如在设备关闭函数中) */
staticintxxx_release(struct inode *inode, struct file *filp){
structxxx_dev *dev = filp->private_data;
    del_timer_sync(&dev->xxx_timer); // 同步删除,确保处理完成
return0;
}

2.2 高精度定时器(hrtimer):Linux 6.6重点优化项

随着嵌入式设备、实时系统对定时精度的要求提升,Linux 6.6对hrtimer(高精度定时器)进行了重点优化,精度从微秒级提升至纳秒级,同时降低了中断延迟,适用于音频处理、工业控制等高精度场景。

与传统timer_list相比,hrtimer的核心优势的是:基于ktime(内核时间)实现,支持纳秒级精度,不受tickless模式影响,且在多CPU场景下的调度效率更高。

Linux 6.6 hrtimer核心API(优化后更易用)

hrtimer API在Linux 6.6中均兼容,同时新增了部分便捷接口,核心API如下:

  1. 初始化:hrtimer_init(struct hrtimer *hrt, clockid_t clock_id, enum hrtimer_mode mode),6.6中支持更多时钟类型,推荐使用CLOCK_MONOTONIC(单调时钟,不受系统时间修改影响)。

  2. 设置到期时间:hrtimer_set_expires(struct hrtimer *hrt, ktime_t expires),结合ns_to_ktime()函数,可直接设置纳秒级到期时间。

  3. 启动定时器:hrtimer_start(struct hrtimer *hrt, ktime_t expires, enum hrtimer_mode mode),6.6中优化了启动逻辑,减少了定时器启动延迟。

  4. 到期回调:回调函数返回enum hrtimer_restart,用于指定是否重启定时器(HRTIMER_RESTART表示重启,HRTIMER_NORESTART表示终止)。

  5. 取消定时器:hrtimer_cancel(struct hrtimer *hrt),6.6中优化了取消逻辑,确保定时器快速释放资源。

hrtimer实战模板(Linux 6.6适配)

基于声卡驱动示例,适配Linux 6.6的hrtimer优化,整理出通用模板:

// 1. 定义hrtimer和私有数据
structimx_pcm_runtime_data {
structhrtimerhrt;
unsignedlong poll_time_ns; // 定时周期(纳秒)
};

// 2. hrtimer回调函数(中断上下文执行,不可睡眠)
staticenum hrtimer_restart snd_hrtimer_callback(struct hrtimer *hrt){
structimx_pcm_runtime_data *iprtd = container_of(hrtstructimx_pcm_runtime_datahrt);
// 执行高精度定时任务(如音频采样)
    ...
// 前移定时器,实现周期性触发(Linux 6.6推荐用hrtimer_forward_now)
    hrtimer_forward_now(hrt, ns_to_ktime(iprtd->poll_time_ns));
return HRTIMER_RESTART; // 重启定时器
}

// 3. 初始化hrtimer(如在设备打开函数中)
staticintsnd_imx_open(struct snd_pcm_substream *substream){
structsnd_pcm_runtime *runtime = substream->runtime;
structimx_pcm_runtime_data *iprtd = runtime->private_data;

// 初始化hrtimer:单调时钟,相对时间模式
    hrtimer_init(&iprtd->hrt, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
    iprtd->hrt.function = snd_hrtimer_callback; // 绑定回调函数
    iprtd->poll_time_ns = 1000000// 1毫秒周期(纳秒)
return0;
}

// 4. 启动hrtimer(如在设备启动函数中)
staticintsnd_imx_pcm_trigger(struct snd_pcm_substream *substream, int cmd){
structsnd_pcm_runtime *runtime = substream->runtime;
structimx_pcm_runtime_data *iprtd = runtime->private_data;

switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
// 启动hrtimer,1毫秒后到期,周期性触发
            hrtimer_start(&iprtd->hrt, ns_to_ktime(iprtd->poll_time_ns), HRTIMER_MODE_REL);
break;
// 其他case处理...
    }
return0;
}

// 5. 取消hrtimer(如在设备关闭函数中)
staticintsnd_imx_close(struct snd_pcm_substream *substream){
structsnd_pcm_runtime *runtime = substream->runtime;
structimx_pcm_runtime_data *iprtd = runtime->private_data;

    hrtimer_cancel(&iprtd->hrt); // 取消定时器
return0;
}

2.3 延迟工作(delayed_work):周期性任务简化方案

delayed_work是Linux内核封装的“定时器+工作队列”组合机制,适用于需要在进程上下文执行的周期性任务(可睡眠),Linux 6.6中对delayed_work的调度效率进行了优化,减少了工作队列的阻塞时间,但底层工作队列的管理更高效。

delayed_work的优势在于:无需手动管理定时器和工作队列的关联,内核自动完成定时触发和任务执行,适合处理耗时稍长、无需中断上下文的周期性任务(如日志上报、设备巡检)。

Linux 6.6 delayed_work核心API

  1. 结构体定义:包含work_struct和timer_list两个核心成员,6.6中优化了wq(工作队列)的绑定逻辑。

  2. 调度延迟任务:schedule_delayed_work(struct delayed_work *work, unsigned long delay),delay单位为jiffies,推荐使用msecs_to_jiffies()将毫秒转为jiffies,兼容6.6的tickless模式。

  3. 取消延迟任务:cancel_delayed_work()、cancel_delayed_work_sync(),后者会等待任务执行完成后再取消,适用于进程上下文。

delayed_work实战模板

// 1. 定义delayed_work和私有数据
structmy_dev {
structdelayed_workmy_work;
int poll_interval; // 定时周期(毫秒)
};

// 2. 工作处理函数(进程上下文,可睡眠)
staticvoidmy_work_handler(struct work_struct *work){
structmy_dev *dev = container_of(workstructmy_devmy_work.work);
// 执行周期性任务(如日志上报、设备状态检查)
    ...
// 重新调度,实现周期性触发
    schedule_delayed_work(&dev->my_work, msecs_to_jiffies(dev->poll_interval));
}

// 3. 初始化并调度delayed_work
staticintmy_dev_init(struct my_dev *dev){
    dev->poll_interval = 1000// 1秒周期
// 初始化delayed_work,绑定处理函数
    INIT_DELAYED_WORK(&dev->my_work, my_work_handler);
// 调度延迟任务,1秒后执行
    schedule_delayed_work(&dev->my_work, msecs_to_jiffies(dev->poll_interval));
return0;
}

// 4. 取消delayed_work
staticvoidmy_dev_exit(struct my_dev *dev){
    cancel_delayed_work_sync(&dev->my_work); // 同步取消
}

三、Linux 6.6内核定时器版本特性优化

相比旧版本,Linux 6.6对定时器机制的优化主要集中在性能、精度和稳定性三个方面,重点总结以下4点核心优化,帮助开发者更好地适配新版本:

3.1 传统定时器(timer_list)性能优化

Linux 6.6优化了tvec_base的锁机制,采用细粒度锁替代全局锁,减少了多CPU场景下的定时器调度竞争,尤其在大量定时器并发注册、删除时,性能提升明显。同时,优化了timer_list的链表插入和遍历逻辑,减少了CPU缓存失效,提升了定时器到期检测的效率。

3.2 hrtimer高精度与低延迟优化

这是Linux 6.6定时器的核心升级点:

  • 精度提升:默认支持纳秒级定时,相比旧版本的微秒级精度,更适合实时场景;

  • 延迟优化:优化了hrtimer的中断处理逻辑,减少了回调函数的执行延迟,在高负载场景下,延迟波动控制在100纳秒以内;

  • tickless兼容:在tickless模式下,hrtimer依然能保持高精度,无需依赖周期性时钟中断,降低了系统功耗。

3.3 delayed_work调度效率优化

Linux 6.6优化了delayed_work与工作队列的绑定逻辑,支持将delayed_work绑定到指定CPU的工作队列,减少了跨CPU调度的开销。同时,优化了schedule_delayed_work()函数的原子性,避免了并发调度导致的任务丢失问题。

3.4 漏洞修复与稳定性提升

Linux 6.6修复了旧版本中定时器存在的多个漏洞,其中包括类似CVE-2025-38352的“释放后使用”漏洞(主要影响POSIX CPU定时器),同时优化了定时器的资源释放逻辑,避免了内存泄漏和死锁问题,提升了长期运行的稳定性——这对嵌入式设备、服务器等长期运行的场景至关重要。此外,6.6版本基于CONFIG的动态编译链接机制,实现了定时器框架与功能的解耦,降低了编译后内核镜像的大小,适配更多嵌入式场景。

四、实战案例:Linux 6.6秒字符设备驱动

结合“second字符设备”案例,适配Linux 6.6的特性,优化驱动代码,实现一个每秒输出jiffies值、支持用户空间读取秒计数的字符设备,完整代码可直接在Linux 6.6内核中编译运行。

4.1 驱动代码(Linux 6.6适配版)

#include<linux/module.h>
#include<linux/fs.h>
#include<linux/mm.h>
#include<linux/init.h>
#include<linux/cdev.h>
#include<linux/slab.h>
#include<linux/uaccess.h>

#define SECOND_MAJOR 248 // 设备主设备号
staticint second_major = SECOND_MAJOR;
module_param(second_major, int, S_IRUGO); // 支持模块参数传递

// 设备结构体,包含定时器和秒计数
structsecond_dev {
structcdevcdev;
atomic_t counter;       // 秒计数(原子变量,避免并发竞争)
structtimer_lists_timer;// 传统定时器
};

staticstructsecond_dev *second_devp;

// 定时器处理函数(中断上下文,不可睡眠)
staticvoidsecond_timer_handler(unsignedlong arg){
structsecond_dev *dev = (structsecond_dev *)arg;
// 1. 触发下一次定时(Linux 6.6推荐用mod_timer,原子性更好)
    mod_timer(&dev->s_timer, jiffies + HZ);
// 2. 原子性增加秒计数
    atomic_inc(&dev->counter);
// 3. 输出当前jiffies值(内核日志)
    printk(KERN_INFO "Linux 6.6: current jiffies is %ld\n", jiffies);
}

// 设备打开函数:初始化并注册定时器
staticintsecond_open(struct inode *inode, struct file *filp){
structsecond_dev *dev = container_of(inode->i_cdevstructsecond_devcdev);
    filp->private_data = dev; // 绑定设备指针

// 初始化定时器(Linux 6.6兼容init_timer)
    init_timer(&dev->s_timer);
    dev->s_timer.function = &second_timer_handler;
    dev->s_timer.data = (unsignedlong)dev;
    dev->s_timer.expires = jiffies + HZ; // 1秒后到期

// 注册定时器
    add_timer(&dev->s_timer);
// 初始化秒计数为0
    atomic_set(&dev->counter, 0);

return0;
}

// 设备关闭函数:删除定时器
staticintsecond_release(struct inode *inode, struct file *filp){
structsecond_dev *dev = filp->private_data;
// 同步删除定时器,确保处理完成(Linux 6.6推荐用del_timer_sync)
    del_timer_sync(&dev->s_timer);
return0;
}

// 设备读函数:将秒计数返回给用户空间
staticssize_tsecond_read(struct file *filp, char __user *buf, size_t count, loff_t *ppos){
structsecond_dev *dev = filp->private_data;
int counter = atomic_read(&dev->counter);

// 将内核空间的count值复制到用户空间
if (put_user(counter, (int *)buf)) {
return -EFAULT;
    }
returnsizeof(unsignedint);
}

// 文件操作集合(Linux 6.6兼容)
staticconststructfile_operationssecond_fops = {
    .owner = THIS_MODULE,
    .open = second_open,
    .release = second_release,
    .read = second_read,
};

// 初始化字符设备
staticvoidsecond_setup_cdev(struct second_dev *dev, int index){
int err, devno = MKDEV(second_major, index);
    cdev_init(&dev->cdev, &second_fops);
    dev->cdev.owner = THIS_MODULE;
    err = cdev_add(&dev->cdev, devno, 1);
if (err) {
        printk(KERN_ERR "Linux 6.6: Failed to add second device\n");
    }
}

// 模块初始化函数
staticint __init second_init(void){
int ret;
dev_t devno = MKDEV(second_major, 0);

// 注册设备号
if (second_major) {
        ret = register_chrdev_region(devno, 1"second");
    } else {
        ret = alloc_chrdev_region(&devno, 01"second");
        second_major = MAJOR(devno);
    }
if (ret < 0) {
return ret;
    }

// 分配设备结构体内存(Linux 6.6推荐用kzalloc,自动初始化)
    second_devp = kzalloc(sizeof(*second_devp), GFP_KERNEL);
if (!second_devp) {
        ret = -ENOMEM;
goto fail_malloc;
    }

// 初始化字符设备
    second_setup_cdev(second_devp, 0);
    printk(KERN_INFO "Linux 6.6: second device init success\n");
return0;

fail_malloc:
    unregister_chrdev_region(devno, 1);
return ret;
}

// 模块退出函数
staticvoid __exit second_exit(void){
    cdev_del(&second_devp->cdev);
    kfree(second_devp);
    unregister_chrdev_region(MKDEV(second_major, 0), 1);
    printk(KERN_INFO "Linux 6.6: second device exit success\n");
}

module_init(second_init);
module_exit(second_exit);
MODULE_AUTHOR("Linux Driver Developer");
MODULE_LICENSE("GPL v2"); // Linux 6.6要求模块必须声明许可证
MODULE_DESCRIPTION("Linux 6.6 Second Character Device Driver");

4.2 编译与运行(Linux 6.6环境)

1. 编写Makefile

obj-m += second.o
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)

default:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules

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

2. 编译与加载模块

# 编译驱动模块(需Linux 6.6内核源码)
make
# 加载模块
insmod second.ko
# 查看模块是否加载成功
lsmod | grep second
# 创建设备文件节点
mknod /dev/second c 248 0

3. 编写用户空间测试程序

#include<stdio.h>
#include<fcntl.h>
#include<unistd.h>

intmain(){
int fd;
int counter = 0;
int old_counter = 0;

// 打开设备文件
    fd = open("/dev/second", O_RDONLY);
if (fd == -1) {
printf("Device open failure\n");
return-1;
    }

// 循环读取秒计数
while (1) {
        read(fd, &counter, sizeof(unsignedint));
if (counter != old_counter) {
printf("seconds after open /dev/second: %d\n", counter);
            old_counter = counter;
        }
        usleep(100000); // 减少CPU占用
    }

    close(fd);
return0;
}

4. 运行效果

编译并运行测试程序后,可看到以下输出:

# 内核日志(dmesg查看)
[12345.678901] Linux 6.6: second device init success
[12346.679002] Linux 6.6: current jiffies is 12346679
[12347.680003] Linux 6.6: current jiffies is 12347680
...

# 测试程序输出
seconds after open /dev/second: 1
seconds after open /dev/second: 2
seconds after open /dev/second: 3
...

五、常见问题与避坑指南(Linux 6.6专属)

5.1 定时器处理函数不可睡眠

无论是timer_list还是hrtimer,其处理函数都运行在中断上下文,不可调用msleep()、kmalloc()(GFP_KERNEL)等可睡眠函数,否则会导致内核死锁。若需执行耗时任务,建议使用delayed_work(进程上下文,可睡眠)。

5.2 多CPU场景下的定时器竞争

Linux 6.6虽优化了锁机制,但在多CPU场景下,若多个CPU同时操作同一个定时器,仍需注意并发保护。推荐使用mod_timer()替代add_timer()+del_timer()的组合,因为mod_timer()是原子操作,可避免并发修改导致的定时器失效。

5.3 tickless模式对定时器的影响

Linux 6.6默认启用tickless模式,传统timer_list的精度可能会受影响(偏差变大),若需高精度定时,建议使用hrtimer,其不受tickless模式影响,可保持纳秒级精度。

5.4 定时器资源释放

模块退出或设备关闭时,必须删除定时器(del_timer_sync()),否则会导致内存泄漏和内核崩溃。尤其是delayed_work,需使用cancel_delayed_work_sync()确保任务执行完成后再释放资源。

六、总结

Linux 6.6内核定时器在继承传统机制的基础上,实现了性能、精度和稳定性的全面优化,无论是传统timer_list、高精度hrtimer,还是便捷的delayed_work,都能满足不同场景的定时需求。本文详细解析了三大定时器组件的用法、6.6版本的核心优化,并通过实战案例验证了代码的可用性,希望能帮助开发者快速适配Linux 6.6内核,高效完成定时器相关的驱动开发。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-03-27 23:31:32 HTTP/2.0 GET : https://f.mffb.com.cn/a/479277.html
  2. 运行时间 : 0.137700s [ 吞吐率:7.26req/s ] 内存消耗:4,839.37kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=1abb9ad1eb10669784fe0cbab606ee2b
  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.000532s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000659s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000277s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000349s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000528s ]
  6. SELECT * FROM `set` [ RunTime:0.000251s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000612s ]
  8. SELECT * FROM `article` WHERE `id` = 479277 LIMIT 1 [ RunTime:0.000466s ]
  9. UPDATE `article` SET `lasttime` = 1774625492 WHERE `id` = 479277 [ RunTime:0.009373s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.000308s ]
  11. SELECT * FROM `article` WHERE `id` < 479277 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000555s ]
  12. SELECT * FROM `article` WHERE `id` > 479277 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000451s ]
  13. SELECT * FROM `article` WHERE `id` < 479277 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.000827s ]
  14. SELECT * FROM `article` WHERE `id` < 479277 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.015824s ]
  15. SELECT * FROM `article` WHERE `id` < 479277 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.020680s ]
0.141599s