erl(1) Erlang Module Definition erl(1) (NAME) erl - (DESCRIPTION) erl . ( erl ) . : Erlang/OTP 25 werl.exe . Erlang/OTP 25 . erl . : o + . . o - ( ) init init . init init . . init:get_argument/1 . "-" . o . init init:get_plain_arguments/0 . -- . -extra . : % erl +W w -sname arnie +S 2 -s my_init -extra +bertie (arnie@host)1> init:get_argument(sname). {ok,[["arnie"]]} (arnie@host)2> init:get_plain_arguments(). ["+bertie"] +W w +S 2 . -s my_init init init . -sname arnie init Kernel . -extra ( +bertie) . % erl -myflag 1 1> init:get_argument(myflag). {ok,[["1"]]} 2> init:get_plain_arguments(). [] -myflag 1 init . . (Flags) init "(init flag)" . init:get_argument/1 . . -- (init flag) -- (-flag +flag) init:get_plain_arguments/0 . -Application Par Val Par Val Application app(4) application . -args_file FileName FileName . '-args_file FileName' . FileName . # . (\) . erl -args_file FileName. -args_file . -extra . . -extra -extra -extra . -async_shell_start (Erlang/OTP 5.4 ). . -boot File File.boot init . File File.boot $ROOT/bin . $ROOT/bin/start.boot . -boot_var Var Dir Var $ROOT Dir . $ROOT/lib systools:make_script/1,2 SASL . -code_path_cache code . -compile Mod1 Mod2 ... ( ). -noinput . erlc . -config Config [Config ...] Config.config app(4) application . . -configfd FD [FD ...] ( ) app(4) application . . . init:restart/0 init:restart/1 . -configfd 0 -noinput . : ( ) ( ) -configfd . ( ): $ erl \ -noshell \ -configfd 3 \ -eval \ <(echo '[{kernel, [{logger_level, warning}]}].') {ok,warning} $ echo '[{kernel, [{logger_level, warning}]}].' > test1.config $ echo '[{kernel, [{logger_level, error}]}].' > test2.config $ erl \ -noshell \ -configfd 3 \ -configfd 4 \ -eval \ 3< test1.config 4< test2.config {ok,error} -connect_all false kernel connect_all . -cookie Cookie -setcookie . -setcookie . -detached . . -noinput . -disable-feature feature feature . all . -dist_listen true|false . . false -hidden . -emu_args . . -emu_flavor emu|jit|smp (flavor) . . : emu jit. smp . --emu_type . erlang:system_info(emu_flavor) . ( . make FLAVOR=$FLAVOR Erlang/OTP .) -emu_type Type . lock-counter -emu_type lcnt . erlang:system_info(build_type) . ( . --enable-lock-counter configure .) -enable-feature feature feature . all . -env Variable Value Variable Value . : % erl -env DISPLAY gin:0 DISPLAY gin:0 . -epmd_module Module kernel epmd_module . -erl_epmd_port Port kernel erl_epmd_node_listen_port . -eval Expr (init flag) init Expr init . -extra (init flag) -extra init:get_plain_arguments/0 . -heart (heartbeat) heart . -hidden . (global group) . nodes/0 . global_group . -hosts Hosts IP erl_boot_server . -loader inet . IP ( "150.236.20.74") . (broadcast) ( ) . -id Id . Id -sname -name . -init_debug init . -instr (emulator flag) ( ) (instrumented) . instrument . . -loader Loader erl_prim_loader erl_prim_loader . Loader : o efile . o inet . -id -hosts -setcookie . Loader Loader . -make make:all() make . -noinput . -man Module Module . . -mode interactive | embedded interactive ( ) . embedded . OTP . code . -name Name . net_kernel . epmd ( epmd(1) -start_epmd ) ( -setcookie ). Name@Host Host (FQDN) . -sname . Name undefined . . Dynamic Node Name . : -proto_dist inet_tls . . -nocookie . ~/.erlang.cookie . "undefined" erlang:set_cookie/1 erlang:set_cookie/2 . . . -no_epmd epmd . epmd erl_epmd . -proto_dist epmd . How to implement an Alternative Carrier for the Erlang Distribution . -noinput . -noshell . -noshell . . -nostick (sticky directory) code . -oldshell Erlang/OTP 3.3 . . -pa Dir1 Dir2 ... code:add_pathsa/1 . . -pa ERL_LIBS code . -pz Dir1 Dir2 ... code:add_pathsz/1 code . -path Dir1 Dir2 ... script(4) . -proto_dist Proto : inet_tcp TCP IPv4 ( ) inet_tls TLS/SSL Using SSL for Erlang Distribution User's Guide . inet6_tcp TCP IPv6 IPv6: % erl -name test@ipv6node.example.com -proto_dist inet6_tcp -remsh Node Node . -name -sname -sname undefined . Node -name -sname . : OTP-23 -sname -name -remsh . OTP-23 . : . Erlang/OTP 25 werl . -rsh Program ssh (slave) slave . -S Mod [Func [Arg1, Arg2, ...]] (init flag) init . Func start . [Arg1,Arg2,...] . . -noshell . init . -run Mod [Func [Arg1, Arg2, ...]] (init flag) init . Func start . [Arg1,Arg2,...] . . init . -s Mod [Func [Arg1, Arg2, ...]] (init flag) init . Func start . [Arg1,Arg2,...] . . init . -setcookie Cookie Cookie erlang:set_cookie/1 . Distributed Erlang . -setcookie Node Cookie Node Cookie erlang:set_cookie/2 . -shutdown_time Time init ( ) . Time . infinity . -sname Name -name Name@Host . (DNS) . -sname -name . Name undefined . . Dynamic Node Name . : -proto_dist inet_tls . . -start_epmd true | false epmd . true epmd false . -name -sname . -start_epmd true epmd . epmd . -version (emulator flag) . erl +V . (Emulator Flags) erl ( ) . (override) . +a size () (kilowords) (async thread pool). . . . Erlang/OTP driver_async() . . +A size . . . OTP 21 Erlang/OTP I/O . . +B [c | d | i] c Ctrl-C (break handler) . d ( +B ) . i . c oldshell Ctrl-C . +c true | false : true . . false . +c false . +C no_time_warp | single_time_warp | multi_time_warp (time warp mode) : no_time_warp single_time_warp multi_time_warp ( Erlang/OTP 26.0) +d ( ) (crash dump) core dump . core dump . +d core dump . erlang:halt/1 . SIGUSR1 . +dcg DecentralizedCounterGroupsLimit . . . . . . . . (terms) ETS ordered_set write_concurrency . +e Number ETS . . +ec compressed ETS . . +fnl ISO Latin-1 . Unicode Filenames STDLIB . ( Unicode in Environment and Parameters STDLIB ). +fnu[{w|i|e}] UTF-8 ( ) . . +fnu w i e : o w error_logger . . o i . o e ( ) API . file:read_link/1 . Unicode Filenames STDLIB . ( Unicode in Environment and Parameters STDLIB ). +fna[{w|i|e}] +fnl +fnu (locale) . UTF-8 . . +fna w i e . +fnu +fnu . +fnl w i e . Unicode Filenames STDLIB . ( Unicode in Environment and Parameters STDLIB ). +hms Size (heap) Size (words) . +hmbs Size Size . +hmax Size Size . 0 . process_flag(max_heap_size, MaxHeapSize) . +hmaxel true|false . true . process_flag(max_heap_size, MaxHeapSize) . +hmaxib true|false (off-heap) . false . process_flag(max_heap_size, MaxHeapSize) . +hmaxk true|false . true . process_flag(max_heap_size, MaxHeapSize) . +hpds Size Size . +hmqd off_heap|on_heap message_queue_data . on_heap . +hmqd on_heap . process_flag(message_queue_data, MQD) . +IOp PollSets / (IO pollsets) I/O . pollset pollset I/O . . +IOt PollThreads / (IO poll threads) I/O . . . I/O (microstate accounting) I/O . . +IOPp PollSetsPercentage +IOp I/O . +IOPp +IOp +IOPp . +IOPt PollThreadsPercentage +IOt I/O . +IOPt +IOt +IOPt . +IOs true|false . true . pollset . CPU . o +JPcover true|false|function|function_counters|line|line_counters (coverage) JIT . false . function . code:get_coverage(function, Module) . function_counters . code:get_coverage(function, Module) . line line_coverage . code:get_coverage(line, Module) code:get_coverage(function, Module) . line_counters line_coverage . code:get_coverage(line, Module) code:get_coverage(function, Module) ( ). true line_counters . false . : OTP 27.0 +JPperf true|false|dump|map|fp|no_fp perf JIT . false . : dump perf perf annotate . map perf . perf . fp map . no_fp map . true map dump . false . perf perf BeamAsm . +JPperfdirectory dump map perf JIT . /tmp . +JMsingle true|false RWX JIT . JIT . QEMU . +JPperf . : OTP 26.0 +L . . +MFlag Value . erts_alloc(3) . +pad true|false +pad async_dist . +pad async_dist false . erlang:system_info(async_dist) . : OTP 25.3 +pc Range () . io:format ( ~tp ) . Range : latin1 . ISO Latin-1 . . unicode . . io:printable_range/0 STDLIB . +P Number Number . Number [1024-134217727] . : Number . ( ) . . erlang:system_info(process_limit) . 1048576 . +Q Number Number . Number [1024-134217727] . : Number . ( ) . . erlang:system_info(port_limit) . 65536 . 65536 . 8196 . +r ETS . +rg ReaderGroupsLimit / . . . . . . / . . +S Schedulers:SchedulerOnline . . Schedulers SchedulersOnline . CPU (CPU quota) SchedulersOnline . :SchedulerOnline Schedulers . erlang:system_flag(schedulers_online, SchedulersOnline) . Schedulers SchedulersOnline . 0 Schedulers SchedulersOnline . +SP SchedulersPercentage:SchedulersOnlinePercentage +S . > 0 . +SP 50:25 . :SchedulersOnlinePercentage SchedulersPercentage . erlang:system_flag(schedulers_online, SchedulersOnline) . +S . +S 4:4 +SP 50:25 ( ) ( ) ( ) . +SDcpu DirtyCPUSchedulers:DirtyCPUSchedulersOnline CPU CPU . : o CPU . o CPU . +S +SP . CPU CPU . :DirtyCPUSchedulersOnline DirtyCPUSchedulers . CPU erlang:system_flag(dirty_cpu_schedulers_online, DirtyCPUSchedulersOnline) . CPU . CPU CPU (starvation) . CPU (garbage collection) / json NIF . msacc CPU . +SDPcpu DirtyCPUSchedulersPercentage:DirtyCPUSchedulersOnlinePercentage +SDcpu CPU CPU . > 0 . +SDPcpu 50:25 CPU CPU . :DirtyCPUSchedulersOnlinePercentage DirtyCPUSchedulersPercentage . CPU erlang:system_flag(dirty_cpu_schedulers_online, DirtyCPUSchedulersOnline) . +SDcpu . +SDcpu 4:4 +SDPcpu 50:25 ( ) CPU ( ) CPU ( ) . +SDio DirtyIOSchedulers I/O . . I/O . IO CPU / (I/O bound) I/O . CPU I/O . IO . msacc IO . +sFlag Value . +sbt BindType () . +stbt . : o . o CPU CPU CPU . +sbt . +stbt . BindType: u unbound - . . ns no_spread - . ts thread_spread - ( Hyper-Threading ). . ps processor_spread - thread_spread . s spread - . nnts no_node_thread_spread - thread_spread NUMA NUMA NUMA . nnps no_node_processor_spread - processor_spread NUMA NUMA . tnnps thread_no_node_processor_spread - thread_spread no_node_processor_spread . NUMA NUMA . db default_bind - . thread_no_node_processor_spread ( ). FreeBSD . +sbt CPU BindType u . CPU +sct . CPU +sct +sbt . . : . ( ) . . . . . . : . error_logger . erlang:system_info(scheduler_bindings) . +sbwt none|very_short|short|medium|long|very_long (busy wait) . medium . . : . +sbwtdcpu none|very_short|short|medium|long|very_long +sbwt CPU . short . : . +sbwtdio none|very_short|short|medium|long|very_long +sbwt IO . short . : . +scl true|false . . ( ). ( ) . . +scl false +sub true +sub true . +sct CpuTopology CPU . CPU . CPU . +sbt . = integer(); when 0 =< =< 65535 = - = | = , | = L = T | t = C | c = P | p = N | n = | CpuTopology = : | . . CPU . . t0 c0 p0 . NUMA NUMA . . NUMA . . . CPU . : o NUMA . o NUMA NUMA . CPU NUMA NUMA . NUMA . : o . o . o . . : % erl +sct L0-3c0-3 1> erlang:system_info(cpu_topology). [{processor,[{core,{logical,0}}, {core,{logical,1}}, {core,{logical,2}}, {core,{logical,3}}]}] NUMA . : % erl +sct L0-1,3-2c0-3p0N0:L7,4,6-5c0-3p1N1 1> erlang:system_info(cpu_topology). [{node,[{processor,[{core,{logical,0}}, {core,{logical,1}}, {core,{logical,3}}, {core,{logical,2}}]}]}, {node,[{processor,[{core,{logical,7}}, {core,{logical,4}}, {core,{logical,6}}, {core,{logical,5}}]}]}] CPU . . CPU CPU . : % erl +sct L0-3c0-3 +sbt db +S3:2 -detached -noinput -noshell -sname one % erl +sct L3-0c0-3 +sbt db +S3:2 -detached -noinput -noshell -sname two . . CPU . erlang:system_info(cpu_topology) . +ssrct CPU . : CPU ERTS . +sfwi Interval . Interval . . Interval 0 . : (native code) OTP (reductions) . . +spp Bool . true . false . false . erlang:system_info(port_parallelism) . parallelism erlang:open_port/2 . +sss size . . . +sssdcpu size CPU. . . +sssdio size IO. . . +stbt BindType . +sbt . +sbt . +sub true|false . ( ). . +sub true . . +sub true +scl false . +sub true +scl false +scl false . +swct very_eager|eager|medium|lazy|very_lazy . medium . . (lazy) . (eager) CPU . : . +sws default|legacy . ERTS 5.10 (Erlang/OTP R16A) . Erlang/OTP R15 proposal . legacy R13 R15 . : . +swt very_low|low|medium|high|very_high . medium . . . . : . +swtdcpu very_low|low|medium|high|very_high +swt CPU . medium . : . +swtdio very_low|low|medium|high|very_high +swt IO . medium . : . +t size . ,, . +T Level (modified timing) . . . . . : (Process spawning) spawn spawn_link spawn_monitor spawn_opt . . (Context reductions) (reductions) . (Input reductions) I/O . : . . return_to return_from BIF spawn . . +v (Verbose logging). . : +vs DEBUG_SYSTEM +v +vg DEBUG_PRIVATE_GC +vM DEBUG_MEMORY +va DEBUG_ALLOCATION +vt DEBUG_THREADS +vp DEBUG_PROCESSES +vm DEBUG_MESSAGES +vc DEBUG_SHCOPY erts . +V . +W w | i | e error_logger . (+W e) (+W w) (+W i) . . error_logger:warning_map/0 . error_logger:warning_map/0 Kernel . +zFlag Value : +zdbbl size ( dist_buf_busy_limit) . . . . . . . (fully asynchronous distributed signaling) . +zdntgc time ( delayed_node_table_gc) . infinity . . . . +zosrl limit . [1, 134217727] . erlang:system_flag(outstanding_system_requests_limit, Limit) . +zhft limit (flush) . 0..2147483647 infinity . infinity . 255 . . erlang:system_info(halt_flush_timeout) . flush_timeout BIF erlang:halt/2 . flush_timeout . : OTP 27.0 (Environment Variables) ERL_CRASH_DUMP (crash dump) . erl_crash.dump . ERL_CRASH_DUMP_NICE : nice . ( ). . ERL_CRASH_DUMP_SECONDS : . . ERL_CRASH_DUMP_SECONDS=0 0 . -heart erl ERL_CRASH_DUMP_SECONDS . ERL_CRASH_DUMP_SECONDS=S S S SIGALRM . ERL_CRASH_DUMP_SECONDS=-1 . -heart erl ERL_CRASH_DUMP_SECONDS . heart . ERL_CRASH_DUMP_BYTES . (truncate) . . 0 . ERTS 8.1.2 (Erlang/OTP 19.2). ERL_CRASH_DUMP_PUBLIC_KEY ( x509 ".pem" ) . . . crashdump . RSA ML-KEM OpenSSL . ERTS 16.3 (Erlang/OTP 29). ERL_AFLAGS erl . -extra . . -extra -extra -extra . ERL_ZFLAGS and ERL_FLAGS erl . -extra . . -extra -extra -extra . ERL_LIBS code . ERL_EPMD_ADDRESS IP epmd () ( ) . ERL_EPMD_PORT epmd . . . epmd . (Signals) . SIGUSR1 SIGUSR1 . SIGTERM SIGTERM stop init . init:stop/0 . ERTS 8.3 (Erlang/OTP 19.3) SIGUSR2 . . (Configuration) Erlang/OTP . .erlang Erlang/OTP .erlang filename:basedir(user_config, "erlang") . .erlang . . .erlang : io:format("executing user profile in $HOME/.erlang\n",[]). code:add_path("/home/calvin/test/ebin"). code:add_path("/home/hobbes/bigappl-1.2/ebin"). io:format(".erlang rc finished\n",[]). o user_default shell_default - (funs) (BIFs) user_default shell_default . user_default .erlang : code:load_abs("..../user_default"). erl .erlang user_default Erlang/OTP . erl . init . (See Also) epmd(1), erl_prim_loader, erts_alloc(3), init, application, auth, code, erl_boot_server, heart, net_kernel, make Ericsson AB erts 17.0.6 erl(1)