Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect vTaskList() output for the affinity (IDFGH-12684) #13675

Closed
3 tasks done
AxelLin opened this issue Apr 23, 2024 · 5 comments
Closed
3 tasks done

Incorrect vTaskList() output for the affinity (IDFGH-12684) #13675

AxelLin opened this issue Apr 23, 2024 · 5 comments
Assignees
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF

Comments

@AxelLin
Copy link
Contributor

AxelLin commented Apr 23, 2024

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

v5.2.1-393-gea967cf2fb

Espressif SoC revision.

ESP32

Operating System used.

Linux

How did you build your project?

Command line with idf.py

If you are using Windows, please specify command line type.

None

Development Kit.

ESP32-WROOM-32E

Power Supply used.

USB

What is the expected behavior?

Below shows the vTaskList() output for IDF-5.1 v.s. 5.2.

In IDF-5.1: (v5.1.3-467-gc686e23038, good)

Task Name       Status  Prio    HWM     Task#   Affinity
IDLE0           R       0       924     5       0
IDLE1           R       0       916     6       1
tiT             B       18      2216    9       -1
ipc0            S       24      416     1       0
sys_evt         B       20      1784    8       0
ipc1            S       24      440     2       1
esp_timer       S       22      3352    3       0
wifi            B       23      3936    11      0
Tmr Svc         B       1       1580    7       0

In IDF-5.2: (v5.2.1-393-gea967cf2fb, bad)

Task Name       Status  Prio    HWM     Task#   Affinity
tiT             R       18      2147483647      2200    9
IDLE0           R       0       0       924     5
IDLE1           R       0       1       916     6
sys_evt         B       20      0       1832    8
ipc1            S       24      1       456     2
Tmr Svc         B       1       0       1580    7
esp_timer       S       22      0       3256    3
wifi            B       23      0       3672    11
ipc0            S       1       0       432     1
  1. Why IDF-5.2 move the Affinity field?
    I would prefer keeping Affinity in the last field.
    i.e. Don't change the output format (order) for no reason.
  2. In IDF-5.2, it prints 2147483647 rather than -1 if no affinity.

What is the actual behavior?

Above log shows the problem in IDF-5.2 outut.

Steps to reproduce.

Just call vTaskList() and verify the output.

Debug Logs.

No response

More Information.

No response

@AxelLin AxelLin added the Type: Bug bugs in IDF label Apr 23, 2024
@espressif-bot espressif-bot added the Status: Opened Issue is new label Apr 23, 2024
@github-actions github-actions bot changed the title Incorrect vTaskList() output for the affinity Incorrect vTaskList() output for the affinity (IDFGH-12684) Apr 23, 2024
@espressif-bot espressif-bot added Status: Selected for Development Issue is selected for development and removed Status: Opened Issue is new labels Apr 24, 2024
@Dazza0
Copy link
Contributor

Dazza0 commented Apr 24, 2024

@AxelLin Looks like the ordering of the fields went form Task Name, Status, Prio, HWM, Task#, Affinity to Task Name, Status, Affinity, Prio, HWM, Task#. I'll push a commit to fix this shortly.

Edit: Looks like 1472343 will also need to be backported to v5.2

@espressif-bot espressif-bot added Status: Reviewing Issue is being reviewed Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: Selected for Development Issue is selected for development Status: Reviewing Issue is being reviewed labels Apr 24, 2024
espressif-bot pushed a commit that referenced this issue Apr 26, 2024
xCoreID was previously printed as the last parameter priority to IDF v5.1, but
was changed to the third paramtere from v5.2 onwards. This commit restores the
correct ordering.

Closes #13675
@AxelLin
Copy link
Contributor Author

AxelLin commented May 13, 2024

Just remind the v5.3 branch still needs fix.

@ESP-Marius
Copy link
Collaborator

@AxelLin I has been merged to our internal 5.3 branch, so it should be available the next time it gets synced to github

espressif-bot pushed a commit that referenced this issue May 17, 2024
xCoreID was previously printed as the last parameter priority to IDF v5.1, but
was changed to the third paramtere from v5.2 onwards. This commit restores the
correct ordering.

Closes #13675
@nopnop2002
Copy link

nopnop2002 commented May 27, 2024

Sorry for the addition.
What does affinity = -1 mean?

(EDIT)
I found this:

CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID
If enabled, this will include an extra column when vTaskList is called to display the CoreID the task is pinned to (0,1) or -1 if not pinned.

This is the result of v5.2.1-533.

main            X       1       1004    4       0
IDLE1           R       0       916     6       1
IDLE0           R       0       920     5       0
tiT             B       18      2104    8       -1
ipc0            S       24      480     1       0
esp_timer       S       22      3312    3       0
wifi            B       23      656     10      0
Tmr Svc         B       1       1504    7       0
ipc1            S       24      492     2       1
sys_evt         B       20      840     9       0

@Dazza0
Copy link
Contributor

Dazza0 commented May 28, 2024

What does affinity = -1 mean?

@nopnop2002 -1 means no tskNO_AFFINITY.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

5 participants