コード例 #1
0
ファイル: zfcp_dbf.c プロジェクト: 3sOx/asuswrt-merlin
static int
zfcp_hba_dbf_view_format(debug_info_t * id, struct debug_view *view,
			 char *out_buf, const char *in_buf)
{
	struct zfcp_hba_dbf_record *rec = (struct zfcp_hba_dbf_record *)in_buf;
	int len = 0;

	if (strncmp(rec->tag, "dump", ZFCP_DBF_TAG_SIZE) == 0)
		return 0;

	len += zfcp_dbf_tag(out_buf + len, "tag", rec->tag);
	if (isalpha(rec->tag2[0]))
		len += zfcp_dbf_tag(out_buf + len, "tag2", rec->tag2);
	if (strncmp(rec->tag, "resp", ZFCP_DBF_TAG_SIZE) == 0)
		len += zfcp_hba_dbf_view_response(out_buf + len,
						  &rec->type.response);
	else if (strncmp(rec->tag, "stat", ZFCP_DBF_TAG_SIZE) == 0)
		len += zfcp_hba_dbf_view_status(out_buf + len,
						&rec->type.status);
	else if (strncmp(rec->tag, "qdio", ZFCP_DBF_TAG_SIZE) == 0)
		len += zfcp_hba_dbf_view_qdio(out_buf + len, &rec->type.qdio);

	len += sprintf(out_buf + len, "\n");

	return len;
}
コード例 #2
0
static int zfcp_hba_dbf_view_format(debug_info_t *id, struct debug_view *view,
				    char *out_buf, const char *in_buf)
{
	struct zfcp_hba_dbf_record *r = (struct zfcp_hba_dbf_record *)in_buf;
	char *p = out_buf;

	if (strncmp(r->tag, "dump", ZFCP_DBF_TAG_SIZE) == 0)
		return 0;

	zfcp_dbf_tag(&p, "tag", r->tag);
	if (isalpha(r->tag2[0]))
		zfcp_dbf_tag(&p, "tag2", r->tag2);

	if (strncmp(r->tag, "resp", ZFCP_DBF_TAG_SIZE) == 0)
		zfcp_hba_dbf_view_response(&p, &r->u.response);
	else if (strncmp(r->tag, "stat", ZFCP_DBF_TAG_SIZE) == 0)
		zfcp_hba_dbf_view_status(&p, &r->u.status);
	else if (strncmp(r->tag, "qdio", ZFCP_DBF_TAG_SIZE) == 0)
		zfcp_hba_dbf_view_qdio(&p, &r->u.qdio);
	else if (strncmp(r->tag, "berr", ZFCP_DBF_TAG_SIZE) == 0)
		zfcp_hba_dbf_view_berr(&p, &r->u.berr);

	if (strncmp(r->tag, "resp", ZFCP_DBF_TAG_SIZE) != 0)
		p += sprintf(p, "\n");
	return p - out_buf;
}