Lines Matching defs:buf
15 * @buf: the buffer to use
21 char *hl_format_as_binary(char *buf, size_t buf_len, u32 n)
26 char *wrptr = buf;
30 return buf;
54 return buf;
59 * @buf: destination buffer double pointer
67 static int resize_to_fit(char **buf, size_t *size, size_t desired_size)
80 memcpy(resized_buf, *buf, *size);
81 vfree(*buf);
82 *buf = resized_buf;
90 * @buf: buffer double pointer, to be written to and resized, must be either
105 int hl_snprintf_resize(char **buf, size_t *size, size_t *offset,
112 if (*buf == NULL && (*size != 0 || *offset != 0))
116 length = vsnprintf(*buf + *offset, *size - *offset, format, args);
119 rc = resize_to_fit(buf, size, *offset + length + 1);
125 length = vsnprintf(*buf + *offset, *size - *offset, format,
157 * @buf: destination buffer double pointer to be used with hl_snprintf_resize
165 static int hl_print_resize_sync_engine(char **buf, size_t *size, size_t *offset,
169 return hl_snprintf_resize(buf, size, offset, "%s%u",
301 * @buf: destination buffer double pointer to be used with hl_snprintf_resize
310 char **buf, size_t *size, size_t *offset,
320 buf, size, offset, "%s\n",
343 rc = hl_snprintf_resize(buf, size, offset, "sync id: %u", i);
348 rc = hl_snprintf_resize(buf, size, offset, " %s",
353 rc = hl_snprintf_resize(buf, size, offset, ", value: %u",
362 rc = hl_snprintf_resize(buf, size, offset,
366 rc = hl_print_resize_sync_engine(buf, size, offset,
373 rc = hl_snprintf_resize(buf, size, offset, "\n");
387 * @buf: destination buffer double pointer to be used with hl_snprintf_resize
394 char **buf, size_t *size,
411 rc = hl_snprintf_resize(buf, size, offset, "Non zero sync objects:\n");
418 hdev, index, buf, size, offset, map);
425 hdev, index, buf, size, offset, map);
504 * @buf: destination buffer double pointer to be used with hl_snprintf_resize
512 char **buf, size_t *size,
521 buf, size, offset, "%s\n",
538 rc = sds->funcs.print_single_monitor(buf, size, offset, hdev,
543 hl_snprintf_resize(buf, size, offset, "\n");
555 * @buf: destination buffer double pointer to be used with hl_snprintf_resize
562 char **buf, size_t *size,
569 rc = hl_snprintf_resize(buf, size, offset,
577 hdev, index, buf, size, offset);
584 hdev, index, buf, size, offset);
599 * @buf: destination buffer double pointer to be used with hl_snprintf_resize
606 char **buf, size_t *size, size_t *offset)
638 engine_type, i, buf, size, offset);
649 * @buf: destination buffer double pointer to be used with hl_snprintf_resize
653 static int hl_state_dump_print_fences(struct hl_device *hdev, char **buf,
658 rc = hl_snprintf_resize(buf, size, offset, "Valid (armed) fences:\n");
662 rc = hl_state_dump_print_engine_fences(hdev, ENGINE_TPC, buf, size, offset);
666 rc = hl_state_dump_print_engine_fences(hdev, ENGINE_MME, buf, size, offset);
670 rc = hl_state_dump_print_engine_fences(hdev, ENGINE_DMA, buf, size, offset);
684 char *buf = NULL;
688 rc = hl_snprintf_resize(&buf, &size, &offset,
694 rc = hl_state_dump_print_syncs(hdev, &buf, &size, &offset);
698 hl_snprintf_resize(&buf, &size, &offset, "\n");
700 rc = hl_state_dump_print_monitors(hdev, &buf, &size, &offset);
704 hl_snprintf_resize(&buf, &size, &offset, "\n");
706 rc = hl_state_dump_print_fences(hdev, &buf, &size, &offset);
710 hl_snprintf_resize(&buf, &size, &offset, "\n");
712 hl_debugfs_set_state_dump(hdev, buf, size);
716 vfree(buf);