title: Kernel dynamic debug output
body: <p>I'm trying to see log messages that are written with <code>dev_err()</code> function in a kernel module, I tried <code>sudo dmesg -n 7</code> and <code>echo 8 &gt; /proc/sys/kernel/printk</code>
  None of them started to print <code>dev_err</code> messages to <code>dmesg</code>.</p>
  
  <p>I also noticed that dev_err function is empty in the kernel source:</p>
  
  <blockquote>
    <p>include/linux/device.h</p>
  </blockquote>
  
  <pre><code>void dev_err(const struct device *dev, const char *fmt, ...)
  {}
  </code></pre>
  
  <p>I've also tried <code>echo -n 'module &lt;module name&gt; +p' &gt; /sys/kernel/debug/dynamic_debug/control</code> (<code>debugfs</code> is mounted and <code>dynamic_debug/control</code> exists), for some reason, when I <code>cat</code> <code>dynamic_debug/control</code> and <code>grep</code> the module name I don't see it in there, I think this is the main problem, for example:</p>
  
  <pre><code>$ echo -n "file include/net/bluetooth/hci_core.h +p" &gt; /sys/kernel/debug/dynamic_debug/control
  </code></pre>
  
  <p>this command doesn't add <code>include/net/bluetooth/hci_core.h</code> to <code>/sys/kernel/debug/dynamic_debug/control</code></p>
  
  <p>why?</p>
  
  <p>(I'm using ubuntu 16.04.2 LTS, kernel 4.8.0-36-generic)</p>
  
  <p>How can I print <code>dev_err</code> log messages to <code>dmesg</code>?
  Thanks.</p>