当前位置:首页>Linux>Linux input子系统实际应用--GPIO按键

Linux input子系统实际应用--GPIO按键

  • 2026-03-27 16:10:35
Linux input子系统实际应用--GPIO按键
大家好,我是王鸽,这篇文章主要是关于input子系统的实际应用,以 “GPIO 按键” 为例。首先谈论一下整个架构。
整体架构
  • 硬件层:物理按键通过 GPIO 连接到 SOC,按键按下 / 松开对应 GPIO 电平变化(高 / 低);
  • GPIO 子系统:提供 GPIO 配置(输入 / 输出、上下拉)、中断注册等基础功能;
  • gpio_keys 驱动:核心逻辑层,负责解析设备树 / 平台数据、注册中断、转换按键事件;
  • 输入子系统:将按键事件封装为标准 input_event,向上暴露给用户空间(/dev/input/eventX)。
设备树介绍
gpio_keys {    compatible = "gpio-keys";    // 核心匹配属性    #address-cells = <1>;        // 子节点地址编码长度    #size-cells = <0>;           // 子节点大小编码长度    autorepeat;                  // 按键自动重复功能    button@21 {                  // 单个按键子节点(地址21)        label = "GPIO Key UP";   // 按键名称        linux,code = <103>;      // 按键对应的Linux标准键值        gpios = <&gpio1 0 1>;    // GPIO引脚配置    };};//gpios = <&gpio1 0 1> 是硬件绑定,1表示低电平有效,需与硬件电路匹配(若硬件是按下为高电平,需改为//0);
驱动代码解读
位于drivers/input/keyboard/gpio_keys.c,代码是将标准化的 GPIO 按键处理驱动,核心作用是将 “GPIO 引脚的电平变化” 转化为 Linux 输入子系统(Input Subsystem)的标准按键事件,让上层应用(如终端、Android、QT)无需关注底层 GPIO 硬件细节,直接通过统一的输入接口读取按键操作。
驱动的执行流程分为:驱动注册 → 设备匹配 → 按键初始化 → 中断处理 → 事件上报,以下是关键函数的解析。
先理解驱动中最关键的几个数据结构(kernel/include/linux/gpio_keys.h):
gpio_keys_button(单个按键的配置)
struct gpio_keys_button {    int gpio;                  // 按键对应的GPIO编号(-1表示无效)    int active_low;            // 按键有效电平:1=低电平有效,0=高电平有效    const char *desc;          // 按键描述(如"volume_up")    unsigned int type;         // 事件类型(EV_KEY/EV_SW)    unsigned int code;         // 按键编码(如KEY_VOLUMEUP,定义在input-event-codes.h)    int debounce_interval;     // 消抖时间(ms,避免机械按键抖动导致误触发)    bool wakeup;               // 是否支持唤醒系统(休眠时按键可唤醒)    bool can_disable;          // 是否可禁用该按键    unsigned int irq;	/* Irq number in case of interrupt keys */};

gpio_button_data/*key/button控制逻辑配置参数*/

struct gpio_button_data {const struct gpio_keys_button *button;//按键配置struct input_dev *input;//输入设备句柄struct timer_list timer;struct work_struct work; // 工作队列(中断上下文转进程上下文)unsigned int timer_debounce;	/* in msecs */unsigned int irq; //中断号spinlock_t lock; //自旋锁bool disabled;bool key_pressed;};

gpio_keys_platform_data(平台级配置,旧版)

struct gpio_keys_platform_data {    struct gpio_keys_button *buttons;  // 按键数组    int nbuttons;                      // 按键数量    const char *name;                  // 输入设备名称(/sys/class/input/inputX/name)    bool rep;                          // 是否支持按键自动重复(长按连发)    int (*enable)(struct device *dev);    void (*disable)(struct device *dev);    const char *name;		/* input device name */    };

gpio_keys_drvdata(驱动私有数据)

struct gpio_keys_drvdata {const struct gpio_keys_platform_data *pdata;struct input_dev *input;struct mutex disable_lock;struct gpio_button_data data[0];};
驱动入口
gpio-keys驱动是以platform_driver的身份注册到系统中的,所以其需要定义platfrom_driver结构
static int __init gpio_keys_init(void){return platform_driver_register(&gpio_keys_device_driver);}static void __exit gpio_keys_exit(void){platform_driver_unregister(&gpio_keys_device_driver);}late_initcall(gpio_keys_init);module_exit(gpio_keys_exit);
设备匹配
static struct of_device_id gpio_keys_of_match[] = {	{ .compatible = "gpio-keys", },	{ },};MODULE_DEVICE_TABLE(of, gpio_keys_of_match);static struct platform_driver gpio_keys_device_driver = {	.probe		= gpio_keys_probe,	.remove		= gpio_keys_remove,	.driver		= {		.name	= "gpio-keys",		.owner	= THIS_MODULE,		.pm	= &gpio_keys_pm_ops,		.of_match_table = of_match_ptr(gpio_keys_of_match),	}};

按键初始化

使用设备树来描述 KEY 设备信息的话,设备节点的 compatible 属性值要设置为“gpio-keys”。当设备和驱动匹配以后 gpio_keys_probe 函数就会执行, gpio_keys_probe 函数内容如下:
static int gpio_keys_probe(struct platform_device *pdev){struct device *dev = &pdev->dev;const struct gpio_keys_platform_data *pdata = dev_get_platdata(dev);struct gpio_keys_drvdata *ddata;struct input_dev *input;int i, error;int wakeup = 0;if (!pdata) {		pdata = gpio_keys_get_devtree_pdata(dev);if (IS_ERR(pdata))return PTR_ERR(pdata);	}	ddata = kzalloc(sizeof(struct gpio_keys_drvdata) +			pdata->nbuttons * sizeof(struct gpio_button_data),			GFP_KERNEL);	input = input_allocate_device();if (!ddata || !input) {		dev_err(dev, "failed to allocate state\n");error = -ENOMEM;goto fail1;	}       //初始化输入设备核心参数和配置输入设备属性	ddata->pdata = pdata;	ddata->input = input;	mutex_init(&ddata->disable_lock);	platform_set_drvdata(pdev, ddata);	input_set_drvdata(input, ddata);	input->name = pdata->name ? : pdev->name;	input->phys = "gpio-keys/input0";	input->dev.parent = &pdev->dev;	input->open = gpio_keys_open;	input->close = gpio_keys_close;	input->id.bustype = BUS_HOST;	input->id.vendor = 0x0001;	input->id.product = 0x0001;	input->id.version = 0x0100;/* Enable auto repeat feature of Linux input subsystem */if (pdata->rep)		__set_bit(EV_REP, input->evbit);for (i = 0; i < pdata->nbuttons; i++) {const struct gpio_keys_button *button = &pdata->buttons[i];struct gpio_button_data *bdata = &ddata->data[i];error = gpio_keys_setup_key(pdev, input, bdata, button);if (error)goto fail2;if (button->wakeup)			wakeup = 1;	}error = sysfs_create_group(&pdev->dev.kobj, &gpio_keys_attr_group);if (error) {		dev_err(dev, "Unable to export keys/switches, error: %d\n",error);goto fail2;	}error = input_register_device(input);if (error) {		dev_err(dev, "Unable to register input device, error: %d\n",error);goto fail3;	}	device_init_wakeup(&pdev->dev, wakeup);return 0; fail3:	sysfs_remove_group(&pdev->dev.kobj, &gpio_keys_attr_group); fail2:	while (--i >= 0)		gpio_remove_key(&ddata->data[i]);	platform_set_drvdata(pdev, NULL); fail1:	input_free_device(input);	kfree(ddata);/* If we have no platform data, we allocated pdata dynamically. */if (!dev_get_platdata(&pdev->dev))		kfree(pdata);return error;}

其中gpio_keys_get_devtree_pdata(dev):解析DTS关于gpio-keys的属性定义,创建、初始化gpio_keys_platform_data。

input = input_allocate_device():分配、初始化input设备。

遍历所有key/button,注册key/buton所需的资源(gpio、irq等),如下代码

for (i = 0; i < pdata->nbuttons; i++) {  const struct gpio_keys_button *button = &pdata->buttons[i];  struct gpio_button_data *bdata = &ddata->data[i];  error = gpio_keys_setup_key(pdev, input, bdata, button);    if (error)      goto fail2;     if (button->wakeup)	wakeup = 1;   }
其中gpio_keys_setup_key功能:为单个按键(button)初始化 GPIO/IRQ、设置中断、注册输入事件能力。代码调用流程
staticintgpio_keys_setup_key(struct platform_device *pdev,struct input_dev *input,struct gpio_button_data *bdata,const struct gpio_keys_button *button){const char *desc = button->desc ? button->desc : "gpio_keys";struct device *dev = &pdev->dev;irq_handler_t isr;unsigned long irqflags;int irq, error;	bdata->input = input;	bdata->button = button;spin_lock_init(&bdata->lock);if (gpio_is_valid(button->gpio)) {            //请求指定的 GPIO 作为输入引脚。		error = gpio_request_one(button->gpio, GPIOF_IN, desc);/if (error < 0) {dev_err(dev, "Failed to request GPIO %d, error %d\n",				button->gpio, error);return error;		}              //设置消抖设置,硬件去抖(单位微秒,所以乘以 1000)。if (button->debounce_interval) {			error = gpio_set_debounce(button->gpio,					button->debounce_interval * 1000);/* use timer if gpiolib doesn't provide debounce */if (error < 0)				bdata->timer_debounce =						button->debounce_interval;		}		irq = gpio_to_irq(button->gpio);//获取gpio中断号IRQif (irq < 0) {			error = irq;dev_err(dev,"Unable to get irq number for GPIO %d, error %d\n",				button->gpio, error);goto fail;		}		bdata->irq = irq;INIT_WORK(&bdata->work, gpio_keys_gpio_work_func);//初始化工作队列setup_timer(&bdata->timer,			    gpio_keys_gpio_timer, (unsigned long)bdata);              //设置 ISR 和中断触发方式	        isr = gpio_keys_gpio_isr;		irqflags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING;else {if (!button->irq) {dev_err(dev, "No IRQ specified\n");return -EINVAL;		}		bdata->irq = button->irq;if (button->type && button->type != EV_KEY) {dev_err(dev, "Only EV_KEY allowed for IRQ buttons.\n");return -EINVAL;		}		bdata->timer_debounce = button->debounce_interval;setup_timer(&bdata->timer,			    gpio_keys_irq_timer, (unsigned long)bdata);		isr = gpio_keys_irq_isr;		irqflags = 0;	}//告诉输入子系统:这个设备能产生 button->type(默认 EV_KEY)类型的事件,具体键码为 button->code(如 //KEY_POER)。input_set_capability(input, button->type ?: EV_KEY, button->code);/*	 * If platform has specified that the button can be disabled,	 * we don't want it to share the interrupt line.	 */if (!button->can_disable)		irqflags |= IRQF_SHARED;//允许该中断线被多个设备共享(非可禁用按键)。	error = request_any_context_irq(bdata->irq, isr, irqflags, desc, bdata);if (error < 0) {dev_err(dev, "Unable to claim irq %d; error %d\n",			bdata->irq, error);goto fail;	}return 0;fail:if (gpio_is_valid(button->gpio))gpio_free(button->gpio);return error;}

static int gpio_keys_setup_key(struct platform_device *pdev,

struct input_dev *input,

struct gpio_button_data *bdata,

const struct gpio_keys_button *button)

参数说明:

pdev:平台设备结构体,代表当前驱动绑定的设备。input:输入子系统设备,用于上报按键事件。bdata:每个按键的私有数据结构(运行时状态)。button:描述按键硬件属性的静态配置(来自设备树或平台数据)
另外通过 devm_request_any_context_irq 申请中断,any_context 表示中断处理函数可在进程 / 中断上下文运行,兼容性更好;完成按键的硬件→软件事件的链路打通。

gpio_keys_setup_key有两个分支,使用 GPIO 按键(gpio_is_valid(button->gpio)和使用非 GPIO 的外部 IRQ(else)。

  1. 结果按键中断处理函数有两个:GPIO 按键绑定 gpio_keys_gpio_isr,纯中断按键绑定 gpio_keys_irq_isr

使用 GPIO 按键(gpio_is_valid(button->gpio)

isr = gpio_keys_gpio_isr;

staticirqreturn_tgpio_keys_gpio_isr(int irq, void *dev_id){struct gpio_button_data *bdata = dev_id;BUG_ON(irq != bdata->irq);if (bdata->button->wakeup)pm_stay_awake(bdata->input->dev.parent);if (bdata->timer_debounce)mod_timer(&bdata->timer,			jiffies + msecs_to_jiffies(bdata->timer_debounce));elseschedule_work(&bdata->work);return IRQ_HANDLED;}
gpio_keys_gpio_isr:定时器消抖处理另外调用schedule_work(&bdata->work);用于下半部处理(避免在 ISR 中做耗时操作)。即调用static void gpio_keys_gpio_work_func(struct work_struct *work),该函数主要是调用gpio_keys_gpio_report_event(bdata);上报event事件。
static void gpio_keys_gpio_report_event(struct gpio_button_data *bdata){const struct gpio_keys_button *button = bdata->button;struct input_dev *input = bdata->input;	unsigned int type = button->type ?: EV_KEY;int state = (gpio_get_value_cansleep(button->gpio) ? 1 : 0) ^ button->active_low;if (type == EV_ABS) {if (state)			input_event(input, type, button->code, button->value);else {		input_event(input, type, button->code, !!state);	}	input_sync(input);}

使用非 GPIO 的外部 IRQ(else),当按键按下去触发中断后,调用中断回调函数

isr = gpio_keys_irq_isr;
static irqreturn_t gpio_keys_irq_isr(int irq, void *dev_id){struct gpio_button_data *bdata = dev_id;const struct gpio_keys_button *button = bdata->button;struct input_dev *input = bdata->input;	unsigned long flags;	BUG_ON(irq != bdata->irq);	spin_lock_irqsave(&bdata->lock, flags);if (!bdata->key_pressed) {if (bdata->button->wakeup)			pm_wakeup_event(bdata->input->dev.parent, 0);		input_event(input, EV_KEY, button->code, 1);		input_sync(input);if (!bdata->timer_debounce) {			input_event(input, EV_KEY, button->code, 0);			input_sync(input);goto out;		}		bdata->key_pressed = true;	}if (bdata->timer_debounce)		mod_timer(&bdata->timer,			jiffies + msecs_to_jiffies(bdata->timer_debounce));out:	spin_unlock_irqrestore(&bdata->lock, flags);return IRQ_HANDLED;}

gpio_keys_irq_isr 是按键中断处理函数,向 Linux 系统上报 EV_KEY 事件,表示按键按下。使用 input_sync 函数向系统上报 EV_REP 同步事件。即:

input_event(input, EV_KEY, button->code1);		input_sync(input);

gpio_keys_setup_key 是单个按键初始化的核心,关键要点:

  1. 资源兼容
    同时支持设备树(GPIO 描述符)和传统 GPIO 号配置,优先设备树;
  2. 消抖策略
    硬件消抖优先,失败则用软件消抖(延迟工作队列 / 定时器);
  3. 中断处理
    GPIO 按键绑定 gpio_keys_gpio_isr,纯中断按键绑定 gpio_keys_irq_isr
  4. 核心动作
    通过 input_set_capability 向输入子系统注册按键能力,通过 devm_request_any_context_irq 申请中断,完成按键的硬件→软件事件的链路打通。
error = sysfs_create_group(&pdev->dev.kobj, &gpio_keys_attr_group):

注册gpio-keys在sys文件系统下的访问接口属性,gpio-keys设备在sys文件系统路径为:/sys/devices/button,其中button为DTS中设备设备节点名称。

error = input_register_device(input);:注册输入设备到内核。

总的来说流程:probe 初始化(GPIO / 中断 / 输入设备)→ 中断 / 轮询处理(消抖 + 电平读取)→ input_event 上报事件。

驱动测试(验证是否生效)

驱动加载后,可通过以下步骤验证:

  1. 1.查看输入设备节点
ls /dev/input/  # 会看到eventX(如event0、event1)
2.查看设备信息
cat /proc/bus/input/devices  # 找到名称为"gpio-key-0"的设备,确认event节点
3.监听输入事件
hexdump /dev/input/eventX  # 替换为实际的event节点
按下 / 松开按键时,会看到输出的事件数据,说明驱动正常上报事件。
假设按一下「音量 +」按键,hexdump /dev/input/event1 会输出两行核心数据(按下 + 松开):
0000000 8f67 5ff9 8a49 0007 0001 0183 0001 00000000010 8f67 5ff9 8a49 0007 0000 0000 0000 00000000020 8f67 5ff9 9012 0007 0001 0183 0000 00000000030 8f67 5ff9 9012 0007 0000 0000 0000 0000

关键注意事项

  1. 事件上报规范
  2. 每一组事件必须以input_sync()结尾,否则上层无法正确解析;
    • 按键事件的value:1 = 按下,0 = 松开,2 = 长按(可选);
  3. 中断触发方式
    • 物理按键建议用IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING(双边沿),同时检测按下和松开;
  4. 资源释放顺序
    • 注册顺序:GPIO → input_dev → 中断;
    • 释放顺序:中断 → input_dev → GPIO(逆序释放,避免依赖);
  5. 设备树匹配(进阶)
    • 实际项目中,GPIO、按键编码等参数建议通过设备树传递,而非硬编码,只需修改 probe 函数读取设备树属性即可;
  6. 去抖处理(可选)
    • 物理按键可能有抖动,可在中断处理函数中加msleep(20)去抖,或用工作队列延迟处理。
谢谢点赞阅读收藏!

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-03-27 21:54:23 HTTP/2.0 GET : https://f.mffb.com.cn/a/482123.html
  2. 运行时间 : 0.223007s [ 吞吐率:4.48req/s ] 内存消耗:4,618.59kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=a63a454fed0c93c82094de3834e85aab
  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.000973s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001651s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000799s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000706s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001396s ]
  6. SELECT * FROM `set` [ RunTime:0.000599s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001720s ]
  8. SELECT * FROM `article` WHERE `id` = 482123 LIMIT 1 [ RunTime:0.001715s ]
  9. UPDATE `article` SET `lasttime` = 1774619664 WHERE `id` = 482123 [ RunTime:0.020463s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.000839s ]
  11. SELECT * FROM `article` WHERE `id` < 482123 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.001132s ]
  12. SELECT * FROM `article` WHERE `id` > 482123 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.001114s ]
  13. SELECT * FROM `article` WHERE `id` < 482123 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.001882s ]
  14. SELECT * FROM `article` WHERE `id` < 482123 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.002898s ]
  15. SELECT * FROM `article` WHERE `id` < 482123 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.001831s ]
0.227321s