diff options
-rw-r--r-- | tools/perf/builtin-data.c | 4 | ||||
-rw-r--r-- | tools/perf/util/data-convert-bt.c | 3 | ||||
-rw-r--r-- | tools/perf/util/data-convert-bt.h | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/tools/perf/builtin-data.c b/tools/perf/builtin-data.c index 709152a7b408..d6525bc54d13 100644 --- a/tools/perf/builtin-data.c +++ b/tools/perf/builtin-data.c | |||
@@ -53,12 +53,14 @@ static int cmd_data_convert(int argc, const char **argv, | |||
53 | const char *prefix __maybe_unused) | 53 | const char *prefix __maybe_unused) |
54 | { | 54 | { |
55 | const char *to_ctf = NULL; | 55 | const char *to_ctf = NULL; |
56 | bool force = false; | ||
56 | const struct option options[] = { | 57 | const struct option options[] = { |
57 | OPT_INCR('v', "verbose", &verbose, "be more verbose"), | 58 | OPT_INCR('v', "verbose", &verbose, "be more verbose"), |
58 | OPT_STRING('i', "input", &input_name, "file", "input file name"), | 59 | OPT_STRING('i', "input", &input_name, "file", "input file name"), |
59 | #ifdef HAVE_LIBBABELTRACE_SUPPORT | 60 | #ifdef HAVE_LIBBABELTRACE_SUPPORT |
60 | OPT_STRING(0, "to-ctf", &to_ctf, NULL, "Convert to CTF format"), | 61 | OPT_STRING(0, "to-ctf", &to_ctf, NULL, "Convert to CTF format"), |
61 | #endif | 62 | #endif |
63 | OPT_BOOLEAN('f', "force", &force, "don't complain, do it"), | ||
62 | OPT_END() | 64 | OPT_END() |
63 | }; | 65 | }; |
64 | 66 | ||
@@ -76,7 +78,7 @@ static int cmd_data_convert(int argc, const char **argv, | |||
76 | 78 | ||
77 | if (to_ctf) { | 79 | if (to_ctf) { |
78 | #ifdef HAVE_LIBBABELTRACE_SUPPORT | 80 | #ifdef HAVE_LIBBABELTRACE_SUPPORT |
79 | return bt_convert__perf2ctf(input_name, to_ctf); | 81 | return bt_convert__perf2ctf(input_name, to_ctf, force); |
80 | #else | 82 | #else |
81 | pr_err("The libbabeltrace support is not compiled in.\n"); | 83 | pr_err("The libbabeltrace support is not compiled in.\n"); |
82 | return -1; | 84 | return -1; |
diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c index c6d62268cc2a..dd17c9a32fbc 100644 --- a/tools/perf/util/data-convert-bt.c +++ b/tools/perf/util/data-convert-bt.c | |||
@@ -791,12 +791,13 @@ err: | |||
791 | return -1; | 791 | return -1; |
792 | } | 792 | } |
793 | 793 | ||
794 | int bt_convert__perf2ctf(const char *input, const char *path) | 794 | int bt_convert__perf2ctf(const char *input, const char *path, bool force) |
795 | { | 795 | { |
796 | struct perf_session *session; | 796 | struct perf_session *session; |
797 | struct perf_data_file file = { | 797 | struct perf_data_file file = { |
798 | .path = input, | 798 | .path = input, |
799 | .mode = PERF_DATA_MODE_READ, | 799 | .mode = PERF_DATA_MODE_READ, |
800 | .force = force, | ||
800 | }; | 801 | }; |
801 | struct convert c = { | 802 | struct convert c = { |
802 | .tool = { | 803 | .tool = { |
diff --git a/tools/perf/util/data-convert-bt.h b/tools/perf/util/data-convert-bt.h index dda30c5d0792..4c204342a9d8 100644 --- a/tools/perf/util/data-convert-bt.h +++ b/tools/perf/util/data-convert-bt.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define __DATA_CONVERT_BT_H | 2 | #define __DATA_CONVERT_BT_H |
3 | #ifdef HAVE_LIBBABELTRACE_SUPPORT | 3 | #ifdef HAVE_LIBBABELTRACE_SUPPORT |
4 | 4 | ||
5 | int bt_convert__perf2ctf(const char *input_name, const char *to_ctf); | 5 | int bt_convert__perf2ctf(const char *input_name, const char *to_ctf, bool force); |
6 | 6 | ||
7 | #endif /* HAVE_LIBBABELTRACE_SUPPORT */ | 7 | #endif /* HAVE_LIBBABELTRACE_SUPPORT */ |
8 | #endif /* __DATA_CONVERT_BT_H */ | 8 | #endif /* __DATA_CONVERT_BT_H */ |