Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1256465

Bug#1111226: rocksdb: Please extend mips.patch to cover the remaining architectures

From John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Newsgroups linux.debian.bugs.dist
Subject Bug#1111226: rocksdb: Please extend mips.patch to cover the remaining architectures
Date 2025-08-15 22:10 +0200
Message-ID <Lk8Up-7SLQ-13@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Source: rocksdb
Version: 9.10.0-1
Severity: normal

Hello,

the patch "mips.patch" uses a C implementation for rdtsc on MIPS targets.

Please change the patch so that the fallback implementation is used on all
architectures instead of just triggering the #error statement:

--- rocksdb-9.10.0.orig/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
+++ rocksdb-9.10.0/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
@@ -166,12 +166,6 @@ static inline tokutime_t toku_time_now(v
   unsigned long result;
   asm volatile ("rdtime.d\t%0,$r0" : "=r" (result));
   return result;
-#elif defined(__mips__)
-  // mips apparently only allows rdtsc for superusers, so we fall
-  // back to gettimeofday.  It's possible clock_gettime would be better.
-  struct timeval tv;
-  gettimeofday(&tv, nullptr);
-  return (uint64_t)tv.tv_sec * 1000000 + tv.tv_usec;
 #elif (__ARM_ARCH >= 6)
   uint32_t pmccntr;
   uint32_t pmuseren;
@@ -187,7 +181,9 @@ static inline tokutime_t toku_time_now(v
     }
   }
 #else
-#error No timer implementation for this platform
+  struct timeval tv;
+  gettimeofday(&tv, nullptr);
+  return (uint64_t)tv.tv_sec * 1000000 + tv.tv_usec;
 #endif
 }

Then rocksdb can be build-enabled for all targets.

Thanks,
Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

Back to linux.debian.bugs.dist | Previous | Next | Find similar | Unroll thread


Thread

Bug#1111226: rocksdb: Please extend mips.patch to cover the remaining architectures John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> - 2025-08-15 22:10 +0200

csiph-web