From 9a745bc7cbb8247543e38420fb8ba74f1756942d Mon Sep 17 00:00:00 2001 From: David Goulet Date: Tue, 25 Oct 2011 15:29:50 -0400 Subject: [PATCH] API change for lttng_get_readeable_code The liblttngctl lttng_get_readeable_code call is renamed to lttng_strerror. Signed-off-by: David Goulet --- include/lttng/lttng.h | 4 ++-- liblttngctl/lttngctl.c | 2 +- ltt-sessiond/main.c | 2 +- lttng/commands/list.c | 2 +- lttng/lttng.c | 2 +- tests/lttng/kernel_all_events_basic.c | 12 ++++++------ tests/lttng/kernel_event_basic.c | 26 +++++++++++++------------- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/include/lttng/lttng.h b/include/lttng/lttng.h index 62b3ca7c8..a96c11f1d 100644 --- a/include/lttng/lttng.h +++ b/include/lttng/lttng.h @@ -208,7 +208,7 @@ struct lttng_handle { * array. * * On error, a negative value is returned being a specific lttng-tools error - * code which can be humanly interpreted with lttng_get_readable_code(err). + * code which can be humanly interpreted with lttng_strerror(err). */ /* @@ -293,7 +293,7 @@ extern int lttng_set_tracing_group(const char *name); * * Parameter MUST be a negative value or else you'll get a generic message. */ -extern const char *lttng_get_readable_code(int code); +extern const char *lttng_strerror(int code); /* * This call permits to register an "outside consumer" to a session and a lttng diff --git a/liblttngctl/lttngctl.c b/liblttngctl/lttngctl.c index 4c4cf80d3..90977f8c3 100644 --- a/liblttngctl/lttngctl.c +++ b/liblttngctl/lttngctl.c @@ -636,7 +636,7 @@ int lttng_list_tracepoints(struct lttng_handle *handle, /* * Return a human readable string of code */ -const char *lttng_get_readable_code(int code) +const char *lttng_strerror(int code) { if (code > -LTTCOMM_OK) { return "Ended with errors"; diff --git a/ltt-sessiond/main.c b/ltt-sessiond/main.c index 4da4cfbc1..167187e4d 100644 --- a/ltt-sessiond/main.c +++ b/ltt-sessiond/main.c @@ -3057,7 +3057,7 @@ static void *thread_manage_clients(void *data) DBG("Sending response (size: %d, retcode: %s)", cmd_ctx->lttng_msg_size, - lttng_get_readable_code(-cmd_ctx->llm->ret_code)); + lttng_strerror(-cmd_ctx->llm->ret_code)); ret = send_unix_sock(sock, cmd_ctx->llm, cmd_ctx->lttng_msg_size); if (ret < 0) { ERR("Failed to send data back to client"); diff --git a/lttng/commands/list.c b/lttng/commands/list.c index 6afec1876..50dad9a2b 100644 --- a/lttng/commands/list.c +++ b/lttng/commands/list.c @@ -267,7 +267,7 @@ static int list_channels(const char *channel_name) /* Listing events per channel */ ret = list_events(channels[i].name); if (ret < 0) { - MSG("%s", lttng_get_readable_code(ret)); + MSG("%s", lttng_strerror(ret)); } if (chan_found) { diff --git a/lttng/lttng.c b/lttng/lttng.c index b9c6b5a8e..e76136669 100644 --- a/lttng/lttng.c +++ b/lttng/lttng.c @@ -433,7 +433,7 @@ static int parse_args(int argc, char **argv) if (ret == -1) { usage(stderr); } else { - ERR("%s", lttng_get_readable_code(ret)); + ERR("%s", lttng_strerror(ret)); } goto error; } diff --git a/tests/lttng/kernel_all_events_basic.c b/tests/lttng/kernel_all_events_basic.c index 14a9c7f45..52546287f 100644 --- a/tests/lttng/kernel_all_events_basic.c +++ b/tests/lttng/kernel_all_events_basic.c @@ -57,28 +57,28 @@ int main(int argc, char **argv) printf("Creating tracing session (%s): ", argv[1]); if ((ret = lttng_create_session("test", argv[1])) < 0) { - printf("error creating the session : %s\n", lttng_get_readable_code(ret)); + printf("error creating the session : %s\n", lttng_strerror(ret)); goto create_fail; } PRINT_OK(); printf("Creating session handle: "); if ((handle = lttng_create_handle("test", &dom)) == NULL) { - printf("error creating handle: %s\n", lttng_get_readable_code(ret)); + printf("error creating handle: %s\n", lttng_strerror(ret)); goto handle_fail; } PRINT_OK(); printf("Enabling all kernel events: "); if ((ret = lttng_enable_event(handle, &event, channel_name)) < 0) { - printf("error enabling event: %s\n", lttng_get_readable_code(ret)); + printf("error enabling event: %s\n", lttng_strerror(ret)); goto enable_fail; } PRINT_OK(); printf("Start tracing: "); if ((ret = lttng_start_tracing(handle)) < 0) { - printf("error starting tracing: %s\n", lttng_get_readable_code(ret)); + printf("error starting tracing: %s\n", lttng_strerror(ret)); goto start_fail; } PRINT_OK(); @@ -87,14 +87,14 @@ int main(int argc, char **argv) printf("Stop tracing: "); if ((ret = lttng_stop_tracing(handle)) < 0) { - printf("error stopping tracing: %s\n", lttng_get_readable_code(ret)); + printf("error stopping tracing: %s\n", lttng_strerror(ret)); goto stop_fail; } PRINT_OK(); printf("Destroy tracing session: "); if ((ret = lttng_destroy_session(handle)) < 0) { - printf("error destroying session: %s\n", lttng_get_readable_code(ret)); + printf("error destroying session: %s\n", lttng_strerror(ret)); } PRINT_OK(); diff --git a/tests/lttng/kernel_event_basic.c b/tests/lttng/kernel_event_basic.c index 18a6eb2cc..255557148 100644 --- a/tests/lttng/kernel_event_basic.c +++ b/tests/lttng/kernel_event_basic.c @@ -76,76 +76,76 @@ int main(int argc, char **argv) printf("Creating tracing session (%s): ", argv[1]); if ((ret = lttng_create_session(session_name, argv[1])) < 0) { - printf("error creating the session : %s\n", lttng_get_readable_code(ret)); + printf("error creating the session : %s\n", lttng_strerror(ret)); goto create_fail; } PRINT_OK(); printf("Creating session handle: "); if ((handle = lttng_create_handle(session_name, &dom)) == NULL) { - printf("error creating handle: %s\n", lttng_get_readable_code(ret)); + printf("error creating handle: %s\n", lttng_strerror(ret)); goto handle_fail; } PRINT_OK(); printf("Enabling %s kernel channel: ", channel.name); if ((ret = lttng_enable_channel(handle, &channel)) < 0) { - printf("error enable channel: %s\n", lttng_get_readable_code(ret)); + printf("error enable channel: %s\n", lttng_strerror(ret)); goto enable_fail; } printf("Enabling %s kernel event: ", sched_switch.name); if ((ret = lttng_enable_event(handle, &sched_switch, channel.name)) < 0) { - printf("error enabling event: %s\n", lttng_get_readable_code(ret)); + printf("error enabling event: %s\n", lttng_strerror(ret)); goto enable_fail; } PRINT_OK(); printf("Enabling %s kernel event: ", sched_process_exit.name); if ((ret = lttng_enable_event(handle, &sched_process_exit, channel.name)) < 0) { - printf("error enabling event: %s\n", lttng_get_readable_code(ret)); + printf("error enabling event: %s\n", lttng_strerror(ret)); goto enable_fail; } PRINT_OK(); printf("Enabling %s kernel event: ", sched_process_free.name); if ((ret = lttng_enable_event(handle, &sched_process_free, channel.name)) < 0) { - printf("error enabling event: %s\n", lttng_get_readable_code(ret)); + printf("error enabling event: %s\n", lttng_strerror(ret)); goto enable_fail; } PRINT_OK(); printf("Disabling %s kernel event: ", sched_switch.name); if ((ret = lttng_disable_event(handle, sched_switch.name, channel.name)) < 0) { - printf("error enabling event: %s\n", lttng_get_readable_code(ret)); + printf("error enabling event: %s\n", lttng_strerror(ret)); goto enable_fail; } PRINT_OK(); printf("Disabling %s kernel event: ", sched_process_free.name); if ((ret = lttng_disable_event(handle, sched_process_free.name, channel.name)) < 0) { - printf("error enabling event: %s\n", lttng_get_readable_code(ret)); + printf("error enabling event: %s\n", lttng_strerror(ret)); goto enable_fail; } PRINT_OK(); printf("Renabling %s kernel event: ", sched_switch.name); if ((ret = lttng_enable_event(handle, &sched_switch, channel.name)) < 0) { - printf("error enabling event: %s\n", lttng_get_readable_code(ret)); + printf("error enabling event: %s\n", lttng_strerror(ret)); goto enable_fail; } PRINT_OK(); printf("Renabling %s kernel event: ", sched_process_free.name); if ((ret = lttng_enable_event(handle, &sched_process_free, channel.name)) < 0) { - printf("error enabling event: %s\n", lttng_get_readable_code(ret)); + printf("error enabling event: %s\n", lttng_strerror(ret)); goto enable_fail; } PRINT_OK(); printf("Start tracing: "); if ((ret = lttng_start_tracing(handle)) < 0) { - printf("error starting tracing: %s\n", lttng_get_readable_code(ret)); + printf("error starting tracing: %s\n", lttng_strerror(ret)); goto start_fail; } PRINT_OK(); @@ -154,14 +154,14 @@ int main(int argc, char **argv) printf("Stop tracing: "); if ((ret = lttng_stop_tracing(handle)) < 0) { - printf("error stopping tracing: %s\n", lttng_get_readable_code(ret)); + printf("error stopping tracing: %s\n", lttng_strerror(ret)); goto stop_fail; } PRINT_OK(); printf("Destroy tracing session: "); if ((ret = lttng_destroy_session(handle)) < 0) { - printf("error destroying session: %s\n", lttng_get_readable_code(ret)); + printf("error destroying session: %s\n", lttng_strerror(ret)); } PRINT_OK(); -- 2.34.1