LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-14-2011, 04:48 AM   #1
jkohvakk
LQ Newbie
 
Registered: Jun 2011
Posts: 2

Rep: Reputation: Disabled
How to monitor filesystem during compilation?


I am working for a quite big embedded software product whose dependencies are not very well known. Especially, all public headers are collected to one flat folder and it is very hard to tell who is using what.

I am hoping to get some information on the dependencies by monitoring the filesystem during a build. This is basically the same idea than in the commercial Electric Insight tool. I just thought it could be done for free but it seems to be not totally straightforward.

The build is based on recursive makeing of the subsystems. What I would like to do would be to monitor the entire source tree (or at least the folder for public headers) and record the files accessed during compilation of each sybsystem (sybsystem "A" uses these, etc...).

I noticed it is easy to implement the monitoring using inotify or pyinotify as I did in my try. This allowed me to find there are lots of files which are not used at all.

My problem really is how to convey the subsystem information to an inotify event. Now, I just get to knew which files are accessed but do not know which subsystem needs them. The easy way would be to revert to sequential make but I would like to get ideas how to solve the problem with make -j (parallel jobs). I would like to integrate the dependency data generation to the normal build process.

Thanks!
-Janne
 
Old 06-16-2011, 07:30 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,150

Rep: Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264
What's wrong with gcc -M?
 
0 members found this post helpful.
Old 06-17-2011, 01:05 AM   #3
jkohvakk
LQ Newbie
 
Registered: Jun 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
I did not probably share enough of the product. The product has code in two languages: our proprietary language and C. Our proprietary language is translated into C but there is the challenge that all headers are defined in our proprietary language. The tools for translating the headers into C work in such a manner that they either generate one big header file (for native C components) or open the definitions directly into translated code (for components written in our proprietary language). There are some features in the tools that should allow generating the dependency information but it seems they are buggy and they assume certain structure of programs which makes them often fail. Using gcc -M would just generate dependency information to these generated and disposable headers.

I was thinking monitoring the file system (in similar manner than Electric Insight) could provide us a shortcut way because fixing the proprietary tools for dependency generation seems to be a big pain. But maybe we need to fix the tools...
 
Old 06-17-2011, 01:56 PM   #4
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,150

Rep: Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264
The problem with dependency generators is that they only tell you which headers are included, not which are needed.
If I included bitmaplib.h because I thought I needed a function from it, but I no longer use it, it will likely stay there til the end of time. Unused variables generate a warning, but unused libraries don't -- seems like a bug to me.

Unless your filesystem is set to noatime, you can check whether any file has been opened for read by comparing the access time output of stat before and after compiling. File system event monitoring that I've used is driven by changes to the filesystem and isn't triggered by reading a file, so wouldn't help you.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I copy /dev/* from filesystem to filesystem Ulysses_ Linux - Desktop 12 03-09-2011 09:53 PM
Confusing USB Filesystem Problem (Can't Wipe Ext3 Filesystem) dkaplowitz Linux - Hardware 3 04-14-2007 06:30 PM
DISCUSSION: Virtual Filesystem: Building a Linux Filesystem from an Ordinary File mchirico LinuxAnswers Discussion 0 10-28-2004 10:35 PM
Encrypted Root Filesystem HOWTO and /dev filesystem tmillard Linux From Scratch 0 10-18-2004 03:58 PM
how to do a app to monitor changes in a FileSystem ? lucianomx Programming 2 05-02-2002 06:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration