~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to system/doc/efficiency_guide/all.erl

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%% ``The contents of this file are subject to the Erlang Public License,
 
2
%% Version 1.1, (the "License"); you may not use this file except in
 
3
%% compliance with the License. You should have received a copy of the
 
4
%% Erlang Public License along with this software. If not, it can be
 
5
%% retrieved via the world wide web at http://www.erlang.org/.
 
6
%% 
 
7
%% Software distributed under the License is distributed on an "AS IS"
 
8
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 
9
%% the License for the specific language governing rights and limitations
 
10
%% under the License.
 
11
%% 
 
12
%% The Initial Developer of the Original Code is Ericsson Utvecklings AB.
 
13
%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
 
14
%% AB. All Rights Reserved.''
 
15
%% 
 
16
%%     $Id$
 
17
%%
 
18
-module(all).
 
19
 
 
20
%% User interface
 
21
-export([run/0]).
 
22
 
 
23
%% Interna constants
 
24
-define(NORMAL, 0).
 
25
 
 
26
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
27
%%%     Interface 
 
28
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
29
 
 
30
%%---------------------------------------------------------------------------
 
31
%% run() -> _
 
32
%%      
 
33
%% Runs all benchmark modules in the current directory on all erlang
 
34
%% installations specified by releases/0
 
35
%%---------------------------------------------------------------------------
 
36
run() ->
 
37
    %% Delete previous intermediate test result files.
 
38
    lists:foreach(fun(F) -> file:delete(F) end, filelib:wildcard("*.bmres")),
 
39
    lists:foreach(fun run/1, releases()).
 
40
 
 
41
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
42
%%%     Internal functions
 
43
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
44
 
 
45
%%---------------------------------------------------------------------------
 
46
%% run(Release) -> _
 
47
%%      Release = string() - Erlang release     
 
48
%% Help functions to run/0
 
49
%%---------------------------------------------------------------------------
 
50
run(Release) -> 
 
51
    command(Release ++ " -noshell -compile bench -s erlang halt"),
 
52
    command(Release ++ " -noshell -s bench run -s erlang halt").
 
53
%%---------------------------------------------------------------------------
 
54
%% command(Command) -> _
 
55
%%      Command = string() - is the name and arguments of the external 
 
56
%%                           program which will be run
 
57
%%---------------------------------------------------------------------------
 
58
command(Command) ->
 
59
    io:format("~s\n", [Command]),  % Progress info to user
 
60
    Port = open_port({spawn,Command}, [exit_status, in]), 
 
61
    print_output(Port).
 
62
%%---------------------------------------------------------------------------
 
63
%% print_output(Port) -> _
 
64
%%      Port = port()   
 
65
%% Print data from the port i.e. output from external program,
 
66
%% on standard out.
 
67
%%---------------------------------------------------------------------------
 
68
print_output(Port) ->
 
69
    receive
 
70
        {Port, {data,Bytes}} ->
 
71
            io:put_chars(Bytes),
 
72
            print_output(Port);
 
73
        {Port, {exit_status, ?NORMAL}} ->
 
74
            ok
 
75
    end.
 
76
%%---------------------------------------------------------------------------
 
77
%% run() -> Releases
 
78
%%      Releases = [Release |_]
 
79
%%      Release = string() - Erlang release  
 
80
%% Defines which erlang releases to run on
 
81
%%  --- Change this function to reflect your own erlang installations ---
 
82
%%---------------------------------------------------------------------------
 
83
releases() ->
 
84
    ["/usr/local/otp/releases/otp_beam_sunos5_r7b01_patched/bin/erl",
 
85
     "/usr/local/otp/releases/otp_beam_sunos5_r8b_patched/bin/erl"].
 
86
 
 
87
 
 
88
 
 
89
 
 
90
 
 
91
 
 
92
 
 
93
 
 
94
 
 
95
 
 
96
 
 
97
 
 
98
 
 
99
 
 
100
 
 
101
 
 
102
 
 
103
 
 
104
 
 
105
 
 
106