Skip to content

Commit

Permalink
lib: event - Rename tv_created as tv_created_ioloop
Browse files Browse the repository at this point in the history
  • Loading branch information
cmouse committed Oct 17, 2018
1 parent 2387195 commit 2011935
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/lib-master/stats-client.c
Expand Up @@ -167,7 +167,7 @@ static struct event *stats_event_get_merged(struct event *event)

for (p = event->parent;
p != NULL && !p->id_sent_to_stats &&
timeval_cmp(&p->tv_created, &res->tv_created) == 0;
timeval_cmp(&p->tv_created_ioloop, &res->tv_created_ioloop) == 0;
p = p->parent) {
// Merge all parents with the same timestamp into result.
if (!event_has_all_categories(res, p) ||
Expand Down
2 changes: 1 addition & 1 deletion src/lib/lib-event-private.h
Expand Up @@ -23,7 +23,7 @@ struct event {
bool call_free:1;

/* Fields that are exported & imported: */
struct timeval tv_created;
struct timeval tv_created_ioloop;
struct timeval tv_last_sent;

const char *source_filename;
Expand Down
14 changes: 7 additions & 7 deletions src/lib/lib-event.c
Expand Up @@ -127,7 +127,7 @@ struct event *event_create(struct event *parent, const char *source_filename,
event->refcount = 1;
event->id = ++event_id_counter;
event->pool = pool;
event->tv_created = ioloop_timeval;
event->tv_created_ioloop = ioloop_timeval;
event->source_filename = source_filename;
event->source_linenum = source_linenum;
if (parent != NULL) {
Expand All @@ -154,7 +154,7 @@ event_create_passthrough(struct event *parent, const char *source_filename,
event->passthrough = TRUE;
/* This event only intends to extend the parent event.
Use the parent's creation timestamp. */
event->tv_created = parent->tv_created;
event->tv_created_ioloop = parent->tv_created_ioloop;
event_last_passthrough = &event->event_passthrough;
} else {
event_last_passthrough = &parent->event_passthrough;
Expand Down Expand Up @@ -541,7 +541,7 @@ struct event *event_get_parent(struct event *event)

void event_get_create_time(struct event *event, struct timeval *tv_r)
{
*tv_r = event->tv_created;
*tv_r = event->tv_created_ioloop;
}

bool event_get_last_send_time(struct event *event, struct timeval *tv_r)
Expand Down Expand Up @@ -630,8 +630,8 @@ void event_export(const struct event *event, string_t *dest)
{
/* required fields: */
str_printfa(dest, "%"PRIdTIME_T"\t%u",
event->tv_created.tv_sec,
(unsigned int)event->tv_created.tv_usec);
event->tv_created_ioloop.tv_sec,
(unsigned int)event->tv_created_ioloop.tv_usec);

/* optional fields: */
if (event->source_filename != NULL) {
Expand Down Expand Up @@ -711,8 +711,8 @@ bool event_import_unescaped(struct event *event, const char *const *args,
*error_r = "Missing required fields";
return FALSE;
}
if (!event_import_tv(args[0], args[1], &event->tv_created, &error)) {
*error_r = t_strdup_printf("Invalid tv_created: %s", error);
if (!event_import_tv(args[0], args[1], &event->tv_created_ioloop, &error)) {
*error_r = t_strdup_printf("Invalid tv_created_ioloop: %s", error);
return FALSE;
}
args += 2;
Expand Down

0 comments on commit 2011935

Please sign in to comment.