[PATCH 05/13] drm: Add put callback for the coredump printer
Chris Wilson
chris at chris-wilson.co.uk
Thu Jul 12 19:43:19 UTC 2018
Quoting Jordan Crouse (2018-07-12 19:59:22)
> Add a put function for the coredump printer to bypass printf()
> for constant strings for a speed boost.
>
> v2: Add EXPORT_SYMBOL for _drm_puts_coredump
> Signed-off-by: Jordan Crouse <jcrouse at codeaurora.org>
> ---
> drivers/gpu/drm/drm_print.c | 43 +++++++++++++++++++++++++++++++++++++
> include/drm/drm_print.h | 2 ++
> 2 files changed, 45 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c
> index bef8f0ec5d73..ff20f4a764c8 100644
> --- a/drivers/gpu/drm/drm_print.c
> +++ b/drivers/gpu/drm/drm_print.c
> @@ -30,6 +30,49 @@
> #include <drm/drmP.h>
> #include <drm/drm_print.h>
>
> +void __drm_puts_coredump(struct drm_printer *p, const char *str)
> +{
> + struct drm_print_iterator *iterator = p->arg;
> +
> + ssize_t len;
> +
> + if (!iterator->remain)
> + return;
> +
> + if (iterator->offset < iterator->start) {
> + ssize_t copy;
> +
> + len = strlen(str);
> +
printfn_coredump looks like it would then wrap puts_coredump?
-Chris
More information about the dri-devel
mailing list