KW(1)

πŸ“¦
version 0.10 Β· 4 versions
, in ubuntu stonking

πŸ’– NAME πŸ’–

okay so welcome to the manual page for kw β€” the Inglorious kernel developer workflow tool β€” that's the whole one-liner, dash and all: kw - Inglorious kernel developer workflow tool -. It's a section 1 page, so it's the kw(1) manual, and the header up top is just the kw title and the manual name squished together with a ... where the terminal got shy about width. 🌸


✨ SYNOPSIS ✨

kw <command> [<option> ...]

command first, options after. she's simple like that. 🫢


πŸ’… DESCRIPTION πŸ’…

So here's the mission statement, bestie, and I'm not paraphrasing the vibe, I'm paraphrasing the words: kw exists to reduce the overhead related with infrastructure project setup in projects that have a similar workflow to the Linux Kernel. πŸŽ€

And it can (and should, no cap) be customized by editing its various configuration files β€” preferably through the kw config command. Do it the nice way, okay? πŸ’–


πŸŽ€ COMMANDS πŸŽ€

kw offers a whole squad of subcommands, catering to different audiences and targeting different functionality groups. Most subcommands have sane defaults, so you can just vibe and go. ✨


πŸš€ COMMANDS FOR DEPLOY NEW KERNEL IMAGE AND MODULE πŸš€

When we develop for Linux Kernel, we continuously want to install or update the current version of the Kernel image or modules, and those tasks may require several steps to be accomplished. That's exactly why kw gives you a command named deploy that attempts to handle all the complexity related to the new Kernel installation. πŸ”₯

It is essential to highlight, bestie β€” like, highlight it in hot pink β€” that we try to support two different types of deploy: local and remote.

  • want to update your host machine? that's the local option. 🏠
  • the remote option is much more flexible since it uses network β€” and notice, this approach is the most generic one, because you can use it for vm and local. 🌐

so there's a ref to the deploy docs, and here's literally what the source tried to render:

:ref:`kw-deploy<deploy-doc>`

and then the doc build threw hands:

System Message: ERROR/3 (<stdin>:, line 43)
       Unknown interpreted text role "ref".

πŸ’€ iconic, honestly. keep scrolling.


πŸ“š COMMANDS FOR WORKING WITH CODE πŸ“š

Projects that have a similar workflow to the Linux Kernel usually have a set of tools that simplify part of the tasks related with the code. This section describes some of the key features supported by kw to help with code. πŸ§‘β€πŸ’»

the refs it wants:

:ref:`kw-build<build-doc>`
:ref:`kw-codestyle<codestyle-doc>`
:ref:`kw-explore<explore-doc>`
:ref:`kw-maintainers<maintainers-doc>`

and the four matching little tantrums from the build:

System Message: ERROR/3 (<stdin>:, line 51)
       Unknown interpreted text role "ref".
System Message: ERROR/3 (<stdin>:, line 52)
       Unknown interpreted text role "ref".
System Message: ERROR/3 (<stdin>:, line 53)
       Unknown interpreted text role "ref".
System Message: ERROR/3 (<stdin>:, line 54)
       Unknown interpreted text role "ref".

😭 it's giving "the docs said no".


🧩 SUBSYSTEM COMMANDS 🧩

So the Linux kernel has multiple subsystems that expose operations via sysfs or provide mechanisms for userspace to interact with the driver. For this reason, kw offers some options that target some specific subsystems, providing facilities for users to interact with a particular subsystem. And currently, we only support drm. drm nation, this is your moment. 🎬

:ref:`kw-drm<drm-doc>`
System Message: ERROR/3 (<stdin>:, line 64)
       Unknown interpreted text role "ref".

πŸ› COMMAND TO DEBUG THE LINUX KERNEL πŸ›

The Linux kernel provides multiple mechanisms for debugging β€” and in particular, kw tries to simplify the debug process for three of them: events, ftrace, and dmesg. 🌈

and important: all the debug options are intended to support remote and local targets. both. always. πŸ’…

:ref:`kw-debug<debug-doc>`
System Message: ERROR/3 (<stdin>:, line 73)
       Unknown interpreted text role "ref".

πŸ“¬ COMMAND TO INTERACT WITH THE PUBLIC MAILING LISTS πŸ“¬

Some projects, like the Linux kernel, are collaboratively developed using public mailing lists. kw has a feature that provides a friendly UI to these lists, and it integrates other kw features so you get a unified kernel development experience with a focus on patch-reviewing. 🫢

:ref:`kw-patch-hub<patch-hub-doc>`
System Message: ERROR/3 (<stdin>:, line 83)
       Unknown interpreted text role "ref".

🧰 OTHER COMMANDS 🧰

This section describes a tool available in kw to help developers keep track of configuration files, plus other features provided by kw that do not fit in the previous sections. the miscellaneous drawer, but make it cute. πŸŽ€

