From: Hal Rosenstock <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
To: "linux-rdma
(linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)"
<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: Tomer Cohen <tomerco-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: [PATCH opensm] osm_log.c: Fix wrong hour and date display in log when CL_ASSERT fail
Date: Wed, 30 Apr 2014 10:35:39 -0400 [thread overview]
Message-ID: <53610A3B.1040109@dev.mellanox.co.il> (raw)
From: Tomer Cohen <tomerco-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
using gettimeofday function instead of cl_get_time_stamp
Signed-off-by: Tomer Cohen <tomerco-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
opensm/osm_log.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/opensm/osm_log.c b/opensm/osm_log.c
index 3460cc5..29e80e4 100644
--- a/opensm/osm_log.c
+++ b/opensm/osm_log.c
@@ -230,6 +230,7 @@ void osm_log_v2(IN osm_log_t * p_log, IN osm_log_level_t verbosity,
SYSTEMTIME st;
uint32_t pid = GetCurrentThreadId();
#else
+ struct timeval tv;
pid_t pid = 0;
time_t tim;
struct tm result;
@@ -294,7 +295,9 @@ _retry:
st.wHour, st.wMinute, st.wSecond, st.wMilliseconds,
pid, verbosity, buffer);
#else
- time_usecs = cl_get_time_stamp();
+ gettimeofday(&tv, NULL);
+ /* Convert the time of day into a microsecond timestamp */
+ time_usecs = ((uint64_t) tv.tv_sec * 1000000) + (uint64_t) tv.tv_usec;
tim = time_usecs / 1000000;
usecs = time_usecs % 1000000;
localtime_r(&tim, &result);
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
reply other threads:[~2014-04-30 14:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=53610A3B.1040109@dev.mellanox.co.il \
--to=hal-ldsdmyg8hgv8yrgs2mwiifqbs+8scbdb@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=tomerco-VPRAkNaXOzVWk0Htik3J/w@public.gmane.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