示例#1
0
void
version_debug(const gchar *tag, GTree *versions)
{
	if (!GRID_TRACE_ENABLED())
		return;

	(void) tag;
	gchar *s = version_dump(versions);
	GRID_TRACE("%s %s (%s)", tag, s, __FUNCTION__);
	g_free(s);
}
示例#2
0
文件: slab.c 项目: Narthorn/oio-sds
void
data_slab_sequence_trace(struct data_slab_sequence_s *dss)
{
	struct data_slab_s *s;

	if (!GRID_TRACE_ENABLED())
		return;

	GRID_TRACE(" DSS %p -> %p", dss->first, dss->last);
	for (s = dss->first; s ;) {
		data_slab_trace("SLAB", s);
		if (s == dss->last)
			break;
		s = s->next;
	}
}
示例#3
0
文件: slab.c 项目: Narthorn/oio-sds
void
data_slab_trace(const gchar *tag, struct data_slab_s *ds)
{
	if (!GRID_TRACE_ENABLED())
		return;

	(void) tag;
	GString *gstr = g_string_sized_new(256);
	switch (ds->type) {
		case STYPE_BUFFER:
		case STYPE_BUFFER_STATIC:
			g_string_append_printf(gstr, "| buffer=%p alloc=%u start=%u end=%u size(%"G_GSIZE_FORMAT")",
				ds->data.buffer.buff,
				ds->data.buffer.alloc,
				ds->data.buffer.start,
				ds->data.buffer.end,
				data_slab_size(ds));
			break;
		case STYPE_FILE:
			g_string_append_printf(gstr, "| fd=%d start=%"G_GSIZE_FORMAT" end=%"G_GSIZE_FORMAT"",
				ds->data.file.fd,
				ds->data.file.start,
				ds->data.file.end);
		case STYPE_PATH:
			g_string_append_printf(gstr, "| fd=%d start=%"G_GSIZE_FORMAT" end=%"G_GSIZE_FORMAT" path=%s",
				ds->data.path.fd,
				ds->data.path.start,
				ds->data.path.end,
				ds->data.path.path);
		case STYPE_EOF:
			break;
	}

	GRID_TRACE("%s %p type=%s%s", tag, ds, data_slab_type2str(ds), gstr->str);
	g_string_free(gstr, TRUE);
}
示例#4
0
static void
_reload_srvtype(const char *type)
{
	CSURL(cs);

	GSList *list = NULL;
	GError *err = conscience_remote_get_services (cs, type, FALSE, &list);
	if (err) {
		GRID_WARN("Services listing error for type[%s]: code=%d %s",
				type, err->code, err->message);
		g_clear_error(&err);
		return;
	}

	if (GRID_TRACE_ENABLED()) {
		GRID_TRACE ("SRV loaded %u [%s]", g_slist_length(list), type);
	}

	/* reloads the known services */
	gulong now = oio_ext_monotonic_seconds ();
	SRV_WRITE(for (GSList *l=list; l ;l=l->next) {
		gchar *k = service_info_key (l->data);
		lru_tree_insert (srv_known, k, (void*)now);
	});