:ref:`kw-config<config-doc>`
:ref:`kw-backup<backup-doc>`
:ref:`kw-init<init-doc>`
:ref:`kw-device<device-doc>`
:ref:`kw-ssh<ssh-doc>`
:ref:`kw-kernel-config-manager<kernel-config-manager-doc>`
:ref:`kw-diff<diff-doc>`
:ref:`kw-report<report-doc>`
:ref:`kw-pomodoro<pomodoro-doc>`
:ref:`kw-send-patch<send-patch-doc>`
:ref:`kw-self-update<self-update-doc>`

and the grand finale of build complaints (yes, all of them, we're not skipping a single one):

System Message: ERROR/3 (<stdin>:, line 91)
       Unknown interpreted text role "ref".
System Message: ERROR/3 (<stdin>:, line 92)
       Unknown interpreted text role "ref".
System Message: ERROR/3 (<stdin>:, line 93)
       Unknown interpreted text role "ref".
System Message: ERROR/3 (<stdin>:, line 94)
       Unknown interpreted text role "ref".
System Message: ERROR/3 (<stdin>:, line 95)
       Unknown interpreted text role "ref".
System Message: ERROR/3 (<stdin>:, line 96)
       Unknown interpreted text role "ref".
System Message: ERROR/3 (<stdin>:, line 97)
       Unknown interpreted text role "ref".
System Message: ERROR/3 (<stdin>:, line 98)
       Unknown interpreted text role "ref".
System Message: ERROR/3 (<stdin>:, line 99)
       Unknown interpreted text role "ref".
System Message: ERROR/3 (<stdin>:, line 100)
       Unknown interpreted text role "ref".
System Message: ERROR/3 (<stdin>:, line 101)
       Unknown interpreted text role "ref".

πŸ’€ eleven of them. eleven. anywayβ€”


🧹 clear-cache

Clean all files generated by kw. all of them. (that's the whole description, she's efficient. 🫧)

❓ h, help

Show basic help.

πŸ”’ version, --version, -v

Show kworkflow version.


🌈 EXAMPLES 🌈

For these examples, we assume that the relevant fields in your configuration files (located by default in .kw/) have already been setup. And we recommend the use of kw config for managing your local and global configurations. πŸ”§

First, if you are working in a specific kernel module, and if you want to install your recent changes in your local machine you can use:

cd <kernel-path>
kw d --local --modules

For building and installing a new module version based on the current kernel version, you can use:

cd <kernel-path>
kw bd

For checking the code style:

cd <kernel-path>
kw c drivers/iio/dummy/
kw c drivers/iio/dummy/iio_simple_dummy.c

If you want to check the maintainers:

cd <kernel-path>
kw m drivers/iio/dummy/iio_simple_dummy.c

In case you want that kw saves your current .config file, you can use:

cd <kernel-path>
kw k --save my_current_config

You can see the config's file maintained by kw with:

kw k --list

You can turn on your VM with:

kw u

After you start your VM you can ssh into it with:

kw s -c="dmesg -wH"
kw s

You can see data related to your kw usage by using the --statistics flag on the report option, see some examples below:

kw report --statistics --day
kw report --statistics --week
kw report --statistics --month
kw report --statistics --year

You can also request a specific day, week, month, or year. For example:

kw report --statistics --day=2020/05/12
kw report --statistics --week=2020/02/29
kw report --statistics --month=2020/04
kw report --statistics --year=1984

If you are working with DRM drivers, you can take advantage of load and unload commands combined with GUI control commands. For example:

kw drm --load-module='amdgpu' --gui-on # Load a driver and trigger the user GUI
kw drm --unload-module='amdgpu' # Turn off user GUI and unload the driver

If you need to debug an issue based on event values, you can try the debug options. For example:

kw debug --list # Show all events debug available in the target
kw debug --list --event="amdgpu_dm" # Show all events available under amdgpu_dm
kw debug --event='amdgpu_dm:amdgpu_dm_dce_clocks_state[sclk_khz > 0]' # Enable amdgpu_dm_dce_clocks_state event and filter by sclk_khz > 0
kw debug --disable --event='amdgpu_dm:amdgpu_dm_dce_clocks_state' # Disable amdgpu_dm_dce_clocks_state events
kw debug --event='amdgpu_dm:amdgpu_dm_dce_clocks_state' --history # Save each debug in a separated set of files
kw debug --event='amdgpu_dm:amdgpu_dm_dce_clocks_state' --follow # Wait for new event message
kw debug --event='amdgpu_dm:amdgpu_dm_dce_clocks_state' --cmd="export DISPLAY=:0.0 && xrandr --props" # Enable amdgpu_dm_dce_clocks_state, run "export DISPLAY=:0.0 && xrandr --props", collect logs, and disable events
Note: You have to wait for the sshd to become ready. ⏳ like, actually wait. bestie. don't skip this part.

πŸ’œ AUTHOR πŸ’œ

Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>, Matheus Tavares <matheus.bernardino@usp.br>


GPLv2+


and that's the whole page, bestie πŸŽ€ this one's sourced from the kw Inglorious kernel developer workflow tool manual (the one with the ... squished in the middle of the name up top), dated 2018-05-18. slay, go read a kernel module now. πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from