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

« back to all changes in this revision

Viewing changes to erts/emulator/beam/break.c

  • 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
1
/*
2
2
 * %CopyrightBegin%
3
 
 * 
4
 
 * Copyright Ericsson AB 1996-2009. All Rights Reserved.
5
 
 * 
 
3
 *
 
4
 * Copyright Ericsson AB 1996-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
/* This File contains functions which are called if a user hits ^C */
38
38
#include "erl_instrument.h"
39
39
#include "erl_bif_timer.h"
40
40
 
41
 
#ifdef _OSE_
42
 
#include "time.h"
43
 
#endif
44
 
 
45
41
/* Forward declarations -- should really appear somewhere else */
46
42
static void process_killer(void);
47
43
void do_break(void);
102
98
                switch(j) {
103
99
                case 'k':
104
100
                    if (rp->status == P_WAITING) {
105
 
                        Uint32 rp_locks = ERTS_PROC_LOCKS_XSIG_SEND;
 
101
                        ErtsProcLocks rp_locks = ERTS_PROC_LOCKS_XSIG_SEND;
106
102
                        erts_smp_proc_inc_refc(rp);
107
103
                        erts_smp_proc_lock(rp, rp_locks);
108
104
                        (void) erts_send_exit_signal(NULL,
262
258
    }
263
259
 
264
260
    {
265
 
       long s = 0;
266
261
       int frags = 0;
267
262
       ErlHeapFragment *m = p->mbuf;
268
263
       while (m != NULL) {
269
264
           frags++;
270
 
           s += m->size;
271
265
           m = m->next;
272
266
       }
273
267
       erts_print(to, to_arg, "Number of heap fragments: %d\n", frags);
327
321
               (unsigned)(OLD_HEND(p) - OLD_HEAP(p)) );
328
322
    erts_print(to, to_arg, "Heap unused: %bpu\n", (p->hend - p->htop));
329
323
    erts_print(to, to_arg, "OldHeap unused: %bpu\n",
330
 
               (OLD_HEAP(p) == NULL) ? 0 : (OLD_HEND(p) - OLD_HEAP(p)) );
 
324
               (OLD_HEAP(p) == NULL) ? 0 : (OLD_HEND(p) - OLD_HTOP(p)) );
331
325
 
332
326
    if (garbing) {
333
327
        print_garb_info(to, to_arg, p);
381
375
    int i;
382
376
    int old = 0;
383
377
    int cur = 0;
384
 
    Eterm* code;
 
378
    BeamInstr* code;
385
379
 
386
380
    /*
387
381
     * Calculate and print totals.
564
558
#endif
565
559
#ifdef DEBUG
566
560
        case 't':
567
 
            p_slpq();
 
561
            erts_p_slpq();
568
562
            return;
569
563
        case 'b':
570
564
            bin_check();
617
611
bin_check(void)
618
612
{
619
613
    Process  *rp;
620
 
    ProcBin *bp;
621
 
    int i, printed;
 
614
    struct erl_off_heap_header* hdr;
 
615
    int i, printed = 0;
622
616
 
623
617
    for (i=0; i < erts_max_processes; i++) {
624
618
        if ((rp = process_tab[i]) == NULL)
625
619
            continue;
626
 
        if (!(bp = rp->off_heap.mso))
627
 
            continue;
628
 
        printed = 0;
629
 
        while (bp) {
630
 
            if (printed == 0) {
631
 
                erts_printf("Process %T holding binary data \n", rp->id);
632
 
                printed = 1;
 
620
        for (hdr = rp->off_heap.first; hdr; hdr = hdr->next) {
 
621
            if (hdr->thing_word == HEADER_PROC_BIN) {
 
622
                ProcBin *bp = (ProcBin*) hdr;
 
623
                if (!printed) {
 
624
                    erts_printf("Process %T holding binary data \n", rp->id);
 
625
                    printed = 1;
 
626
                }
 
627
                erts_printf("%p orig_size: %bpd, norefs = %bpd\n",
 
628
                            bp->val, 
 
629
                            bp->val->orig_size, 
 
630
                            erts_smp_atomic_read(&bp->val->refc));
633
631
            }
634
 
            erts_printf("0x%08lx orig_size: %ld, norefs = %ld\n",
635
 
                       (unsigned long)bp->val, 
636
 
                       (long)bp->val->orig_size, 
637
 
                       erts_smp_atomic_read(&bp->val->refc));
638
 
 
639
 
            bp = bp->next;
640
632
        }
641
 
        if (printed == 1)
 
633
        if (printed) {
642
634
            erts_printf("--------------------------------------\n");
 
635
            printed = 0;
 
636
        }
643
637
    }
644
638
    /* db_bin_check() has to be rewritten for the AVL trees... */
645
639
    /*db_bin_check();*/ 
703
697
    erts_fdprintf(fd, "System version: ");
704
698
    erts_print_system_version(fd, NULL, NULL);
705
699
    erts_fdprintf(fd, "%s\n", "Compiled: " ERLANG_COMPILE_DATE);
 
700
    erts_fdprintf(fd, "Taints: ");
 
701
    erts_print_nif_taints(fd, NULL);
706
702
    erts_fdprintf(fd, "Atoms: %d\n", atom_table_size());
707
703
    info(fd, NULL); /* General system info */
708
704
    if (process_tab != NULL)  /* XXX true at init */