linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org, amikhak@wirelessfabric.com
Subject: [PATCH] libtracefs: Use getpid instead of gettid
Date: Thu, 18 Nov 2021 18:57:27 +0200	[thread overview]
Message-ID: <20211118165727.75994-1-tz.stoyanov@gmail.com> (raw)

The gettid() call is not available on Jetson Nano running Ubuntu
18.04 for aarch64. This function is used to compose a random seed,
replaced it with getpid().

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203871
Reported-by: Alan Mikhak <amikhak@wirelessfabric.com>
Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
 src/tracefs-hist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tracefs-hist.c b/src/tracefs-hist.c
index 005fa8f..085c10b 100644
--- a/src/tracefs-hist.c
+++ b/src/tracefs-hist.c
@@ -1121,7 +1121,7 @@ static unsigned int make_rand(void)
 	unsigned long seed;
 
 	gettimeofday(&tv, NULL);
-	seed = (tv.tv_sec + tv.tv_usec) + gettid();
+	seed = (tv.tv_sec + tv.tv_usec) + getpid();
 
 	/* taken from the rand(3) man page */
 	seed = seed * 1103515245 + 12345;
-- 
2.33.1


             reply	other threads:[~2021-11-18 16:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-18 16:57 Tzvetomir Stoyanov (VMware) [this message]
2021-11-21 21:25 ` [PATCH] libtracefs: Use getpid instead of gettid Steven Rostedt

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=20211118165727.75994-1-tz.stoyanov@gmail.com \
    --to=tz.stoyanov@gmail.com \
    --cc=amikhak@wirelessfabric.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).