Answers to: debugfs_create_file doesn’t create filehttp://linuxexchange.org/questions/286/debugfs_create_file-doesnt-create-file<p>Hello, I am trying to create a debugfs file using the debugfs_create_file(...). I have written a sample code for this.</p> <pre><code>static int __init mmapexample_module_init(void) { file1 = debugfs_create_file("mmap_example", 0644, NULL, NULL, &amp;my_fops)\ ; printk(KERN_ALERT "Hello, World\n"); if(file1==NULL) { printk(KERN_ALERT "Error occured\n"); } if(file1==-ENODEV) { printk(KERN_ALERT "ENODEV occured\n"); } return 0; } </code></pre> <p>When i ran insmod i could get the Hello, World message but no the error message. So i think the debugfs_create_file worked fine. However i couldn't find any file in /sys/kernel/debug. The folder is there but it is empty. Can anyone help me with this? Thank you...</p> <p>Thanks, Bala</p>enWed, 05 May 2010 20:05:07 -0400Answer by Knight Samarhttp://linuxexchange.org/questions/286/debugfs_create_file-doesnt-create-file/314<p>Hi,</p> <p>Firstly, did you check the logs ? the <strong><em>dmesg</em></strong> ? Also, try</p> <pre><code>echo 8 &gt; /proc/sys/kernel/printk </code></pre> <p>so that you get all types of messages to go to the console.</p> <p>Secondly, do you have your debugfs mounted properly ? I would do a <em>mount | grep 'debugfs'</em> to check.</p> <p>I am not even a newbie in linux kernel programming but hope this helps you somehow :)</p>Knight SamarWed, 05 May 2010 20:05:07 -0400http://linuxexchange.org/questions/286/debugfs_create_file-doesnt-create-file/314