@@ -133,7 +133,7 @@ struct hook_list *tracecmd_create_event_hook(const char *arg)
hook->stack = 1;
break;
default:
- tracecmd_warning("unknown flag %c\n", flags[i]);
+ tracecmd_warning("unknown flag %c", flags[i]);
}
}
}
@@ -1532,7 +1532,7 @@ static void __free_page(struct tracecmd_input *handle, struct page *page)
int index;
if (!page->ref_count) {
- tracecmd_critical("Page ref count is zero!\n");
+ tracecmd_critical("Page ref count is zero!");
return;
}
@@ -4168,7 +4168,7 @@ struct tracecmd_input *tracecmd_alloc_fd(int fd, int flags)
version = read_string(handle);
if (!version)
goto failed_read;
- tracecmd_info("version = %s\n", version);
+ tracecmd_info("version = %s", version);
ver = strtol(version, NULL, 10);
if (!ver && errno)
goto failed_read;
@@ -4396,7 +4396,7 @@ void tracecmd_close(struct tracecmd_input *handle)
return;
if (handle->ref <= 0) {
- tracecmd_warning("tracecmd: bad ref count on handle\n");
+ tracecmd_warning("tracecmd: bad ref count on handle");
return;
}
@@ -5493,7 +5493,7 @@ tracecmd_buffer_instance_handle(struct tracecmd_input *handle, int indx)
ret = lseek64(handle->fd, buffer->offset, SEEK_SET);
if (ret == (off64_t)-1) {
- tracecmd_warning("could not seek to buffer %s offset %ld\n",
+ tracecmd_warning("could not seek to buffer %s offset %ld",
buffer->name, buffer->offset);
goto error;
}
@@ -5507,12 +5507,12 @@ tracecmd_buffer_instance_handle(struct tracecmd_input *handle, int indx)
ret = read_cpu_data(new_handle);
if (ret < 0) {
- tracecmd_warning("failed to read sub buffer %s\n", buffer->name);
+ tracecmd_warning("failed to read sub buffer %s", buffer->name);
goto error;
}
ret = lseek64(handle->fd, offset, SEEK_SET);
if (ret < 0) {
- tracecmd_warning("could not seek to back to offset %ld\n", offset);
+ tracecmd_warning("could not seek to back to offset %ld", offset);
goto error;
}
} else {
@@ -430,7 +430,7 @@ void tracecmd_msg_set_done(struct tracecmd_msg_handle *msg_handle)
static void error_operation(struct tracecmd_msg *msg)
{
- tracecmd_warning("Message: cmd=%d size=%d\n", ntohl(msg->hdr.cmd), ntohl(msg->hdr.size));
+ tracecmd_warning("Message: cmd=%d size=%d", ntohl(msg->hdr.cmd), ntohl(msg->hdr.size));
}
/*
@@ -460,7 +460,7 @@ static int tracecmd_msg_wait_for_msg(int fd, struct tracecmd_msg *msg)
ret = tracecmd_msg_recv_wait(fd, msg);
if (ret < 0) {
if (ret == -ETIMEDOUT)
- tracecmd_warning("Connection timed out\n");
+ tracecmd_warning("Connection timed out");
return ret;
}
@@ -651,7 +651,7 @@ int tracecmd_msg_initial_setting(struct tracecmd_msg_handle *msg_handle)
ret = tracecmd_msg_recv_wait(msg_handle->fd, &msg);
if (ret < 0) {
if (ret == -ETIMEDOUT)
- tracecmd_warning("Connection timed out\n");
+ tracecmd_warning("Connection timed out");
return ret;
}
@@ -2277,7 +2277,7 @@ static int update_buffer_cpu_offset_v6(struct tracecmd_output *handle,
b_offset = get_buffer_file_offset(handle, name);
if (!b_offset) {
- tracecmd_warning("Cannot find description for buffer %s\n", name);
+ tracecmd_warning("Cannot find description for buffer %s", name);
return -1;
}
@@ -2285,7 +2285,7 @@ static int update_buffer_cpu_offset_v6(struct tracecmd_output *handle,
/* Go to the option data, where will write the offest */
if (do_lseek(handle, b_offset, SEEK_SET) == (off64_t)-1) {
- tracecmd_warning("could not seek to %lld\n", b_offset);
+ tracecmd_warning("could not seek to %lld", b_offset);
return -1;
}
@@ -2294,7 +2294,7 @@ static int update_buffer_cpu_offset_v6(struct tracecmd_output *handle,
/* Go back to end of file */
if (do_lseek(handle, current, SEEK_SET) == (off64_t)-1) {
- tracecmd_warning("could not seek to %lld\n", offset);
+ tracecmd_warning("could not seek to %lld", offset);
return -1;
}
return 0;
@@ -108,13 +108,13 @@ load_plugin(struct trace_plugin_context *trace, const char *path,
ret = asprintf(&plugin, "%s/%s", path, file);
if (ret < 0) {
- tracecmd_warning("could not allocate plugin memory\n");
+ tracecmd_warning("could not allocate plugin memory");
return;
}
handle = dlopen(plugin, RTLD_NOW | RTLD_GLOBAL);
if (!handle) {
- tracecmd_warning("could not load plugin '%s'\n%s\n", plugin, dlerror());
+ tracecmd_warning("could not load plugin '%s'\n%s", plugin, dlerror());
goto out_free;
}
@@ -124,14 +124,14 @@ load_plugin(struct trace_plugin_context *trace, const char *path,
func = dlsym(handle, TRACECMD_PLUGIN_LOADER_NAME);
if (!func) {
- tracecmd_warning("could not find func '%s' in plugin '%s'\n%s\n",
+ tracecmd_warning("could not find func '%s' in plugin '%s'\n%s",
TRACECMD_PLUGIN_LOADER_NAME, plugin, dlerror());
goto out_free;
}
list = malloc(sizeof(*list));
if (!list) {
- tracecmd_warning("could not allocate plugin memory\n");
+ tracecmd_warning("could not allocate plugin memory");
goto out_free;
}
@@ -256,7 +256,7 @@ load_plugins_hook(struct trace_plugin_context *trace, const char *suffix,
ret = asprintf(&path, "%s/%s", home, LOCAL_PLUGIN_DIR);
if (ret < 0) {
- tracecmd_warning("could not allocate plugin memory\n");
+ tracecmd_warning("could not allocate plugin memory");
return;
}
@@ -30,7 +30,7 @@
#define PROC_STACK_FILE "/proc/sys/kernel/stack_tracer_enabled"
static bool debug;
-static int log_level = TEP_LOG_CRITICAL;
+static int log_level = TEP_LOG_INFO;
static FILE *logfp;
const static struct {