mirror of
https://github.com/samba-team/samba.git
synced 2025-08-04 08:22:08 +03:00
s3: we have clock_gettime everywhere, remove ifdefs
This commit is contained in:
@ -894,8 +894,6 @@ extern bool do_profile_times;
|
|||||||
#define DEC_PROFILE_COUNT(x) profile_p->x--
|
#define DEC_PROFILE_COUNT(x) profile_p->x--
|
||||||
#define ADD_PROFILE_COUNT(x,y) profile_p->x += (y)
|
#define ADD_PROFILE_COUNT(x,y) profile_p->x += (y)
|
||||||
|
|
||||||
#if defined(HAVE_CLOCK_GETTIME)
|
|
||||||
|
|
||||||
extern clockid_t __profile_clock;
|
extern clockid_t __profile_clock;
|
||||||
|
|
||||||
static inline uint64_t profile_timestamp(void)
|
static inline uint64_t profile_timestamp(void)
|
||||||
@ -911,17 +909,6 @@ static inline uint64_t profile_timestamp(void)
|
|||||||
return (ts.tv_sec * 1000000) + (ts.tv_nsec / 1000); /* usec */
|
return (ts.tv_sec * 1000000) + (ts.tv_nsec / 1000); /* usec */
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
static inline uint64_t profile_timestamp(void)
|
|
||||||
{
|
|
||||||
struct timeval tv;
|
|
||||||
GetTimeOfDay(&tv);
|
|
||||||
return (tv.tv_sec * 1000000) + tv.tv_usec;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* end of helper macros */
|
/* end of helper macros */
|
||||||
|
|
||||||
#define DO_PROFILE_INC(x) \
|
#define DO_PROFILE_INC(x) \
|
||||||
|
@ -29,11 +29,9 @@
|
|||||||
#ifdef WITH_PROFILE
|
#ifdef WITH_PROFILE
|
||||||
static int shm_id;
|
static int shm_id;
|
||||||
static bool read_only;
|
static bool read_only;
|
||||||
#if defined(HAVE_CLOCK_GETTIME)
|
|
||||||
clockid_t __profile_clock;
|
clockid_t __profile_clock;
|
||||||
bool have_profiling_clock = False;
|
bool have_profiling_clock = False;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
struct profile_header *profile_h;
|
struct profile_header *profile_h;
|
||||||
struct profile_stats *profile_p;
|
struct profile_stats *profile_p;
|
||||||
@ -138,8 +136,6 @@ static void reqprofile_message(struct messaging_context *msg_ctx,
|
|||||||
open the profiling shared memory area
|
open the profiling shared memory area
|
||||||
******************************************************************/
|
******************************************************************/
|
||||||
|
|
||||||
#ifdef HAVE_CLOCK_GETTIME
|
|
||||||
|
|
||||||
/* Find a clock. Just because the definition for a particular clock ID is
|
/* Find a clock. Just because the definition for a particular clock ID is
|
||||||
* present doesn't mean the system actually supports it.
|
* present doesn't mean the system actually supports it.
|
||||||
*/
|
*/
|
||||||
@ -195,7 +191,6 @@ static void init_clock_gettime(void)
|
|||||||
("could not find a working clock for profiling"));
|
("could not find a working clock for profiling"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
bool profile_setup(struct messaging_context *msg_ctx, bool rdonly)
|
bool profile_setup(struct messaging_context *msg_ctx, bool rdonly)
|
||||||
{
|
{
|
||||||
@ -203,9 +198,7 @@ bool profile_setup(struct messaging_context *msg_ctx, bool rdonly)
|
|||||||
|
|
||||||
read_only = rdonly;
|
read_only = rdonly;
|
||||||
|
|
||||||
#ifdef HAVE_CLOCK_GETTIME
|
|
||||||
init_clock_gettime();
|
init_clock_gettime();
|
||||||
#endif
|
|
||||||
|
|
||||||
again:
|
again:
|
||||||
/* try to use an existing key */
|
/* try to use an existing key */
|
||||||
|
Reference in New Issue
Block a user