ZTrace(string name, ZTraceEndpointRef ep, struct blkin_trace_info *info, bool child=false) { c_name = to_cstr(name); this->ep = ep; if (child) blkin_init_child_info(&trace, info, ep->get_blkin_ep(), c_name); else { blkin_init_new_trace(&trace, c_name, ep->get_blkin_ep()); blkin_set_trace_info(&trace, info); } }
int blkin_init_child(struct blkin_trace *child, const struct blkin_trace *parent, const struct blkin_endpoint *endpoint, const char *child_name) { int res; if (!parent) { res = -EINVAL; goto OUT; } if (!endpoint) endpoint = parent->endpoint; if (blkin_init_child_info(child, &parent->info, endpoint, child_name) != 0){ res = -EINVAL; goto OUT; } res = 0; OUT: return res; }