linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libtracefs: Use getpid instead of gettid
@ 2021-11-18 16:57 Tzvetomir Stoyanov (VMware)
  2021-11-21 21:25 ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2021-11-18 16:57 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel, amikhak

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] libtracefs: Use getpid instead of gettid
  2021-11-18 16:57 [PATCH] libtracefs: Use getpid instead of gettid Tzvetomir Stoyanov (VMware)
@ 2021-11-21 21:25 ` Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2021-11-21 21:25 UTC (permalink / raw)
  To: Tzvetomir Stoyanov (VMware); +Cc: linux-trace-devel, amikhak

On Thu, 18 Nov 2021 18:57:27 +0200
"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com> wrote:

> 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>
> ---

I guess I hit this earlier but never applied my fix :-/

https://patchwork.kernel.org/project/linux-trace-devel/patch/20210825195300.0f15d98a@rorschach.local.home/

-- Steve

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-21 21:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-18 16:57 [PATCH] libtracefs: Use getpid instead of gettid Tzvetomir Stoyanov (VMware)
2021-11-21 21:25 ` Steven Rostedt

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).