FUNCTION::TASK_STATE(3stap)

πŸ’– FUNCTION::TASK_STATE πŸ’–

okay bestie, welcome to the 3stap manual β€” that's the SystemTap Tapset Reference, specifically the Context Functions section, and today's main character is function::task_state ✨


🌸 NAME 🌸

function::task_state β€” the state of the task 🫢

like. literally just. what is this task doing right now. that's the whole vibe check πŸ‘‘


✨ SYNOPSIS ✨

task_state:long(task:long)

one function, one argument, one long coming back at you. no notes πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • task β€” a task_struct pointer 🧚 that's the little kernel struct that is the task. hand it over and we'll tell you what it's up to.

πŸ’œ DESCRIPTION πŸ’œ

So it returns the state of the given task, and it's gonna be one of these, no cap:

  • TASK_RUNNING (0)
  • TASK_INTERRUPTIBLE (1)
  • TASK_UNINTERRUPTIBLE (2)
  • TASK_STOPPED (4)
  • TASK_TRACED (8)
  • EXIT_ZOMBIE (16)
  • EXIT_DEAD (32)

those are the numbers, those are the names, that's the whole menu πŸ”₯ (and yeah, notice how the numbers are all powers of two β€” they're bit flags, iykyk πŸ¦‹ but fr fr, the function gives you one of the values above.)


🌈 SEE ALSO 🌈


SystemTap Tapset Reference, Version β€” dated September 2026 πŸ“… mwah, that's the whole page, ty for coming to my ted talk, go check your task states bestie πŸ’–πŸŒΈπŸŽ€πŸ¦‹πŸ«ΆπŸ’…

πŸ“¦ where this page comes from