[PATCH] libtracefs: Use getpid instead of gettid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@xxxxxxxxx>
---
 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




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux