diff options
author | Tony Lindgren <tony@atomide.com> | 2019-08-13 13:40:10 +0300 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2019-08-13 13:40:10 +0300 |
commit | 58e16d792a6a8c6b750f637a4649967fcac853dc (patch) | |
tree | 778a940499ecfc6fb2d811dbfef735913d30618a /tools/perf/util/data-convert-bt.c | |
parent | fa8397e45c64e60c80373bc19ee56e42a6bed9b6 (diff) | |
parent | a304f483b6b00d42bde41c45ca52c670945348e2 (diff) | |
download | linux-58e16d792a6a8c6b750f637a4649967fcac853dc.tar.xz |
Merge branch 'ti-sysc-fixes' into fixes
Diffstat (limited to 'tools/perf/util/data-convert-bt.c')
-rw-r--r-- | tools/perf/util/data-convert-bt.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c index e0311c9750ad..ddbcd59f2d9b 100644 --- a/tools/perf/util/data-convert-bt.c +++ b/tools/perf/util/data-convert-bt.c @@ -1,16 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * CTF writing support via babeltrace. * * Copyright (C) 2014, Jiri Olsa <jolsa@redhat.com> * Copyright (C) 2014, Sebastian Andrzej Siewior <bigeasy@linutronix.de> - * - * Released under the GPL v2. (and only v2, not any later version) */ #include <errno.h> #include <inttypes.h> #include <linux/compiler.h> #include <linux/kernel.h> +#include <linux/zalloc.h> #include <babeltrace/ctf-writer/writer.h> #include <babeltrace/ctf-writer/clock.h> #include <babeltrace/ctf-writer/stream.h> @@ -23,14 +23,13 @@ #include "asm/bug.h" #include "data-convert-bt.h" #include "session.h" -#include "util.h" #include "debug.h" #include "tool.h" #include "evlist.h" #include "evsel.h" #include "machine.h" #include "config.h" -#include "sane_ctype.h" +#include <linux/ctype.h> #define pr_N(n, fmt, ...) \ eprintf(n, debug_data_convert, fmt, ##__VA_ARGS__) @@ -271,7 +270,7 @@ static int string_set_value(struct bt_ctf_field *field, const char *string) if (i > 0) strncpy(buffer, string, i); } - strncat(buffer + p, numstr, 4); + memcpy(buffer + p, numstr, 4); p += 3; } } @@ -1354,7 +1353,7 @@ static void free_streams(struct ctf_writer *cw) for (cpu = 0; cpu < cw->stream_cnt; cpu++) ctf_stream__delete(cw->stream[cpu]); - free(cw->stream); + zfree(&cw->stream); } static int ctf_writer__setup_env(struct ctf_writer *cw, |