~ubuntu-branches/debian/squeeze/erlang/squeeze

« back to all changes in this revision

Viewing changes to erts/emulator/test/trace_SUITE.erl

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2010-03-09 17:34:57 UTC
  • mfrom: (10.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20100309173457-4yd6hlcb2osfhx31
Tags: 1:13.b.4-dfsg-3
Manpages in section 1 are needed even if only arch-dependent packages are
built. So, re-enabled them.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
%%
2
2
%% %CopyrightBegin%
3
 
%% 
4
 
%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
5
 
%% 
 
3
%%
 
4
%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
 
5
%%
6
6
%% The contents of this file are subject to the Erlang Public License,
7
7
%% Version 1.1, (the "License"); you may not use this file except in
8
8
%% compliance with the License. You should have received a copy of the
9
9
%% Erlang Public License along with this software. If not, it can be
10
10
%% retrieved online at http://www.erlang.org/.
11
 
%% 
 
11
%%
12
12
%% Software distributed under the License is distributed on an "AS IS"
13
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
14
%% the License for the specific language governing rights and limitations
15
15
%% under the License.
16
 
%% 
 
16
%%
17
17
%% %CopyrightEnd%
18
18
%%
19
19
 
498
498
    ["Tests erlang:system_monitor(Pid, [{long_gc,Time}])"];
499
499
system_monitor_long_gc_1(Config) when is_list(Config) ->
500
500
    erts_debug:set_internal_state(available_internal_state, true),
501
 
    try
502
 
        %% Add ?LONG_GC_SLEEP ms to all gc
503
 
        ?line erts_debug:set_internal_state(test_long_gc_sleep,
504
 
                                            ?LONG_GC_SLEEP),
505
 
        ?line LoadFun =
506
 
        fun () -> 
507
 
                garbage_collect(),
508
 
                self() 
509
 
        end,
510
 
        ?line long_gc(LoadFun, false)
 
501
    try 
 
502
        case erts_debug:get_internal_state(force_heap_frags) of
 
503
            true ->
 
504
                {skip,"emulator with FORCE_HEAP_FRAGS defined"};
 
505
            false ->
 
506
                %% Add ?LONG_GC_SLEEP ms to all gc
 
507
                ?line erts_debug:set_internal_state(test_long_gc_sleep,
 
508
                                                    ?LONG_GC_SLEEP),
 
509
                ?line LoadFun = fun () -> 
 
510
                                        garbage_collect(),
 
511
                                        self() 
 
512
                                end,
 
513
                ?line long_gc(LoadFun, false)
 
514
        end
511
515
    after
512
516
        erts_debug:set_internal_state(test_long_gc_sleep, 0),
513
 
        erts_debug:set_internal_state(available_internal_state, false)
 
517
        erts_debug:set_internal_state(available_internal_state, false)  
514
518
    end.
515
519
 
516
520
system_monitor_long_gc_2(suite) ->
520
524
system_monitor_long_gc_2(Config) when is_list(Config) ->
521
525
    erts_debug:set_internal_state(available_internal_state, true),
522
526
    try
523
 
        %% Add ?LONG_GC_SLEEP ms to all gc
524
 
        ?line erts_debug:set_internal_state(test_long_gc_sleep,
525
 
                                            ?LONG_GC_SLEEP),
526
 
        ?line Parent = self(),
527
 
        ?line LoadFun =
528
 
        fun () ->
529
 
                Ref = make_ref(),
530
 
                Pid = 
531
 
                    spawn_link(
532
 
                      fun () ->
533
 
                              garbage_collect(),
534
 
                              Parent ! {Ref, self()}
535
 
                      end),
536
 
                receive {Ref, Pid} -> Pid end
537
 
        end,
538
 
        ?line long_gc(LoadFun, true),
539
 
        ?line long_gc(LoadFun, true),
540
 
        ?line long_gc(LoadFun, true)
 
527
        case erts_debug:get_internal_state(force_heap_frags) of
 
528
            true ->
 
529
                {skip,"emulator with FORCE_HEAP_FRAGS defined"};
 
530
            false ->
 
531
                %% Add ?LONG_GC_SLEEP ms to all gc
 
532
                ?line erts_debug:set_internal_state(test_long_gc_sleep,
 
533
                                                    ?LONG_GC_SLEEP),
 
534
                ?line Parent = self(),
 
535
                ?line LoadFun =
 
536
                    fun () ->
 
537
                            Ref = make_ref(),
 
538
                            Pid = 
 
539
                                spawn_link(
 
540
                                  fun () ->
 
541
                                          garbage_collect(),
 
542
                                          Parent ! {Ref, self()}
 
543
                                  end),
 
544
                            receive {Ref, Pid} -> Pid end
 
545
                    end,
 
546
                ?line long_gc(LoadFun, true),
 
547
                ?line long_gc(LoadFun, true),
 
548
                ?line long_gc(LoadFun, true)
 
549
        end
541
550
    after
542
551
        erts_debug:set_internal_state(test_long_gc_sleep, 0),
543
552
        erts_debug:set_internal_state(available_internal_state, false)