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

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-08-05 20:54:29 UTC
  • mfrom: (6.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20090805205429-pm4pnwew8axraosl
Tags: 1:13.b.1-dfsg-5
* Fixed parentheses in Emacs mode (closes: #536891).
* Removed unnecessary conflicts with erlang-manpages package.
* Added workaround for #475459: disabled threads on sparc architecture.
  This breaks wxErlang, so it's only a temporary solution.

Show diffs side-by-side

added added

removed removed

Lines of Context:
167
167
int ignore_break;
168
168
int replace_intr;
169
169
 
 
170
static ERTS_INLINE int
 
171
has_prefix(const char *prefix, const char *string)
 
172
{
 
173
    int i;
 
174
    for (i = 0; prefix[i]; i++)
 
175
        if (prefix[i] != string[i])
 
176
            return 0;
 
177
    return 1;
 
178
}
 
179
 
170
180
static char*
171
181
progname(char *fullname) 
172
182
{
529
539
    erts_fprintf(stderr, "-l         turn on auto load tracing\n");
530
540
 
531
541
    erts_fprintf(stderr, "-M<X> <Y>  memory allocator switches,\n");
532
 
    erts_fprintf(stderr, "           see the erts_alloc(3) man page for more info.\n");
 
542
    erts_fprintf(stderr, "           see the erts_alloc(3) documentation for more info.\n");
533
543
 
534
544
    erts_fprintf(stderr, "-P number  set maximum number of processes on this node,\n");
535
545
    erts_fprintf(stderr, "           valid range is [%d-%d]\n",
539
549
               ERTS_MIN_COMPAT_REL, this_rel_num());
540
550
 
541
551
    erts_fprintf(stderr, "-r         force ets memory block to be moved on realloc\n");
542
 
    erts_fprintf(stderr, "-s <opt>   set scheduling option, valid options are:\n");
543
 
    erts_fprintf(stderr, "           [srq|mrq]\n");
 
552
    erts_fprintf(stderr, "-sbt type  set scheduler bind type, valid types are:\n");
 
553
    erts_fprintf(stderr, "           u|ns|ts|ps|nnts|nnps|tnnps|db\n");
 
554
    erts_fprintf(stderr, "-sct cput  set cpu topology,\n");
 
555
    erts_fprintf(stderr, "           see the erl(1) documentation for more info.\n");
544
556
    erts_fprintf(stderr, "-S n1:n2   set number of schedulers (n1), and number of\n");
545
557
    erts_fprintf(stderr, "           schedulers online (n2), valid range for both\n");
546
558
    erts_fprintf(stderr, "           numbers are [1-%d]\n",
719
731
    erts_alloc_init(argc, argv, &alloc_opts); /* Handles (and removes)
720
732
                                                 -M flags. */
721
733
 
 
734
    erts_early_init_scheduling(); /* Require allocators */
722
735
    erts_init_utils(); /* Require allocators */
723
736
 
724
737
#ifdef ERTS_ENABLE_LOCK_CHECK
969
982
            (void) get_arg(argv[i]+2, argv[i+1], &i);
970
983
            break;
971
984
 
972
 
        case 's' :
973
 
            arg = get_arg(argv[i]+2, argv[i+1], &i);
974
 
            if (sys_strcmp("mrq", arg) == 0)
 
985
        case 's' : {
 
986
            char *estr;
 
987
            int res;
 
988
            char *sub_param = argv[i]+2;
 
989
            if (has_prefix("bt", sub_param)) {
 
990
                arg = get_arg(sub_param+2, argv[i+1], &i);
 
991
                res = erts_init_scheduler_bind_type(arg);
 
992
                if (res != ERTS_INIT_SCHED_BIND_TYPE_SUCCESS) {
 
993
                    switch (res) {
 
994
                    case ERTS_INIT_SCHED_BIND_TYPE_NOT_SUPPORTED:
 
995
                        estr = "not supported";
 
996
                        break;
 
997
                    case ERTS_INIT_SCHED_BIND_TYPE_ERROR_NO_CPU_TOPOLOGY:
 
998
                        estr = "no cpu topology available";
 
999
                        break;
 
1000
                    case ERTS_INIT_SCHED_BIND_TYPE_ERROR_NO_BAD_TYPE:
 
1001
                        estr = "invalid type";
 
1002
                        break;
 
1003
                    default:
 
1004
                        estr = "undefined error";
 
1005
                        break;
 
1006
                    }
 
1007
                    erts_fprintf(stderr,
 
1008
                                 "setting scheduler bind type '%s' failed: %s\n",
 
1009
                                 arg,
 
1010
                                 estr);
 
1011
                    erts_usage();
 
1012
                }
 
1013
            }
 
1014
            else if (has_prefix("ct", sub_param)) {
 
1015
                arg = get_arg(sub_param+2, argv[i+1], &i);
 
1016
                res = erts_init_cpu_topology(arg);
 
1017
                if (res != ERTS_INIT_CPU_TOPOLOGY_OK) {
 
1018
                    switch (res) {
 
1019
                    case ERTS_INIT_CPU_TOPOLOGY_INVALID_ID:
 
1020
                        estr = "invalid identifier";
 
1021
                        break;
 
1022
                    case ERTS_INIT_CPU_TOPOLOGY_INVALID_ID_RANGE:
 
1023
                        estr = "invalid identifier range";
 
1024
                        break;
 
1025
                    case ERTS_INIT_CPU_TOPOLOGY_INVALID_HIERARCHY:
 
1026
                        estr = "invalid hierarchy";
 
1027
                        break;
 
1028
                    case ERTS_INIT_CPU_TOPOLOGY_INVALID_ID_TYPE:
 
1029
                        estr = "invalid identifier type";
 
1030
                        break;
 
1031
                    case ERTS_INIT_CPU_TOPOLOGY_INVALID_NODES:
 
1032
                        estr = "invalid nodes declaration";
 
1033
                        break;
 
1034
                    case ERTS_INIT_CPU_TOPOLOGY_MISSING_LID:
 
1035
                        estr = "missing logical identifier";
 
1036
                        break;
 
1037
                    case ERTS_INIT_CPU_TOPOLOGY_NOT_UNIQUE_LIDS:
 
1038
                        estr = "not unique logical identifiers";
 
1039
                        break;
 
1040
                    case ERTS_INIT_CPU_TOPOLOGY_NOT_UNIQUE_ENTITIES:
 
1041
                        estr = "not unique entities";
 
1042
                        break;
 
1043
                    case ERTS_INIT_CPU_TOPOLOGY_MISSING:
 
1044
                        estr = "missing cpu topology";
 
1045
                        break;
 
1046
                    default:
 
1047
                        estr = "undefined error";
 
1048
                        break;
 
1049
                    }
 
1050
                    erts_fprintf(stderr,
 
1051
                                 "bad cpu topology '%s': %s\n",
 
1052
                                 arg,
 
1053
                                 estr);
 
1054
                    erts_usage();
 
1055
                }
 
1056
            }
 
1057
            else if (sys_strcmp("pnt", sub_param) == 0)
 
1058
                erts_init_enable_processor_node_topology();
 
1059
            else if (sys_strcmp("mrq", sub_param) == 0)
975
1060
                use_multi_run_queue = 1;
976
 
            else if (sys_strcmp("srq", arg) == 0)
 
1061
            else if (sys_strcmp("srq", sub_param) == 0)
977
1062
                use_multi_run_queue = 0;
978
 
            else if (sys_strcmp("nsp", arg) == 0)
 
1063
            else if (sys_strcmp("nsp", sub_param) == 0)
979
1064
                erts_use_sender_punish = 0;
980
1065
            else {
981
 
                erts_fprintf(stderr, "bad scheduling option %s\n", arg);
 
1066
                erts_fprintf(stderr, "bad scheduling option %s\n", argv[i]);
982
1067
                erts_usage();
983
1068
            }
984
1069
            break;
985
 
 
 
1070
        }
986
1071
        case 'T' :
987
1072
            arg = get_arg(argv[i]+2, argv[i+1], &i);
988
1073
            errno = 0;