bcc: option to show full paths for fileslower and related tools

I just used fileslower for the first time, it’s really a cool tool. Thanks for that already!

But looking at the results, it leaves me guessing as to what file is actually being referenced:


Tracing sync read/writes slower than 100 ms
TIME(s)  COMM           TID    D BYTES   LAT(ms) FILENAME
3.215    akonadi_follow 8034   R 16384    324.60 agent_config_akonadi_followup...
3.218    akonadi_indexi 8044   R 16384    330.60 agent_config_akonadi_indexing...
3.270    akonadi_ical_r 8040   R 16384    379.21 agent_config_akonadi_ical_res...
3.338    akonadi_akonot 8029   R 16384    394.43 agent_config_akonadi_akonotes...
3.350    akonadi_maildi 8046   R 16384    457.47 agent_config_akonadi_maildisp...
3.354    akonadi_contac 8033   R 16384    419.19 agent_config_akonadi_contacts...
3.354    akonadi_vcard_ 8052   R 16384    413.45 agent_config_akonadi_vcard_re...
3.354    akonadi_maildi 8045   R 16384    404.17 agent_config_akonadi_maildir_...
3.367    akonadi_akonot 8028   R 16384    426.73 agent_config_akonadi_akonotes...
3.382    akonadi_akonot 8031   R 16384    487.54 agent_config_akonadi_akonotes...
3.405    akonadi_migrat 8048   R 16384    401.60 akonadi-migrationrc
3.418    akonadi_indexi 8044   R 16384    199.96 agent_config_akonadi_indexing...
3.418    akonadi_ical_r 8040   R 16384    108.69 akonadi_ical_resource_0rc
3.418    akonadi_notes_ 8050   R 16384    404.33 akonadi_notes_agentrc
3.425    akonadi_akonot 8030   R 16384    410.83 akonadi_akonotes_resource_2rc
3.454    akonadi_maildi 8046   R 16384    103.39 agent_config_akonadi_maildisp...                                                                                                                                 
3.583    akonadi_ical_r 8040   R 524288   111.20 std.ics                                                                                                                                                          
3.620    akonadi_akonot 8031   R 16384    135.59 akonadi_akonotes_resource_3rc                                                                                                                                    
3.637    akonadi_vcard_ 8052   R 16384    157.05 Default Address Bookrc                                                                                                                                           
3.783    akonadi_maildi 8046   R 16384    272.56 specialmailcollectionsrc                                                                                                                                         
3.800    akonadi_akonot 8029   R 16384    225.03 1343311121.R370.milian-kdab2                                                                                                                                     
3.898    akonadi_vcard_ 8052   R 524288   261.01 std.vcf                                                                                                                                                          
3.898    akonadi_akonot 8028   R 16384    430.36 akonadi_akonotes_resource_0rc                                                                                                                                    
3.933    akonadi_akonot 8029   R 16384    123.05 types                                                                                                                                                            
3.961    akonadi_indexi 8044   R 16384    457.26 baloorc                                                                                                                                                          
6.712    kmail          8185   R 4096     115.27 machine-id 

I’d like to request two options to improve this situation:

  • a way to increase the filename limit, such that I at least see the full filename instead of e.g. agent_config_akonadi_akonotes...
  • an option to print the full path, instead of just the filename

If you guide me as to what would be required to implement this, I’d be willing to provide a patch. Just increasing the DNAME_INLINE_LEN in fileslower.py doesn’t seem to produce correct results 😉

Cheers

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

fileslower is currently using d_name.name.

Regarding full path:

We could use a map to cache an inode->path on open(), and that might even be largely stable (tracing probes & structures that don’t change much), but, that means adding more probes.

fileslower already has access to the dentry and an inode. We can, with a “-f” (full) or “-l” (long) option, do an unrolled loop to walk back several directory levels and build up the path. We might need to get a bit creative with the limited string functions, eg, have a char[256] that we populate in reverse directory order, and have python switch it back around the right way. I think that would be fine because it’s fileslower, and only printing events of interest (and not every single VFS call), so this unrolled loop and char[256] buffers would only be done when needed.

I just took a look, and doing a reverse path walk from the dentry is also how SystemTap does it. 😃

Documentation/networking/netdev-FAQ.txt is a good first step. for kernel upstream submission it has to be over email with proper SOB and follow the process. To share rough idea it can be a link to github commit in your cloned kernel tree or email to iovisor-dev or netdev lists (depending on how many people you want to hear feedback from)