fdrd(8)

πŸ“¦ version 1.3, in fedora 43, fedora 44

πŸ’– fdrd β€” bestie edition πŸ’–

okay so you're looking at fdrd, aka the Flight Data Recorder daemon, from section 8 of the System Manager's Manual (that's the "system administration / daemons" girlies, iykyk). she's giving very much ✨ infrastructure ✨ and honestly? iconic.


🌸 SYNOPSIS 🌸

/usr/bin/fdrd

that's it. that's the whole thing. she just runs. no args, no flags, no drama. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

so fdrd is a daemon, which is just tech-speak for "she's always on, bestie." her whole job description is:

  • enabling ftrace probes ✨
  • harvesting the ftrace data she collects 🧺
  • and (optionally!) writing that data out to a file πŸ“

her whole personality is defined by configuration files that live in /etc/fdr.d. when the service starts up, she goes through every single file in that directory that ends in .conf β€” like, she reads all of them, no skipping.

⚠️ real talk though: if you add a new config file to the fdr.d directory, you have to restart the service for her to notice it. she does not do hot-reload. she does not peek. she's committed to her routine, periodt.

on systems where systemd(8) exists, fdr is controlled by systemd (she's a systemd girlie). and if you ever need to see her error messages, you can pull them up through systemctl, like:

systemctl status -l fdr

look at her. status check. so valid. πŸ’…


πŸ’œ Configuration File Syntax πŸ’œ

these are the keywords and options she recognizes. no cap, this is the full list:

  • instance iname [buffer-size] β€” creates a brand-new ftrace instance called iname. this lil guy will show up in /sys/kernel/debug/tracing/instances 🫢

the optional buffer-size param lets you control how big the ftrace buffers are for this instance, in the kernel. you can slap a suffix of 'k', 'K', 'm', 'M', 'g' or 'G' on the end to mean kilobytes, megabytes or gigabytes respectively. units? we love units. ⭐

  • modprobe module-name β€” forces the named module to actually get loaded by fdr. this is lowkey a lifesaver when the module is normally loaded on demand and your probes literally cannot be enabled until that module is loaded. like, she'll go get it for you. 🧚
  • enable subsystem-name/probe-name [filter] β€” enables an ftrace probe in the subsystem you name. heads up: both the subsystem name and the probe name are defined by the kernel, not by you. the kernel said "this is what they're called" and we respect it. πŸ‘‘

the optional filter param lets you set an ftrace filter too! this limits how much data gets emitted, which is very demure, very mindful of your disk. the syntax of the filter language is defined by ftrace itself, and the parameters come from the static tracepoint that's being enabled in the kernel.

  • enable subsystem-name/all β€” enables all the ftrace probes for that subsystem. go big or go home. πŸ”₯
  • disable subsystem-name/probe-name β€” disables an ftrace probe in the specified subsystem. super handy for turning off selective probes when you've already used the "ALL" keyword and went a little overboard. we've all been there. πŸ™ˆ
  • disable subsystem-name/all β€” disables all probes in the specified subsystem. the opposite of slay, but sometimes you need it.
  • saveto file-name [maxsize] β€” saves the output of your enabled probes into the file you name. if you also give the optional maxsize param, the daemon will kick off a log rotation (go peek at Log Rotation below πŸ‘‡). and yes, a suffix of 'k', 'K', 'm', 'M', 'g' or 'G' works here too β€” kilobytes, megabytes, gigabytes, the whole menu.

now, if there's no saveto directive anywhere, fdr will still create the instance and enable the probes β€” she's just not writing anything down. in that case you can harvest the data manually by reading:

/sys/kernel/debug/tracing/instances/iname/trace_pipe
πŸ’€ okay important: the ftrace buffers in the kernel are circular. so if no process is harvesting the data, new data will overwrite the old data. nothing is sacred, nothing is permanent, the buffer is a circle of life. 😭
  • minfree value β€” limits the daemon's output based on how much free space is left in the file system where the save file lives. if the free-space percentage drops below the value you specified, no output gets written. self-care via disk monitoring. πŸŽ€

and if there's no minfree directive at all, fdr will just use 5% by default.


🌈 LOG ROTATION 🌈

fdr can use logrotate(8) to manage her output files, because she's organized like that. by convention, /etc/logrotate.d/instance-name is the file that controls how logrotate behaves.

she'll also invoke logrotate directly at two moments:

  • at startup ✨
  • when she reaches the maxsize limit for the save file πŸ”₯

proactive queen behavior, honestly.


⭐ SEE ALSO ⭐


πŸ‘‘ AUTHOR πŸ‘‘

Bill Baker and Calum Mackay β€” absolute legends, no notes. 🫢


and that's the whole page bestie!! this version of the fdrd(8) manual page is dated 15 June 2021 and comes from the System Manager's Manual πŸ’– go forth, enable your probes, respect the circular buffer, and remember: restart the service if you add a config file. mwah! πŸ’…βœ¨πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from