硬汉嵌入式论坛

 找回密码
 立即注册
查看: 465|回复: 4
收起左侧

[ThreadX全家桶] 关于打印任务信息

[复制链接]

2

主题

6

回帖

12

积分

新手上路

积分
12
发表于 2024-12-23 11:56:06 | 显示全部楼层 |阅读模式
有大佬能解答一下,就是计算空闲时间的时候,RTOS怎么知道那个函数是我的IDLE函数呢?


if(uiCount == 200)
                {
                        uiCount = 0;
                        deltaIdleTime = _tx_execution_idle_time_total - IdleTime;
                        deltaTolTime = _tx_execution_thread_time_total + _tx_execution_isr_time_total + _tx_execution_idle_time_total - TolTime;
                        OSCPUUsage = (double)deltaIdleTime/deltaTolTime;
                        OSCPUUsage = 100- OSCPUUsage*100;
                        IdleTime = _tx_execution_idle_time_total;
                        TolTime = _tx_execution_thread_time_total + _tx_execution_isr_time_total + _tx_execution_idle_time_total;
                }       

回复

使用道具 举报

1万

主题

7万

回帖

11万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
115434
QQ
发表于 2024-12-24 07:53:20 | 显示全部楼层
全工程检索_tx_execution_idle_time_total的执行位置,就好理解了。
回复

使用道具 举报

2

主题

6

回帖

12

积分

新手上路

积分
12
 楼主| 发表于 2024-12-26 15:51:32 | 显示全部楼层
eric2013 发表于 2024-12-24 07:53
全工程检索_tx_execution_idle_time_total的执行位置,就好理解了。

我看了大概的理解是当链表中没有就绪任务时,开始记录空闲事件是吗
回复

使用道具 举报

2

主题

6

回帖

12

积分

新手上路

积分
12
 楼主| 发表于 2024-12-26 16:35:52 | 显示全部楼层
eric2013 发表于 2024-12-24 07:53
全工程检索_tx_execution_idle_time_total的执行位置,就好理解了。

然后我使用的是cubmx在f407上生成的V6.17版本的threadx,我移植任务打印之后不正常,能帮我看看原因吗

===============================================================
CPU利用率 = 100.00%
任务执行时间 = 0.000000000s
空闲执行时间 = 0.000000000s
中断执行时间 = 0.000000000s
系统总执行时间 = 0.000000000s
===============================================================
任务优先级 任务栈大小 当前使用栈  最大栈使用   任务名
   Prio     StackSize   CurStack    MaxStack   Taskname
    2         1024        275       536872351      Start Tasks
    4         1024        675       536873575      LED1 Run
   15         1024        123       536874799      Key Scanf
    0         1024        147       536876615      System Timer Thread
回复

使用道具 举报

1万

主题

7万

回帖

11万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
115434
QQ
发表于 2024-12-27 07:54:01 | 显示全部楼层
chengcehng 发表于 2024-12-26 16:35
然后我使用的是cubmx在f407上生成的V6.17版本的threadx,我移植任务打印之后不正常,能帮我看看原因吗

...

应该是DWT时钟周期计数器没有正常运行,下载后断电5秒,然后重新上电看下。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|手机版|硬汉嵌入式论坛

GMT+8, 2025-4-25 22:03 , Processed in 0.409699 second(s), 25 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表