int expire; /* next expiration date for this task, in ticks */
short nice; /* task prio from -1024 to +1024 */
short tid; /* TID where it's allowed to run, <0 if anywhere */
- uint64_t call_date; /* date of the last task wakeup or call */
+ uint64_t wake_date; /* date of the last task wakeup */
uint64_t lat_time; /* total latency time experienced */
uint64_t cpu_time; /* total CPU time consumed */
};
* list starts and this works because both are exclusive. Never ever
* reorder these fields without taking this into account!
*/
- uint32_t call_date; /* date of the last tasklet wakeup or call */
+ uint32_t wake_date; /* date of the last tasklet wakeup */
int tid; /* TID of the tasklet owner, <0 if local */
};
tl->debug.caller_line[tl->debug.caller_idx] = line;
#endif
if (_HA_ATOMIC_LOAD(&th_ctx->flags) & TH_FL_TASK_PROFILING)
- tl->call_date = now_mono_time();
+ tl->wake_date = now_mono_time();
__tasklet_wakeup_on(tl, thr);
}
t->debug.caller_line[t->debug.caller_idx] = line;
#endif
if (_HA_ATOMIC_LOAD(&th_ctx->flags) & TH_FL_TASK_PROFILING)
- t->call_date = now_mono_time();
+ t->wake_date = now_mono_time();
__tasklet_wakeup_on((struct tasklet *)t, thr);
}
tl->debug.caller_line[tl->debug.caller_idx] = line;
#endif
if (th_ctx->flags & TH_FL_TASK_PROFILING)
- tl->call_date = now_mono_time();
+ tl->wake_date = now_mono_time();
return __tasklet_wakeup_after(head, tl);
}
t->tid = tid;
t->nice = 0;
t->calls = 0;
- t->call_date = 0;
+ t->wake_date = 0;
t->cpu_time = 0;
t->lat_time = 0;
t->expire = TICK_ETERNITY;
t->state = TASK_F_TASKLET;
t->process = NULL;
t->tid = -1;
- t->call_date = 0;
+ t->wake_date = 0;
#ifdef DEBUG_TASK
t->debug.caller_idx = 0;
#endif
while (rqnode) {
t = eb32_entry(rqnode, struct task, rq);
entry = sched_activity_entry(tmp_activity, t->process);
- if (t->call_date) {
- lat = now_ns - t->call_date;
+ if (t->wake_date) {
+ lat = now_ns - t->wake_date;
if ((int64_t)lat > 0)
entry->lat_time += lat;
}
while (rqnode) {
t = eb32_entry(rqnode, struct task, rq);
entry = sched_activity_entry(tmp_activity, t->process);
- if (t->call_date) {
- lat = now_ns - t->call_date;
+ if (t->wake_date) {
+ lat = now_ns - t->wake_date;
if ((int64_t)lat > 0)
entry->lat_time += lat;
}
list_for_each_entry(tl, mt_list_to_list(&ha_thread_ctx[thr].shared_tasklet_list), list) {
t = (const struct task *)tl;
entry = sched_activity_entry(tmp_activity, t->process);
- if (!TASK_IS_TASKLET(t) && t->call_date) {
- lat = now_ns - t->call_date;
+ if (!TASK_IS_TASKLET(t) && t->wake_date) {
+ lat = now_ns - t->wake_date;
if ((int64_t)lat > 0)
entry->lat_time += lat;
}
list_for_each_entry(tl, &ha_thread_ctx[thr].tasklets[queue], list) {
t = (const struct task *)tl;
entry = sched_activity_entry(tmp_activity, t->process);
- if (!TASK_IS_TASKLET(t) && t->call_date) {
- lat = now_ns - t->call_date;
+ if (!TASK_IS_TASKLET(t) && t->wake_date) {
+ lat = now_ns - t->wake_date;
if ((int64_t)lat > 0)
entry->lat_time += lat;
}
"%p (task) calls=%u last=%llu%s\n",
task,
task->calls,
- task->call_date ? (unsigned long long)(now_mono_time() - task->call_date) : 0,
- task->call_date ? " ns ago" : "");
+ task->wake_date ? (unsigned long long)(now_mono_time() - task->wake_date) : 0,
+ task->wake_date ? " ns ago" : "");
chunk_appendf(buf, "%s fct=%p(", pfx, task->process);
resolve_sym_name(buf, NULL, task->process);
}
if (_HA_ATOMIC_LOAD(&th_ctx->flags) & TH_FL_TASK_PROFILING)
- t->call_date = now_mono_time();
+ t->wake_date = now_mono_time();
eb32_insert(root, &t->rq);
profile_entry = sched_activity_entry(sched_activity, t->process);
before = now_mono_time();
- if (((struct tasklet *)t)->call_date) {
- HA_ATOMIC_ADD(&profile_entry->lat_time, (uint32_t)(before - ((struct tasklet *)t)->call_date));
- ((struct tasklet *)t)->call_date = 0;
+ if (((struct tasklet *)t)->wake_date) {
+ HA_ATOMIC_ADD(&profile_entry->lat_time, (uint32_t)(before - ((struct tasklet *)t)->wake_date));
+ ((struct tasklet *)t)->wake_date = 0;
}
}
/* OK then this is a regular task */
_HA_ATOMIC_DEC(&ha_thread_ctx[tid].tasks_in_list);
- if (unlikely(t->call_date)) {
+ if (unlikely(t->wake_date)) {
uint64_t now_ns = now_mono_time();
- uint64_t lat = now_ns - t->call_date;
+ uint64_t lat = now_ns - t->wake_date;
t->lat_time += lat;
- t->call_date = now_ns;
+ t->wake_date = now_ns;
profile_entry = sched_activity_entry(sched_activity, t->process);
HA_ATOMIC_ADD(&profile_entry->lat_time, lat);
HA_ATOMIC_INC(&profile_entry->calls);
* immediately, else we defer it into wait queue
*/
if (t != NULL) {
- if (unlikely(t->call_date)) {
- uint64_t cpu = now_mono_time() - t->call_date;
+ if (unlikely(t->wake_date)) {
+ uint64_t cpu = now_mono_time() - t->wake_date;
t->cpu_time += cpu;
- t->call_date = 0;
+ t->wake_date = 0;
HA_ATOMIC_ADD(&profile_entry->cpu_time, cpu);
}