|
|
| Author |
Message |
|
| vim |
Posted: Wed Mar 04, 2009 7:47 am |
|
|
|
User
Joined: 01 Oct 2008
Posts: 19
|
i want to know whether am i doing something wrong with the dialyzer. i am using erlang R12B-5, which comes with no preset plt file. so i have build a plt for the otp.
Code: dialyzer --build_plt -r /usr/local/lib/erlang/lib/kernel*/ebin \
/usr/local/lib/erlang/lib/stdlib*/ebin \
/usr/local/lib/erlang/lib/mnesia*/ebin \
/usr/local/lib/erlang/lib/compiler*/ebin \
--output_plt the.plt
later, according to missing functions errors, i have added:
Code: dialyzer --add_to_plt --plt the.plt \
-r /usr/local/lib/erlang/lib/{tools*,inets*,debugger*}/ebin \
-r /usr/local/lib/erlang/lib/{ssl*,runtime_tools*,webtool*}/ebin \
-r /usr/local/lib/erlang/lib/{gs*,public_key*,observer*,eunit*}/ebin \
--output_plt the.plt
finally i have added my own app (under development):
Code: dialyzer --add_to_plt --plt the.plt \
-r ~/my/project/path/ebin --output_plt the.plt
and i check the code as it changes by running: Code: dialyzer --plt ./the.plt -I ./include -r ./ebin
the problem is the analysis takes too much time (about almost 3 minutes), and it takes that time even if i didn't do any change in the code.
before, on R11, when the dialyzer came with preset OTP plt, it took much much less time (about 15 sec).
am i missing something?
vim. |
|
|
| Back to top |
|
| uwiger |
Posted: Wed Mar 04, 2009 3:57 pm |
|
|
|
User
Joined: 03 Jul 2006
Posts: 604
Location: Sweden
|
vim wrote: the problem is the analysis takes too much time (about almost 3 minutes), and it takes that time even if i didn't do any change in the code.
before, on R11, when the dialyzer came with preset OTP plt, it took much much less time (about 15 sec).
It could be that the add_to_plt version in R11 was the initial one that I wrote. If so, I think that the approach was a bit too optimistic. It seemed to work, at least in simple tests, but I recall that Tobias was far from happy with it.
I was testing dialyzer on a ClearCase-mounted filesystem, so being able to incrementally add to the plt was very high on my list. I would have been really happy if it had taken only three minutes.
BR,
Ulf W |
|
|
| Back to top |
|
| tobias |
Posted: Wed Mar 04, 2009 6:56 pm |
|
|
|
Joined: 04 Mar 2009
Posts: 1
Location: Stockholm, Sweden
|
vim wrote:
finally i have added my own app (under development):
Code: dialyzer --add_to_plt --plt the.plt \
-r ~/my/project/path/ebin --output_plt the.plt
and i check the code as it changes by running: Code: dialyzer --plt ./the.plt -I ./include -r ./ebin
the problem is the analysis takes too much time (about almost 3 minutes), and it takes that time even if i didn't do any change in the code.
vim.
When you explicitly add your files to the analysis, the plt information is removed for those files. This is why the analysis takes the same amount of time whether anything changed or not.
The original idea was that you put relatively stable files in your plt, and then use this to kick start the analysis of other files that depend on the ones in the plt.
What you are trying to do (i think) can be achieved by first adding your app to the plt and then use
Code: dialyzer --check_plt --plt ./the.plt
(by the way, you don't need the -I when analyzing .beam files)
Dialyzer will then only reanalyze the files that have changed, and the files that depend on these files. This should be much faster, depending on where the changed files is in the dependency graph. It will also update the plt with the new information.
Note that this way of doing things will not give you warnings from files that are not reanalyzed, so every now and then I would recommend doing a complete analysis to get a complete set of warnings.
Tobias
PS I have never tried the --check_plt way of developing for anything bigger than toy thingies for testing, so any comments on this is welcome. |
|
|
| Back to top |
|
| vim |
Posted: Thu Mar 05, 2009 6:45 am |
|
|
|
User
Joined: 01 Oct 2008
Posts: 19
|
@tobias
Quote: Code: dialyzer --check_plt --plt ./the.plt
great! that's what i was missing. i was under the impression the plt is a final file (result file) now i understand that it still have the information regarding the source (or beam) files used to create it.
thanks a lot, now it take less than 5 sec.
@ulf
Quote: It could be that the add_to_plt version in R11 was the initial one that I wrote.
now i'll know where to aim my angry mails
but seriously, i use it a lot, and see the dialyzer as an essential tool for development, imo its functionality should have been part of the erlang compiler.
vim. |
|
|
| Back to top |
|
| timrila |
Posted: Thu Jun 07, 2012 9:51 am |
|
|
|
User
Joined: 28 Mar 2012
Posts: 32
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|
|