# Missing usbmon module

**URL:** <https://forums.balena.io/t/missing-usbmon-module/5445>\
**Category:** balenaOS\
**Tags:** kernelmodules\
**Created:** [February 25, 2019, 5:30pm UTC](https://forums.balena.io/t/missing-usbmon-module/5445 "2019-02-25T17:30:18Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![abaldur](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@abaldur](https://forums.balena.io/u/abaldur)\
**Post date:** [February 25, 2019, 5:30pm UTC](https://forums.balena.io/t/missing-usbmon-module/5445/1 "2019-02-25T17:30:18Z")

</div>

Hi

I would like to use the kernel facility **usbmon** ([https://www.kernel.org/doc/Documentation/usb/usbmon.txt](https://www.kernel.org/doc/Documentation/usb/usbmon.txt)) to help debugging a USB device, but it seems like the module is not included in balenaOS.

If I try to load the usbmon module, I get:

```
modprobe usbmon
modprobe: FATAL: Module usbmon not found in directory /lib/modules/4.14.48-yocto-standard

```

I have tried to use your project [https://github.com/balena-io-projects/kernel-module-build](https://github.com/balena-io-projects/kernel-module-build) to build the kernel module myself, but so far without luck. I have downloaded the source code [https://github.com/torvalds/linux/tree/v4.14/drivers/usb/mon](https://github.com/torvalds/linux/tree/v4.14/drivers/usb/mon) and modified the Makefile to:

```
KERNEL_TREE_PATH?=/lib/modules/$(shell uname -r)/build
EXTRA_CFLAGS:="-DDEBUG"
KBUILD_CFLAGS += -DCONFIG_USB_MON=Y

obj-m+=usbmon.o
usbmon-y := mon_main.o mon_stat.o mon_text.o mon_bin.o

all:
	make -C $(KERNEL_TREE_PATH) M=$(PWD) modules

clean:
	make -C $(KERNEL_TREE_PATH) M=$(PWD) clean

.PHONY: all clean

```

Building with “./build.sh intel-nuc 2.26.0+rev1.dev mon” gives me:

```
make: Entering directory '/tmp/tmp.Alri3SHHAC'
  CC [M] /home/xxx/repos/kernel-module-build/mon_intel-nuc_2.26.0+rev1.dev/mon_main.o
  CC [M] /home/xxx/repos/kernel-module-build/mon_intel-nuc_2.26.0+rev1.dev/mon_stat.o
  CC [M] /home/xxx/repos/kernel-module-build/mon_intel-nuc_2.26.0+rev1.dev/mon_text.o
  CC [M] /home/xxx/repos/kernel-module-build/mon_intel-nuc_2.26.0+rev1.dev/mon_bin.o
  LD [M] /home/xxx/repos/kernel-module-build/mon_intel-nuc_2.26.0+rev1.dev/usbmon.o
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: "usb_mon_register" [/home/xxx/repos/kernel-module-build/mon_intel-nuc_2.26.0+rev1.dev/usbmon.ko] undefined!
WARNING: "usb_mon_deregister" [/home/xxx/repos/kernel-module-build/mon_intel-nuc_2.26.0+rev1.dev/usbmon.ko] undefined!
  CC /home/xxx/repos/kernel-module-build/mon_intel-nuc_2.26.0+rev1.dev/usbmon.mod.o
  LD [M] /home/xxx/repos/kernel-module-build/mon_intel-nuc_2.26.0+rev1.dev/usbmon.ko
make: Leaving directory '/tmp/tmp.Alri3SHHAC'

```

Clearly, usb\_mon\_register and usb\_mon\_deregister are missing?

Is this something you can help me with?

Best Regards,  
abaldur

---

<div class="post-metadata">

**Author:** ![spanceac](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@spanceac](https://forums.balena.io/u/spanceac)\
**Post date:** [March 1, 2019, 12:59pm UTC](https://forums.balena.io/t/missing-usbmon-module/5445/4 "2019-03-01T12:59:35Z")

</div>

Hi @abaldur,

You can grab the Balena Intel repo and do a small addition where you activate the `usbmon` driver:

> **[balena-os/balena-intel](https://github.com/balena-os/balena-intel)**
>
> Balena support for Intel boards. Contribute to balena-os/balena-intel development by creating an account on GitHub.

You should do something very similar to this:

> <https://github.com/balena-os/balena-intel/blob/bb288cee2c93f66f0e6e689b815c9d07e26c3c49/layers/meta-resin-genericx86/recipes-kernel/linux/linux-yocto_%25.bbappend#L198>

The other way would be to pay Balena for support and we could do it for you.

Regards!

---

<div class="post-metadata">

**Author:** ![abaldur](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@abaldur](https://forums.balena.io/u/abaldur)\
**Post date:** [March 7, 2019, 8:36am UTC](https://forums.balena.io/t/missing-usbmon-module/5445/5 "2019-03-07T08:36:44Z")

</div>

Hi @spanceac

Thx for the reply.

It would be really nice If I could avoid to fork the repo just because if that single kernel module.

Are there any chances that you will include it in the official balena-os/balena-intel repo?

As seen in the **linux-yocto\_%.bbappend** , you have already included some customer requests. What are your policies regarding what can be included in your official repository?

/ abaldur

---

<div class="post-metadata">

**Author:** ![spanceac](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@spanceac](https://forums.balena.io/u/spanceac)\
**Post date:** [March 7, 2019, 10:10am UTC](https://forums.balena.io/t/missing-usbmon-module/5445/7 "2019-03-07T10:10:29Z")

</div>

Hi @abaldur,

Usually what you see in the `Requested by customer` field were requests from our paying customers.

We will evaluate the adding of `usbmon` to the list of modules and will get to you with a reply.

In the past we had some issue with the free space availability for Intel NUC so adding more modules was a problem. Now we freed some space so there is some margin to add user requested modules.

Regards!

---

<div class="post-metadata">

**Author:** ![spanceac](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@spanceac](https://forums.balena.io/u/spanceac)\
**Post date:** [March 7, 2019, 10:10am UTC](https://forums.balena.io/t/missing-usbmon-module/5445/8 "2019-03-07T10:10:37Z")

</div>

Hi @abaldur,  
Usually what you see in the Requested by customer field were requests from our paying customers.  
We will evaluate the adding of usbmon to the list of modules and will get to you with a reply.  
In the past we had some issue with the free space availability for Intel NUC so adding more modules was a problem. Now we freed some space so there is some margin to add user requested modules.  
Regards!

---

<div class="post-metadata">

**Author:** ![abaldur](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@abaldur](https://forums.balena.io/u/abaldur)\
**Post date:** [March 7, 2019, 10:23am UTC](https://forums.balena.io/t/missing-usbmon-module/5445/9 "2019-03-07T10:23:42Z")

</div>

Hi @spanceac

I understand.

Sounds great, really appreciate your support.

Let me know if you decide to include it in the official repo.

/ abaldur

---

<div class="post-metadata">

**Author:** ![abaldur](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@abaldur](https://forums.balena.io/u/abaldur)\
**Post date:** [March 11, 2019, 10:23am UTC](https://forums.balena.io/t/missing-usbmon-module/5445/15 "2019-03-11T10:23:02Z")

</div>

Hi @spanceac

I have a couple of follow-up questions:

1. When you say that “Requested by customer” is from your paying customers, does that mean customers that are at least on the prototype plan? Or do you charge a separate fee for special requests like that?

2. What are the criteria for kernel modules to be included in the balena-os/balena-intel repo? I guess that you would like to keep it as small as possible?

3. If we decide to build our own custom yocto image, can we then still make use of your backend for pushing and deploying images?

Thanks

/ abaldur

---

<div class="post-metadata">

**Author:** ![spanceac](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@spanceac](https://forums.balena.io/u/spanceac)\
**Post date:** [March 13, 2019, 10:17am UTC](https://forums.balena.io/t/missing-usbmon-module/5445/43 "2019-03-13T10:17:35Z")

</div>

Hi @abaldur,

To answer your questions.

1 and 2 We enable kernel modules for paying and non-paying customers depending on how important is for the community to have those modules. We usually want to preserve the free space, to have it available for modules that are important for the community.

3 If you decide to build your own custom image you can still make use of our infrastructure to deploy and manage your applications. The only caveat is if you will update the OS from the dashboard, your custom image will be overwritten with the default OS. As long as you don’t do remote update to the OS you won’t have problems.

Another question would be why do you need this kernel module activated and if you need it permanently activated or only for some temporary debug purposes?

Regards!

---

<div class="post-metadata">

**Author:** ![abaldur](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@abaldur](https://forums.balena.io/u/abaldur)\
**Post date:** [March 29, 2019, 8:53am UTC](https://forums.balena.io/t/missing-usbmon-module/5445/45 "2019-03-29T08:53:14Z")

</div>

Hi @spanceac

Thx for the answers.

The reason we need the kernel module activated is because we are having trouble with a USB device that sometimes (unfortunately rarely) fails, and I would like to have as much debugging information as possible when that happens.

It would definitely be beneficial for us to have the module available permanently in order to track down any potential future problems.

Thanks,

/ abaldur
