libtracefs: Use getpid instead of gettid
PATCH 1/1 libtracefs: Use getpid instead of gettid
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 <[email protected]>
Signed-off-by Tzvetomir Stoyanov (VMware) <[email protected]>
--- src/tracefs-hist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/tracefs-hist.c +1 -1
@@ -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 ;
Signature · 1 line
2.33.1
Quoted 8 lines · On Thu, 18 Nov 2021 18:57:27 +0200 "Tzvetomir Stoyanov (VMware)"…
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 withgetpid().Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203871
Reported-by Alan Mikhak <[email protected]>Signed-off-by Tzvetomir Stoyanov (VMware) <[email protected]>---
I guess I hit this earlier but never applied my fix :-/
https://patchwork.kernel.org/project/linux-trace-devel/patch/[email protected]/
-- Steve