From 33b9e9147818bfca6a54a406d38b319cf339e9a9 Mon Sep 17 00:00:00 2001 From: Bolehu Date: Fri, 6 Jan 2023 10:21:45 +0800 Subject: [PATCH] Remove unneeded multiply in events timestamp reading Signed-off-by: Bolehu --- ...-unneeded-multiply-in-events-timesta.patch | 38 +++++++++++++++++++ trace-cmd.spec | 6 ++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 backport-Remove-unneeded-multiply-in-events-timesta.patch diff --git a/backport-Remove-unneeded-multiply-in-events-timesta.patch b/backport-Remove-unneeded-multiply-in-events-timesta.patch new file mode 100644 index 0000000..017e992 --- /dev/null +++ b/backport-Remove-unneeded-multiply-in-events-timesta.patch @@ -0,0 +1,38 @@ +From 43fa39ef1717e98ffe71ab0b53fefdfe1f02be3d Mon Sep 17 00:00:00 2001 +From: "Tzvetomir Stoyanov (VMware)" +Date: Thu, 25 Mar 2021 08:40:44 +0200 +Subject: [PATCH] trace-cmd: Remove unneeded multiply in events timestamp + reading + +When the event timestamp is converted to seconds, the local variable +that holds this timestamp is converted to seconds also. As this +variable is not used in the function later, this conversion in not +needed. + +Link: https://lore.kernel.org/linux-trace-devel/20210325064055.539554-13-tz.stoyanov@gmail.com + +Signed-off-by: Tzvetomir Stoyanov (VMware) +Signed-off-by: Steven Rostedt (VMware) +--- + lib/trace-cmd/trace-input.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c +index c1ea07fd..c4fb9639 100644 +--- a/lib/trace-cmd/trace-input.c ++++ b/lib/trace-cmd/trace-input.c +@@ -1932,10 +1932,8 @@ read_again: + + handle->cpu_data[cpu].timestamp = timestamp_correct(ts, handle); + +- if (handle->ts2secs) { ++ if (handle->ts2secs) + handle->cpu_data[cpu].timestamp *= handle->ts2secs; +- ts *= handle->ts2secs; +- } + + index = kbuffer_curr_offset(kbuf); + +-- +2.33.0 + diff --git a/trace-cmd.spec b/trace-cmd.spec index 8ad71d1..dfebc94 100644 --- a/trace-cmd.spec +++ b/trace-cmd.spec @@ -1,6 +1,6 @@ Name: trace-cmd Version: 2.9.2 -Release: 6 +Release: 7 Summary: A front-end for Ftrace License: GPLv2 and LGPLv2 URL: http://git.kernel.org/?p=linux/kernel/git/rostedt/trace-cmd.git;a=summary @@ -10,6 +10,7 @@ Source1: kernelshark.desktop Patch0001: backport-trace-cmd-report-Fix-typos-in-error-messages.patch Patch0002: backport-trace-cmd-library-Fix-version-string-memory-leak.patch Patch0003: backport-trace-cmd-library-Fixed-a-memory-leak-on-input-handl.patch +Patch0004: backport-Remove-unneeded-multiply-in-events-timesta.patch BuildRequires: gcc xmlto asciidoc mlocate libxml2-devel chrpath BuildRequires: gtk2-devel glib2-devel desktop-file-utils libtraceevent-devel @@ -69,6 +70,9 @@ echo "%{_bindir}/%{name}" > $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name}-%{_arch}.co %{_mandir}/man5/* %changelog +* Sat Jan 07 2023 Bolehu - 2.9.2-7 +- Remove unneeded multiply in events timestamp reading + * Fri Jan 06 2023 Bolehu - 2.9.2-6 - trace-cmd library: Fixed a memory leak on input handler close -- Gitee