Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
c8d249cc
Commit
c8d249cc
authored
7 years ago
by
Vijay Pai
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #11559 from vjpai/longlong
Remove long long
parents
de7dec71
86a4d998
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/lib/support/time_precise.c
+8
-8
8 additions, 8 deletions
src/core/lib/support/time_precise.c
with
8 additions
and
8 deletions
src/core/lib/support/time_precise.c
+
8
−
8
View file @
c8d249cc
...
@@ -22,26 +22,26 @@
...
@@ -22,26 +22,26 @@
#ifdef GRPC_TIMERS_RDTSC
#ifdef GRPC_TIMERS_RDTSC
#if defined(__i386__)
#if defined(__i386__)
static
void
gpr_get_cycle_counter
(
long
long
int
*
clk
)
{
static
void
gpr_get_cycle_counter
(
int64_t
int
*
clk
)
{
long
long
int
ret
;
int64_t
int
ret
;
__asm__
volatile
(
"rdtsc"
:
"=A"
(
ret
));
__asm__
volatile
(
"rdtsc"
:
"=A"
(
ret
));
*
clk
=
ret
;
*
clk
=
ret
;
}
}
// ----------------------------------------------------------------
// ----------------------------------------------------------------
#elif defined(__x86_64__) || defined(__amd64__)
#elif defined(__x86_64__) || defined(__amd64__)
static
void
gpr_get_cycle_counter
(
long
long
in
t
*
clk
)
{
static
void
gpr_get_cycle_counter
(
int64_
t
*
clk
)
{
unsigned
long
long
low
,
high
;
unsigned
int64_t
low
,
high
;
__asm__
volatile
(
"rdtsc"
:
"=a"
(
low
),
"=d"
(
high
));
__asm__
volatile
(
"rdtsc"
:
"=a"
(
low
),
"=d"
(
high
));
*
clk
=
(
long
long
)(
high
<<
32
)
|
(
long
long
)
low
;
*
clk
=
(
int64_t
)(
high
<<
32
)
|
(
int64_t
)
low
;
}
}
#endif
#endif
static
double
cycles_per_second
=
0
;
static
double
cycles_per_second
=
0
;
static
long
long
in
t
start_cycle
;
static
int64_
t
start_cycle
;
void
gpr_precise_clock_init
(
void
)
{
void
gpr_precise_clock_init
(
void
)
{
time_t
start
;
time_t
start
;
long
long
end_cycle
;
int64_t
end_cycle
;
gpr_log
(
GPR_DEBUG
,
"Calibrating timers"
);
gpr_log
(
GPR_DEBUG
,
"Calibrating timers"
);
start
=
time
(
NULL
);
start
=
time
(
NULL
);
while
(
time
(
NULL
)
==
start
)
while
(
time
(
NULL
)
==
start
)
...
@@ -55,7 +55,7 @@ void gpr_precise_clock_init(void) {
...
@@ -55,7 +55,7 @@ void gpr_precise_clock_init(void) {
}
}
void
gpr_precise_clock_now
(
gpr_timespec
*
clk
)
{
void
gpr_precise_clock_now
(
gpr_timespec
*
clk
)
{
long
long
in
t
counter
;
int64_
t
counter
;
double
secs
;
double
secs
;
gpr_get_cycle_counter
(
&
counter
);
gpr_get_cycle_counter
(
&
counter
);
secs
=
(
double
)(
counter
-
start_cycle
)
/
cycles_per_second
;
secs
=
(
double
)(
counter
-
start_cycle
)
/
cycles_per_second
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment