Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions iocore/aio/AIO.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ aio_stats_cb(const char * /* name ATS_UNUSED */, RecDataT data_type, RecData *da
int64_t new_val = 0;
int64_t diff = 0;
int64_t count, sum;
ink_hrtime now = ink_get_hrtime();
ink_hrtime now = Thread::get_hrtime();
// The RecGetGlobalXXX stat functions are cheaper than the
// RecGetXXX functions. The Global ones are expensive
// for increments and decrements. But for AIO stats we
Expand Down Expand Up @@ -504,7 +504,7 @@ aio_thread_main(void *arg)
op->thread->schedule_imm_signal(op);
ink_mutex_acquire(&my_aio_req->aio_mutex);
} while (1);
timespec timedwait_msec = ink_hrtime_to_timespec(ink_get_hrtime() + HRTIME_MSECONDS(net_config_poll_timeout));
timespec timedwait_msec = ink_hrtime_to_timespec(Thread::get_hrtime() + HRTIME_MSECONDS(net_config_poll_timeout));
ink_cond_timedwait(&my_aio_req->aio_cond, &my_aio_req->aio_mutex, &timedwait_msec);
}
return 0;
Expand Down
6 changes: 3 additions & 3 deletions iocore/aio/test_AIO.cc
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,11 @@ int
AIO_Device::do_fd(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED */)
{
if (!time_start) {
time_start = ink_get_hrtime();
time_start = Thread::get_hrtime();
fprintf(stderr, "Starting the aio_testing \n");
}
if ((ink_get_hrtime() - time_start) > (run_time * HRTIME_SECOND)) {
time_end = ink_get_hrtime();
if ((Thread::get_hrtime() - time_start) > (run_time * HRTIME_SECOND)) {
time_end = Thread::get_hrtime();
ink_atomic_increment(&n_accessors, -1);
if (n_accessors <= 0)
dump_summary();
Expand Down
4 changes: 2 additions & 2 deletions iocore/cache/CacheDir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ CacheSync::mainEvent(int event, Event *e)
}

if (!vol->dir_sync_in_progress)
start_time = ink_get_hrtime();
start_time = Thread::get_hrtime();

// recompute hit_evacuate_window
vol->hit_evacuate_window = (vol->data_blocks * cache_config_hit_evacuate_percent) / 100;
Expand Down Expand Up @@ -1109,7 +1109,7 @@ CacheSync::mainEvent(int event, Event *e)
} else {
vol->dir_sync_in_progress = 0;
CACHE_INCREMENT_DYN_STAT(cache_directory_sync_count_stat);
CACHE_SUM_DYN_STAT(cache_directory_sync_time_stat, ink_get_hrtime() - start_time);
CACHE_SUM_DYN_STAT(cache_directory_sync_time_stat, Thread::get_hrtime() - start_time);
start_time = 0;
goto Ldone;
}
Expand Down
2 changes: 1 addition & 1 deletion iocore/cache/CacheRead.cc
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ CacheVC::openReadFromWriter(int event, Event *e)
// before the open_write, but the reader could not get the volume
// lock. If we don't reset the clock here, we won't choose any writer
// and hence fail the read request.
start_time = ink_get_hrtime();
start_time = Thread::get_hrtime();
f.read_from_writer_called = 1;
}
cancel_trigger();
Expand Down
6 changes: 3 additions & 3 deletions iocore/cache/CacheWrite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ CacheVC::updateVector(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED */)
- total_len. The total number of bytes for the document so far.
Doc->total_len and alternate's total len is set to this value.
- first_key. Doc's first_key is set to this value.
- pin_in_cache. Doc's pinned value is set to this + ink_get_hrtime().
- pin_in_cache. Doc's pinned value is set to this + Thread::get_hrtime().
- earliest_key. If f.use_first_key, Doc's key is set to this value.
- key. If !f.use_first_key, Doc's key is set to this value.
- blocks. Used only if write_len is set. Data to be written
Expand Down Expand Up @@ -611,7 +611,7 @@ Vol::evacuateDocReadDone(int event, Event *e)
}
if (!b)
goto Ldone;
if ((b->f.pinned && !b->readers) && doc->pinned < (uint32_t)(ink_get_based_hrtime() / HRTIME_SECOND))
if ((b->f.pinned && !b->readers) && doc->pinned < (uint32_t)(Thread::get_based_hrtime() / HRTIME_SECOND))
goto Ldone;

if (dir_head(&b->dir) && b->f.evacuate_head) {
Expand Down Expand Up @@ -745,7 +745,7 @@ agg_copy(char *p, CacheVC *vc)
doc->checksum = DOC_NO_CHECKSUM;
if (vc->pin_in_cache) {
dir_set_pinned(&vc->dir, 1);
doc->pinned = (uint32_t)(ink_get_based_hrtime() / HRTIME_SECOND) + vc->pin_in_cache;
doc->pinned = (uint32_t)(Thread::get_based_hrtime() / HRTIME_SECOND) + vc->pin_in_cache;
} else {
dir_set_pinned(&vc->dir, 0);
doc->pinned = 0;
Expand Down
2 changes: 1 addition & 1 deletion iocore/cache/P_CacheInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ new_CacheVC(Continuation *cont)
c->_action = cont;
c->initial_thread = t->tt == DEDICATED ? NULL : t;
c->mutex = cont->mutex;
c->start_time = ink_get_hrtime();
c->start_time = Thread::get_hrtime();
ink_assert(c->trigger == NULL);
Debug("cache_new", "new %p", c);
#ifdef CACHE_STAT_PAGES
Expand Down
2 changes: 1 addition & 1 deletion iocore/cache/P_CacheTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct CacheTestSM : public RegressionSM {
void
make_request()
{
start_time = ink_get_hrtime();
start_time = Thread::get_hrtime();
make_request_internal();
}
virtual void make_request_internal() = 0;
Expand Down
18 changes: 9 additions & 9 deletions iocore/cluster/ClusterCache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ CacheContinuation::do_op(Continuation *c, ClusterMachine *mp, void *args, int us
cc->mutex = c->mutex;
cc->action = c;
cc->action.cancelled = false;
cc->start_time = ink_get_hrtime();
cc->start_time = Thread::get_hrtime();
cc->from = mp;
cc->result = op_failure(opcode);
SET_CONTINUATION_HANDLER(cc, (CacheContHandler)&CacheContinuation::remoteOpEvent);
Expand Down Expand Up @@ -832,7 +832,7 @@ CacheContinuation::localVCsetupEvent(int event, ClusterVConnection *vc)
} else if (((event == CLUSTER_EVENT_OPEN) || (event == CLUSTER_EVENT_OPEN_EXISTS)) &&
(((ptrdiff_t)timeout & (ptrdiff_t)1) == 0)) {
ink_hrtime now;
now = ink_get_hrtime();
now = Thread::get_hrtime();
CLUSTER_SUM_DYN_STAT(CLUSTER_OPEN_DELAY_TIME_STAT, now - start_time);
LOG_EVENT_TIME(start_time, open_delay_time_dist, open_delay_events);
if (read_op) {
Expand Down Expand Up @@ -1046,7 +1046,7 @@ cache_op_ClusterFunction(ClusterHandler *ch, void *data, int len)
MUTEX_TRY_LOCK(lock, c->mutex, this_ethread());
c->request_opcode = opcode;
c->token.clear();
c->start_time = ink_get_hrtime();
c->start_time = Thread::get_hrtime();
c->ch = ch;
SET_CONTINUATION_HANDLER(c, (CacheContHandler)&CacheContinuation::replyOpEvent);

Expand Down Expand Up @@ -1555,7 +1555,7 @@ CacheContinuation::replyOpEvent(int event, VConnection *cvc)
ink_assert(magicno == (int)MagicNo);
Debug("cache_proto", "replyOpEvent(this=%p,event=%d,VC=%p)", this, event, cvc);
ink_hrtime now;
now = ink_get_hrtime();
now = Thread::get_hrtime();
CLUSTER_SUM_DYN_STAT(CLUSTER_CACHE_CALLBACK_TIME_STAT, now - start_time);
LOG_EVENT_TIME(start_time, callback_time_dist, cache_callbacks);
ink_release_assert(expect_cache_callback);
Expand Down Expand Up @@ -1991,7 +1991,7 @@ cache_op_result_ClusterFunction(ClusterHandler *ch, void *d, int l)
c->seq_number = msg->seq_number;
c->target_ip = ch->machine->ip;
SET_CONTINUATION_HANDLER(c, (CacheContHandler)&CacheContinuation::handleReplyEvent);
c->start_time = ink_get_hrtime();
c->start_time = Thread::get_hrtime();
c->result = msg->result;
if (event_is_open(msg->result))
c->token = msg->token;
Expand Down Expand Up @@ -2093,11 +2093,11 @@ CacheContinuation::remoteOpEvent(int event_code, Event *e)
res = rmsg->result;
}
if ((res == CACHE_EVENT_LOOKUP) || (res == CACHE_EVENT_LOOKUP_FAILED)) {
now = ink_get_hrtime();
now = Thread::get_hrtime();
CLUSTER_SUM_DYN_STAT(CLUSTER_CACHE_LKRMT_CALLBACK_TIME_STAT, now - start_time);
LOG_EVENT_TIME(start_time, lkrmt_callback_time_dist, lkrmt_cache_callbacks);
} else {
now = ink_get_hrtime();
now = Thread::get_hrtime();
CLUSTER_SUM_DYN_STAT(CLUSTER_CACHE_RMT_CALLBACK_TIME_STAT, now - start_time);
LOG_EVENT_TIME(start_time, rmt_callback_time_dist, rmt_cache_callbacks);
}
Expand Down Expand Up @@ -2444,7 +2444,7 @@ CacheContinuation::do_remote_lookup(Continuation *cont, const CacheKey *key, Cac
c->url_md5 = msg->url_md5;
c->action.cancelled = false;
c->action = cont;
c->start_time = ink_get_hrtime();
c->start_time = Thread::get_hrtime();
SET_CONTINUATION_HANDLER(c, (CacheContHandler)&CacheContinuation::remoteOpEvent);
c->result = CACHE_EVENT_LOOKUP_FAILED;

Expand Down Expand Up @@ -2561,7 +2561,7 @@ int
CacheContinuation::replyLookupEvent(int event, void * /* d ATS_UNUSED */)
{
ink_hrtime now;
now = ink_get_hrtime();
now = Thread::get_hrtime();
CLUSTER_SUM_DYN_STAT(CLUSTER_CACHE_CALLBACK_TIME_STAT, now - start_time);
LOG_EVENT_TIME(start_time, callback_time_dist, cache_callbacks);

Expand Down
6 changes: 3 additions & 3 deletions iocore/cluster/ClusterConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ configuration_add_machine(ClusterConfiguration *c, ClusterMachine *m)
cc->n_machines++;

cc->link.next = c;
cc->changed = ink_get_hrtime();
cc->changed = Thread::get_hrtime();
ink_assert(cc->n_machines < CLUSTER_MAX_MACHINES);

build_cluster_hash_table(cc);
Expand Down Expand Up @@ -335,7 +335,7 @@ configuration_remove_machine(ClusterConfiguration *c, ClusterMachine *m)
ink_assert(cc->n_machines > 0);

cc->link.next = c;
cc->changed = ink_get_hrtime();
cc->changed = Thread::get_hrtime();

build_cluster_hash_table(cc);
INK_MEMORY_BARRIER; // commit writes before freeing old hash table
Expand All @@ -362,7 +362,7 @@ cluster_machine_at_depth(unsigned int hash, int *pprobe_depth, ClusterMachine **
#endif
ClusterConfiguration *cc = this_cluster()->current_configuration();
ClusterConfiguration *next_cc = cc;
ink_hrtime now = ink_get_hrtime();
ink_hrtime now = Thread::get_hrtime();
int fake_probe_depth = 0;
int &probe_depth = pprobe_depth ? (*pprobe_depth) : fake_probe_depth;
int tprobe_depth = probe_depth;
Expand Down
26 changes: 13 additions & 13 deletions iocore/cluster/ClusterHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ ClusterHandler::close_ClusterVConnection(ClusterVConnection *vc)
}
clusterProcessor.invoke_remote(vc->ch, CLOSE_CHANNEL_CLUSTER_FUNCTION, data, len);
}
ink_hrtime now = ink_get_hrtime();
ink_hrtime now = Thread::get_hrtime();
CLUSTER_DECREMENT_DYN_STAT(CLUSTER_CONNECTIONS_OPEN_STAT);
CLUSTER_SUM_DYN_STAT(CLUSTER_CON_TOTAL_TIME_STAT, now - vc->start_time);
if (!local_channel(channel)) {
Expand Down Expand Up @@ -395,7 +395,7 @@ ClusterHandler::build_initial_vector(bool read_flag)
// This isn't used.
// MIOBuffer *w;

ink_hrtime now = ink_get_hrtime();
ink_hrtime now = Thread::get_hrtime();
ClusterState &s = (read_flag ? read : write);
OutgoingControl *oc = s.msg.outgoing_control.head;
IncomingControl *ic = incoming_control.head;
Expand Down Expand Up @@ -879,7 +879,7 @@ ClusterHandler::process_small_control_msgs()
read.msg.did_small_control_msgs = 1;
}

ink_hrtime now = ink_get_hrtime();
ink_hrtime now = Thread::get_hrtime();
char *p = (char *)&read.msg.descriptor[read.msg.count] + read.msg.control_data_offset;
char *endp = (char *)&read.msg.descriptor[read.msg.count] + read.msg.control_bytes;

Expand Down Expand Up @@ -1139,7 +1139,7 @@ ClusterHandler::process_incoming_callouts(ProxyMutex *m)
////////////////////////////////
ink_assert(!clusterFunction[cluster_function_index].ClusterFunc);
clusterFunction[cluster_function_index].pfn(this, p, len - sizeof(int32_t));
now = ink_get_hrtime();
now = Thread::get_hrtime();
CLUSTER_SUM_DYN_STAT(CLUSTER_CTRL_MSGS_RECV_TIME_STAT, now - ic->recognized_time);
} else {
Warning("2Bad cluster function index (small control)");
Expand All @@ -1160,7 +1160,7 @@ ClusterHandler::process_incoming_callouts(ProxyMutex *m)
////////////////////////////////
ink_assert(!clusterFunction[cluster_function_index].ClusterFunc);
clusterFunction[cluster_function_index].pfn(this, (void *)(ic->data + sizeof(int32_t)), ic->len - sizeof(int32_t));
now = ink_get_hrtime();
now = Thread::get_hrtime();
CLUSTER_SUM_DYN_STAT(CLUSTER_CTRL_MSGS_RECV_TIME_STAT, now - ic->recognized_time);
} else {
valid_index = false;
Expand Down Expand Up @@ -1410,7 +1410,7 @@ ClusterHandler::update_channels_written()
OutgoingControl *oc = write.msg.outgoing_control.dequeue();
oc->free_data();
oc->mutex = NULL;
now = ink_get_hrtime();
now = Thread::get_hrtime();
CLUSTER_SUM_DYN_STAT(CLUSTER_CTRL_MSGS_SEND_TIME_STAT, now - oc->submit_time);
LOG_EVENT_TIME(oc->submit_time, cluster_send_time_dist, cluster_send_events);
oc->freeall();
Expand All @@ -1436,7 +1436,7 @@ ClusterHandler::update_channels_written()
// Free descriptor
hdr_oc->free_data();
hdr_oc->mutex = NULL;
now = ink_get_hrtime();
now = Thread::get_hrtime();
CLUSTER_SUM_DYN_STAT(CLUSTER_CTRL_MSGS_SEND_TIME_STAT, now - hdr_oc->submit_time);
LOG_EVENT_TIME(hdr_oc->submit_time, cluster_send_time_dist, cluster_send_events);
hdr_oc->freeall();
Expand Down Expand Up @@ -1802,7 +1802,7 @@ ClusterHandler::add_small_controlmsg_descriptors()
c->free_data();
c->mutex = NULL;
p += c->len;
ink_hrtime now = ink_get_hrtime();
ink_hrtime now = Thread::get_hrtime();
CLUSTER_SUM_DYN_STAT(CLUSTER_CTRL_MSGS_SEND_TIME_STAT, now - c->submit_time);
LOG_EVENT_TIME(c->submit_time, cluster_send_time_dist, cluster_send_events);
c->freeall();
Expand Down Expand Up @@ -2325,7 +2325,7 @@ int
ClusterHandler::mainClusterEvent(int event, Event *e)
{
// Set global time
current_time = ink_get_hrtime();
current_time = Thread::get_hrtime();

if (CacheClusterMonitorEnabled) {
if ((current_time - last_trace_dump) > HRTIME_SECONDS(CacheClusterMonitorIntervalSecs)) {
Expand Down Expand Up @@ -2457,7 +2457,7 @@ int ClusterHandler::process_read(ink_hrtime /* now ATS_UNUSED */)
_n_read_start++;
#endif
read.msg.clear();
read.start_time = ink_get_hrtime();
read.start_time = Thread::get_hrtime();
if (build_initial_vector(CLUSTER_READ)) {
read.state = ClusterState::READ_HEADER;
} else {
Expand Down Expand Up @@ -2708,7 +2708,7 @@ int ClusterHandler::process_read(ink_hrtime /* now ATS_UNUSED */)
#ifdef CLUSTER_STATS
_n_read_complete++;
#endif
ink_hrtime rdmsg_end_time = ink_get_hrtime();
ink_hrtime rdmsg_end_time = Thread::get_hrtime();
CLUSTER_SUM_DYN_STAT(CLUSTER_RDMSG_ASSEMBLE_TIME_STAT, rdmsg_end_time - read.start_time);
read.start_time = HRTIME_MSECONDS(0);
if (dump_msgs)
Expand Down Expand Up @@ -2750,7 +2750,7 @@ ClusterHandler::process_write(ink_hrtime now, bool only_write_control_msgs)
_n_write_start++;
#endif
write.msg.clear();
write.last_time = ink_get_hrtime();
write.last_time = Thread::get_hrtime();
pw_write_descriptors_built = -1;
pw_freespace_descriptors_built = -1;
pw_controldata_descriptors_built = -1;
Expand Down Expand Up @@ -2898,7 +2898,7 @@ ClusterHandler::process_write(ink_hrtime now, bool only_write_control_msgs)
_n_write_complete++;
#endif
write.state = ClusterState::WRITE_START;
ink_hrtime curtime = ink_get_hrtime();
ink_hrtime curtime = Thread::get_hrtime();

if (!on_stolen_thread) {
//
Expand Down
4 changes: 2 additions & 2 deletions iocore/cluster/ClusterLoadMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ void
ClusterLoadMonitor::recv_cluster_load_msg(cluster_load_ping_msg *m)
{
// We have received back our ping message.
ink_hrtime now = ink_get_hrtime();
ink_hrtime now = Thread::get_hrtime();

if ((now >= m->send_time) &&
((m->sequence_number >= cluster_load_msg_start_sequence_number) && (m->sequence_number < cluster_load_msg_sequence_number))) {
Expand Down Expand Up @@ -285,7 +285,7 @@ ClusterLoadMonitor::cluster_load_periodic(int /* event ATS_UNUSED */, Event * /*
}
// Generate periodic ping messages.

ink_hrtime current_time = ink_get_hrtime();
ink_hrtime current_time = Thread::get_hrtime();
if ((current_time - last_ping_message_sent) > HRTIME_MSECONDS(ping_message_send_msec_interval)) {
send_cluster_load_msg(current_time);
last_ping_message_sent = current_time;
Expand Down
8 changes: 4 additions & 4 deletions iocore/cluster/ClusterProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ ClusterProcessor::internal_invoke_remote(ClusterHandler *ch, int cluster_fn, voi
c = OutgoingControl::alloc();
}
CLUSTER_INCREMENT_DYN_STAT(CLUSTER_CTRL_MSGS_SENT_STAT);
c->submit_time = ink_get_hrtime();
c->submit_time = Thread::get_hrtime();

if (malloced) {
c->set_data((char *)data, len);
Expand Down Expand Up @@ -184,7 +184,7 @@ ClusterProcessor::invoke_remote_data(ClusterHandler *ch, int cluster_fn, void *d
mh.token = *token;

OutgoingControl *chdr = OutgoingControl::alloc();
chdr->submit_time = ink_get_hrtime();
chdr->submit_time = Thread::get_hrtime();
chdr->len = sizeof(int32_t) + sizeof(mh);
chdr->alloc_data();
*(int32_t *)chdr->data = -1; // always -1 for compound message
Expand Down Expand Up @@ -243,7 +243,7 @@ ClusterProcessor::open_local(Continuation *cont, ClusterMachine * /* m ATS_UNUSE
ProxyMutex *mutex = thread->mutex;
ClusterVConnection *vc = clusterVCAllocator.alloc();
vc->new_connect_read = (options & CLUSTER_OPT_CONN_READ ? 1 : 0);
vc->start_time = ink_get_hrtime();
vc->start_time = Thread::get_hrtime();
vc->last_activity_time = vc->start_time;
vc->ch = ch;
vc->token.alloc();
Expand Down Expand Up @@ -313,7 +313,7 @@ ClusterProcessor::connect_local(Continuation *cont, ClusterVCToken *token, int c
ProxyMutex *mutex = thread->mutex;
ClusterVConnection *vc = clusterVCAllocator.alloc();
vc->new_connect_read = (options & CLUSTER_OPT_CONN_READ ? 1 : 0);
vc->start_time = ink_get_hrtime();
vc->start_time = Thread::get_hrtime();
vc->last_activity_time = vc->start_time;
vc->ch = ch;
vc->token = *token;
Expand Down
Loading