From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org
Subject: [PATCH 2/5] trace-cmd library: Remove useless check before applying ts offset
Date: Wed, 28 Apr 2021 15:28:36 +0300 [thread overview]
Message-ID: <20210428122839.805296-3-tz.stoyanov@gmail.com> (raw)
In-Reply-To: <20210428122839.805296-1-tz.stoyanov@gmail.com>
Checking if offset is non-zero before adding to the timestamp is useless,
as adding 0 will not change the timestamp.
Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
lib/trace-cmd/trace-input.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
index e8a257db..bacf9ccf 100644
--- a/lib/trace-cmd/trace-input.c
+++ b/lib/trace-cmd/trace-input.c
@@ -1323,8 +1323,7 @@ static unsigned long long timestamp_calc(unsigned long long ts, int cpu,
}
/* User specified time offset with --ts-offset or --date options */
- if (handle->ts_offset)
- ts += handle->ts_offset;
+ ts += handle->ts_offset;
return ts;
}
--
2.30.2
next prev parent reply other threads:[~2021-04-28 12:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-28 12:28 RFC [PATCH 0/5] tsc2nsec fixes Tzvetomir Stoyanov (VMware)
2021-04-28 12:28 ` [PATCH 1/5] trace-cmd: Remove ts offset from tsc2nsec conversion Tzvetomir Stoyanov (VMware)
2021-04-28 12:28 ` Tzvetomir Stoyanov (VMware) [this message]
2021-04-28 12:28 ` [PATCH 3/5] trace-cmd library: Store the timestamp of the first event when reading a trace file Tzvetomir Stoyanov (VMware)
2021-04-28 12:28 ` [PATCH 4/5] trace-cmd library: New API for modifyning the timestamp offset Tzvetomir Stoyanov (VMware)
2021-04-28 12:28 ` [PATCH 5/5] trace-cmd report: New option --align-ts Tzvetomir Stoyanov (VMware)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210428122839.805296-3-tz.stoyanov@gmail.com \
--to=tz.stoyanov@gmail.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).