damon_set_attrs(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… damon_set_attrs β€” like, the NAME section, bestie

okay so damon_set_attrs is literally the function that sets attributes for the monitoring. that's it, that's the vibe. πŸŽ€

(this whole page lives in the Kernel API Manual, section 9 β€” very demure, very kernel-API of it.)


✨ SYNOPSIS ✨

int damon_set_attrs (struct damon_ctx *ctx , struct damon_attrs *attrs );

🫢 ARGUMENTS 🫢

  • ctx β€” the monitoring context. the main character, honestly.
  • attrs β€” the monitoring attributes. the supporting cast that makes it all work.

🌸 DESCRIPTION 🌸

so what does this icon actually do? it updates the monitoring results and the next monitoring/damos operation schedules. two-for-one slay. πŸ‘‘

but β€” and listen, this is the important part β€” those things are periodically updated by kdamond, so you gotta call this from safe contexts. like, do not just call it from anywhere, that's not the move. πŸ™ˆ what counts as a safe context?

  • during damon_ctx setup time, while the kdamond is not yet started βœ…
  • inside of kdamond_fn βœ…

in detail (iykyk): all DAMON API callers directly call this function for the initial setup of damon_ctx, before calling damon_start. some of the API callers also indirectly call this function via damon_call -> damon_commit for online parameter updates. and finally, kdamond_fn itself uses this for applying auto-tuned monitoring intervals. the range, fr fr. 🌈

⏰ lowkey crucial: every time interval is in micro-seconds. yes, micro. don't @ me.

⭐ RETURN ⭐

  • 0 on success β€” we love a clean win ✨
  • a negative error code otherwise 😭

πŸ’– SEE ALSO πŸ’–

the whole friend group, no cap:


πŸ¦‹ okay that's the whole page, bestie. go set those attrs (safely!!).

mwah πŸ’‹ β€” this gem dropped in October 2026, source path ./mm/damon, and it's officially a wrap from the Kernel API Manual crew. stay slay, stay in a safe context. πŸŽ€βœ¨

πŸ“¦ where this page comes from