diff mbox series

trace-cmd: Fix regression of not reading older data files

Message ID 20220221213314.18516bf0@yoga.local.home (mailing list archive)
State Accepted
Commit 3b51ee966b4f682a3d9c457282051b2c037ec33e
Headers show
Series trace-cmd: Fix regression of not reading older data files | expand

Commit Message

Steven Rostedt Feb. 22, 2022, 2:33 a.m. UTC
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

I have some old trace.dat files that for some reason have the version
missing from its file, causing it to flag a "version 0". Because there's
now a check for reading a minimum version, it fails to read these files
when it use to read them just fine. If there's no version number in the
file or the minimum is below what it thinks it is, then just read it.

Fixes: 6482f99a47ac ("trace-cmd library: Define trace file version 7")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 lib/trace-cmd/trace-util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/trace-cmd/trace-util.c b/lib/trace-cmd/trace-util.c
index f5c77e9154c1..2cf8974ef4ee 100644
--- a/lib/trace-cmd/trace-util.c
+++ b/lib/trace-cmd/trace-util.c
@@ -630,7 +630,7 @@  int tracecmd_default_file_version(void)
 
 bool tracecmd_is_version_supported(unsigned int version)
 {
-	if (version >= FILE_VERSION_MIN && version <= FILE_VERSION_MAX)
+	if (version <= FILE_VERSION_MAX)
 		return true;
 	return false;
 }