Lines Matching refs:e
277 static void crashlog_send_crash(struct event_t *e, char *eid, in crashlog_send_crash() argument
286 struct crash_t *crash = (struct crash_t *)e->private; in crashlog_send_crash()
290 hist_raise_event(etype_str[e->event_type], crash->name, e->dir, "", in crashlog_send_crash()
292 if (!e->dir) in crashlog_send_crash()
301 generate_crashfile(e->dir, etype_str[e->event_type], in crashlog_send_crash()
302 strlen(etype_str[e->event_type]), eid, in crashlog_send_crash()
309 log->get(log, (void *)e->dir); in crashlog_send_crash()
311 if (!strcmp(e->channel, "inotify")) { in crashlog_send_crash()
316 if (asprintf(&des, "%s/%s", e->dir, e->path) == -1) { in crashlog_send_crash()
322 e->path) == -1) { in crashlog_send_crash()
336 static void crashlog_send_info(struct event_t *e, char *eid) in crashlog_send_info() argument
339 struct info_t *info = (struct info_t *)e->private; in crashlog_send_info()
342 hist_raise_event(etype_str[e->event_type], info->name, e->dir, "", eid); in crashlog_send_info()
343 if (!e->dir) in crashlog_send_info()
348 log->get(log, (void *)e->dir); in crashlog_send_info()
357 static void crashlog_send_reboot(struct event_t *e, char *eid) in crashlog_send_reboot() argument
380 hist_raise_event(etype_str[e->event_type], reason, NULL, "", eid); in crashlog_send_reboot()
383 static void crashlog_send_vmevent(struct event_t *e, char *eid, in crashlog_send_vmevent() argument
400 struct vm_event_t *vme = (struct vm_event_t *)e->private; in crashlog_send_vmevent()
413 hist_raise_event(vme->vm->name, type, e->dir, "", eid); in crashlog_send_vmevent()
415 if (!e->dir) in crashlog_send_vmevent()
418 generate_crashfile(e->dir, event, elen, eid, SHORT_KEY_LENGTH, type, in crashlog_send_vmevent()
434 res = e2fs_dump_dir_by_dpath(datafs, vmlogpath, e->dir, &cnt); in crashlog_send_vmevent()
450 if (remove_r(e->dir) == -1) in crashlog_send_vmevent()
451 LOGE("failed to remove %s, %s\n", e->dir, in crashlog_send_vmevent()
453 free(e->dir); in crashlog_send_vmevent()
454 e->dir = NULL; in crashlog_send_vmevent()
462 static int crashlog_event_analyze(struct event_t *e, char **result, in crashlog_event_analyze() argument
470 switch (e->event_type) { in crashlog_event_analyze()
472 rcrash = (struct crash_t *)e->private; in crashlog_event_analyze()
475 e->path) == -1) { in crashlog_event_analyze()
488 e->private = (void *)crash; in crashlog_event_analyze()
491 vme = (struct vm_event_t *)e->private; in crashlog_event_analyze()
504 static int crashlog_new_event(struct event_t *e, char *result, size_t rsize, in crashlog_new_event() argument
518 const char *estr = etype_str[e->event_type]; in crashlog_new_event()
519 size_t eslen = strlen(etype_str[e->event_type]); in crashlog_new_event()
521 switch (e->event_type) { in crashlog_new_event()
523 crash = (struct crash_t *)e->private; in crashlog_new_event()
526 if (to_collect_logs(crash) || !strcmp(e->channel, "inotify")) { in crashlog_new_event()
532 info = (struct info_t *)e->private; in crashlog_new_event()
535 if (to_collect_logs(info) || !strcmp(e->channel, "inotify")) { in crashlog_new_event()
545 vme = (struct vm_event_t *)e->private; in crashlog_new_event()
576 e->dir = generate_log_dir(mode, key, &e->dlen); in crashlog_new_event()
577 if (!e->dir) { in crashlog_new_event()
585 if (e->event_type == VM) { in crashlog_new_event()
595 static void crashlog_send(struct event_t *e) in crashlog_send() argument
604 if (crashlog_event_analyze(e, &result, &rsize) == -1) { in crashlog_send()
608 if (crashlog_new_event(e, result, rsize, &eid) == -1) { in crashlog_send()
620 switch (e->event_type) { in crashlog_send()
622 crashlog_send_crash(e, eid, result, rsize); in crashlog_send()
625 crashlog_send_info(e, eid); in crashlog_send()
631 crashlog_send_reboot(e, eid); in crashlog_send()
634 crashlog_send_vmevent(e, eid, result, rsize); in crashlog_send()
637 LOGE("unsupoorted event type %d\n", e->event_type); in crashlog_send()
639 if (e->dir) in crashlog_send()
640 log_grows(e->dir, e->dlen); in crashlog_send()