aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2016-05-13 16:48:10 +0200
committerBjörn-Egil Dahlberg <[email protected]>2016-05-13 16:48:10 +0200
commit4fba4b14c4f9aa03294d8d187fe0dd1202744e82 (patch)
treebfcdef0c8ab9e14c1bf149c0a0f0d6b9c8ce39d3 /lib
parent66da26c92043c71740ea628469ad6ada747b89bf (diff)
parent88095fc0adb871671ff9763bd5868d7c0c0ac350 (diff)
downloadotp-4fba4b14c4f9aa03294d8d187fe0dd1202744e82.tar.gz
otp-4fba4b14c4f9aa03294d8d187fe0dd1202744e82.tar.bz2
otp-4fba4b14c4f9aa03294d8d187fe0dd1202744e82.zip
Merge branch 'egil/erts/nif-format_term/OTP-13580'
* egil/erts/nif-format_term/OTP-13580: runtime_tools: Change erts_snprintf to enif_snprintf erts: Document enif_snprintf erts: Add tests for enif_snprintf erts: Add enif_snprintf Conflicts: erts/emulator/beam/erl_nif_api_funcs.h
Diffstat (limited to 'lib')
-rw-r--r--lib/runtime_tools/c_src/dyntrace.c20
-rw-r--r--lib/runtime_tools/c_src/dyntrace_lttng.h6
2 files changed, 13 insertions, 13 deletions
diff --git a/lib/runtime_tools/c_src/dyntrace.c b/lib/runtime_tools/c_src/dyntrace.c
index 0178d95efb..e7a4a73373 100644
--- a/lib/runtime_tools/c_src/dyntrace.c
+++ b/lib/runtime_tools/c_src/dyntrace.c
@@ -433,7 +433,7 @@ static ERL_NIF_TERM trace_call(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv
char class[LTTNG_BUFFER_SZ];
enif_get_tuple(env, argv[4], &arity, &tuple);
- erts_snprintf(class, LTTNG_BUFFER_SZ, "%T", tuple[0]);
+ enif_snprintf(class, LTTNG_BUFFER_SZ, "%T", tuple[0]);
if (enif_get_tuple(env, argv[3], &arity, &tuple)) {
enif_get_uint(env, tuple[2], &len);
@@ -465,7 +465,7 @@ static ERL_NIF_TERM trace_send(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv
char msg[LTTNG_BUFFER_SZ];
lttng_pid_to_str(argv[4], to);
- erts_snprintf(msg, LTTNG_BUFFER_SZ, "%T", argv[3]);
+ enif_snprintf(msg, LTTNG_BUFFER_SZ, "%T", argv[3]);
LTTNG3(message_send, pid, to, msg);
} else if (argv[0] == atom_send_to_non_existing_process) {
@@ -473,7 +473,7 @@ static ERL_NIF_TERM trace_send(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv
char msg[LTTNG_BUFFER_SZ];
lttng_pid_to_str(argv[4], to);
- erts_snprintf(msg, LTTNG_BUFFER_SZ, "%T", argv[3]);
+ enif_snprintf(msg, LTTNG_BUFFER_SZ, "%T", argv[3]);
/* mark it as non existing ? */
LTTNG3(message_send, pid, to, msg);
@@ -496,7 +496,7 @@ static ERL_NIF_TERM trace_receive(ErlNifEnv* env, int argc, const ERL_NIF_TERM a
char msg[LTTNG_BUFFER_SZ];
lttng_pid_to_str(argv[2], pid);
- erts_snprintf(msg, LTTNG_BUFFER_SZ, "%T", argv[3]);
+ enif_snprintf(msg, LTTNG_BUFFER_SZ, "%T", argv[3]);
LTTNG2(message_receive, pid, msg);
}
@@ -560,11 +560,11 @@ static ERL_NIF_TERM trace_procs(ErlNifEnv* env, int argc, const ERL_NIF_TERM arg
/* register */
} else if (argv[0] == atom_register) {
char name[LTTNG_BUFFER_SZ];
- erts_snprintf(name, LTTNG_BUFFER_SZ, "%T", argv[3]);
+ enif_snprintf(name, LTTNG_BUFFER_SZ, "%T", argv[3]);
LTTNG3(process_register, pid, name, "register");
} else if (argv[0] == atom_unregister) {
char name[LTTNG_BUFFER_SZ];
- erts_snprintf(name, LTTNG_BUFFER_SZ, "%T", argv[3]);
+ enif_snprintf(name, LTTNG_BUFFER_SZ, "%T", argv[3]);
LTTNG3(process_register, pid, name, "unregister");
/* link */
} else if (argv[0] == atom_link) {
@@ -582,7 +582,7 @@ static ERL_NIF_TERM trace_procs(ErlNifEnv* env, int argc, const ERL_NIF_TERM arg
/* exit */
} else if (argv[0] == atom_exit) {
char reason[LTTNG_BUFFER_SZ];
- erts_snprintf(reason, LTTNG_BUFFER_SZ, "%T", argv[3]);
+ enif_snprintf(reason, LTTNG_BUFFER_SZ, "%T", argv[3]);
LTTNG2(process_exit, pid, reason);
}
return atom_ok;
@@ -622,11 +622,11 @@ static ERL_NIF_TERM trace_ports(ErlNifEnv* env, int argc, const ERL_NIF_TERM arg
lttng_decl_procbuf(pid);
lttng_pid_to_str(argv[3], pid);
- erts_snprintf(driver, LTTNG_BUFFER_SZ, "%T", argv[4]);
+ enif_snprintf(driver, LTTNG_BUFFER_SZ, "%T", argv[4]);
LTTNG3(port_open, pid, driver, port);
} else if (argv[0] == atom_closed) {
char reason[LTTNG_BUFFER_SZ];
- erts_snprintf(reason, LTTNG_BUFFER_SZ, "%T", argv[3]);
+ enif_snprintf(reason, LTTNG_BUFFER_SZ, "%T", argv[3]);
LTTNG2(port_exit, port, reason);
/* link */
@@ -705,7 +705,7 @@ static ERL_NIF_TERM trace_running_ports(ErlNifEnv* env, int argc, const ERL_NIF_
lttng_decl_mfabuf(where);
lttng_portid_to_str(argv[2], pid);
- erts_snprintf(where, LTTNG_BUFFER_SZ, "%T", argv[3]);
+ enif_snprintf(where, LTTNG_BUFFER_SZ, "%T", argv[3]);
/* running ports */
if (argv[0] == atom_in) {
diff --git a/lib/runtime_tools/c_src/dyntrace_lttng.h b/lib/runtime_tools/c_src/dyntrace_lttng.h
index 3550a1cab5..2a3224e191 100644
--- a/lib/runtime_tools/c_src/dyntrace_lttng.h
+++ b/lib/runtime_tools/c_src/dyntrace_lttng.h
@@ -59,10 +59,10 @@
char Name[LTTNG_MFA_BUFFER_SZ]
#define lttng_pid_to_str(pid, name) \
- erts_snprintf(name, LTTNG_PROC_BUFFER_SZ, "%T", (pid))
+ enif_snprintf(name, LTTNG_PROC_BUFFER_SZ, "%T", (pid))
#define lttng_portid_to_str(pid, name) \
- erts_snprintf(name, LTTNG_PORT_BUFFER_SZ, "%T", (pid))
+ enif_snprintf(name, LTTNG_PORT_BUFFER_SZ, "%T", (pid))
#define lttng_proc_to_str(p, name) \
lttng_pid_to_str(((p) ? (p)->common.id : ERTS_INVALID_PID), name)
@@ -71,7 +71,7 @@
lttng_portid_to_str(((p) ? (p)->common.id : ERTS_INVALID_PORT), name)
#define lttng_mfa_to_str(m,f,a, Name) \
- erts_snprintf(Name, LTTNG_MFA_BUFFER_SZ, "%T:%T/%lu", (Eterm)(m), (Eterm)(f), (Uint)(a))
+ enif_snprintf(Name, LTTNG_MFA_BUFFER_SZ, "%T:%T/%lu", (Eterm)(m), (Eterm)(f), (Uint)(a))
/* Process scheduling */