@@ -119,11 +119,7 @@ static ssize_t __xe_devcoredump_read(char *buffer, size_t count,
119119 drm_puts (& p , "\n**** GuC CT ****\n" );
120120 xe_guc_ct_snapshot_print (ss -> guc .ct , & p );
121121
122- /*
123- * Don't add a new section header here because the mesa debug decoder
124- * tool expects the context information to be in the 'GuC CT' section.
125- */
126- /* drm_puts(&p, "\n**** Contexts ****\n"); */
122+ drm_puts (& p , "\n**** Contexts ****\n" );
127123 xe_guc_exec_queue_snapshot_print (ss -> ge , & p );
128124
129125 drm_puts (& p , "\n**** Job ****\n" );
@@ -395,42 +391,34 @@ int xe_devcoredump_init(struct xe_device *xe)
395391/**
396392 * xe_print_blob_ascii85 - print a BLOB to some useful location in ASCII85
397393 *
398- * The output is split to multiple lines because some print targets, e.g. dmesg
399- * cannot handle arbitrarily long lines. Note also that printing to dmesg in
400- * piece-meal fashion is not possible, each separate call to drm_puts() has a
401- * line-feed automatically added! Therefore, the entire output line must be
402- * constructed in a local buffer first, then printed in one atomic output call.
394+ * The output is split into multiple calls to drm_puts() because some print
395+ * targets, e.g. dmesg, cannot handle arbitrarily long lines. These targets may
396+ * add newlines, as is the case with dmesg: each drm_puts() call creates a
397+ * separate line.
403398 *
404399 * There is also a scheduler yield call to prevent the 'task has been stuck for
405400 * 120s' kernel hang check feature from firing when printing to a slow target
406401 * such as dmesg over a serial port.
407402 *
408- * TODO: Add compression prior to the ASCII85 encoding to shrink huge buffers down.
409- *
410403 * @p: the printer object to output to
411404 * @prefix: optional prefix to add to output string
405+ * @suffix: optional suffix to add at the end. 0 disables it and is
406+ * not added to the output, which is useful when using multiple calls
407+ * to dump data to @p
412408 * @blob: the Binary Large OBject to dump out
413409 * @offset: offset in bytes to skip from the front of the BLOB, must be a multiple of sizeof(u32)
414410 * @size: the size in bytes of the BLOB, must be a multiple of sizeof(u32)
415411 */
416- void xe_print_blob_ascii85 (struct drm_printer * p , const char * prefix ,
412+ void xe_print_blob_ascii85 (struct drm_printer * p , const char * prefix , char suffix ,
417413 const void * blob , size_t offset , size_t size )
418414{
419415 const u32 * blob32 = (const u32 * )blob ;
420416 char buff [ASCII85_BUFSZ ], * line_buff ;
421417 size_t line_pos = 0 ;
422418
423- /*
424- * Splitting blobs across multiple lines is not compatible with the mesa
425- * debug decoder tool. Note that even dropping the explicit '\n' below
426- * doesn't help because the GuC log is so big some underlying implementation
427- * still splits the lines at 512K characters. So just bail completely for
428- * the moment.
429- */
430- return ;
431-
432419#define DMESG_MAX_LINE_LEN 800
433- #define MIN_SPACE (ASCII85_BUFSZ + 2) /* 85 + "\n\0" */
420+ /* Always leave space for the suffix char and the \0 */
421+ #define MIN_SPACE (ASCII85_BUFSZ + 2) /* 85 + "<suffix>\0" */
434422
435423 if (size & 3 )
436424 drm_printf (p , "Size not word aligned: %zu" , size );
@@ -462,7 +450,6 @@ void xe_print_blob_ascii85(struct drm_printer *p, const char *prefix,
462450 line_pos += strlen (line_buff + line_pos );
463451
464452 if ((line_pos + MIN_SPACE ) >= DMESG_MAX_LINE_LEN ) {
465- line_buff [line_pos ++ ] = '\n' ;
466453 line_buff [line_pos ++ ] = 0 ;
467454
468455 drm_puts (p , line_buff );
@@ -474,10 +461,11 @@ void xe_print_blob_ascii85(struct drm_printer *p, const char *prefix,
474461 }
475462 }
476463
464+ if (suffix )
465+ line_buff [line_pos ++ ] = suffix ;
466+
477467 if (line_pos ) {
478- line_buff [line_pos ++ ] = '\n' ;
479468 line_buff [line_pos ++ ] = 0 ;
480-
481469 drm_puts (p , line_buff );
482470 }
483471
0 commit comments