linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: avoid rebuilding i915_gpu_error.o on version string updates
@ 2018-11-21  9:54 Hans Holmberg
  2018-11-21 10:05 ` Jani Nikula
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Hans Holmberg @ 2018-11-21  9:54 UTC (permalink / raw)
  To: David Airlie
  Cc: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, intel-gfx,
	linux-kernel, Hans Holmberg

From: Hans Holmberg <hans.holmberg@cnexlabs.com>

There is no need to rebuild i915_gpu_error.o when the version string
changes as the version is available in init_utsname()->release.

Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com>
---
 drivers/gpu/drm/i915/i915_gpu_error.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index 8762d17b6659..958e1484a3dd 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -27,7 +27,7 @@
  *
  */
 
-#include <generated/utsrelease.h>
+#include <linux/utsname.h>
 #include <linux/stop_machine.h>
 #include <linux/zlib.h>
 #include <drm/drm_print.h>
@@ -650,7 +650,7 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
 
 	if (*error->error_msg)
 		err_printf(m, "%s\n", error->error_msg);
-	err_printf(m, "Kernel: " UTS_RELEASE "\n");
+	err_printf(m, "Kernel: %s\n", init_utsname()->release);
 	ts = ktime_to_timespec64(error->time);
 	err_printf(m, "Time: %lld s %ld us\n",
 		   (s64)ts.tv_sec, ts.tv_nsec / NSEC_PER_USEC);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/i915: avoid rebuilding i915_gpu_error.o on version string updates
  2018-11-21  9:54 [PATCH] drm/i915: avoid rebuilding i915_gpu_error.o on version string updates Hans Holmberg
@ 2018-11-21 10:05 ` Jani Nikula
  2018-11-21 10:10 ` Joonas Lahtinen
  2018-11-21 10:16 ` Chris Wilson
  2 siblings, 0 replies; 6+ messages in thread
From: Jani Nikula @ 2018-11-21 10:05 UTC (permalink / raw)
  To: Hans Holmberg, David Airlie
  Cc: Joonas Lahtinen, Rodrigo Vivi, intel-gfx, linux-kernel, Hans Holmberg

On Wed, 21 Nov 2018, Hans Holmberg <hans.ml.holmberg@owltronix.com> wrote:
> From: Hans Holmberg <hans.holmberg@cnexlabs.com>
>
> There is no need to rebuild i915_gpu_error.o when the version string
> changes as the version is available in init_utsname()->release.
>
> Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com>

Nice!

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/i915_gpu_error.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
> index 8762d17b6659..958e1484a3dd 100644
> --- a/drivers/gpu/drm/i915/i915_gpu_error.c
> +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> @@ -27,7 +27,7 @@
>   *
>   */
>  
> -#include <generated/utsrelease.h>
> +#include <linux/utsname.h>
>  #include <linux/stop_machine.h>
>  #include <linux/zlib.h>
>  #include <drm/drm_print.h>
> @@ -650,7 +650,7 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
>  
>  	if (*error->error_msg)
>  		err_printf(m, "%s\n", error->error_msg);
> -	err_printf(m, "Kernel: " UTS_RELEASE "\n");
> +	err_printf(m, "Kernel: %s\n", init_utsname()->release);
>  	ts = ktime_to_timespec64(error->time);
>  	err_printf(m, "Time: %lld s %ld us\n",
>  		   (s64)ts.tv_sec, ts.tv_nsec / NSEC_PER_USEC);

-- 
Jani Nikula, Intel Open Source Graphics Center

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/i915: avoid rebuilding i915_gpu_error.o on version string updates
  2018-11-21  9:54 [PATCH] drm/i915: avoid rebuilding i915_gpu_error.o on version string updates Hans Holmberg
  2018-11-21 10:05 ` Jani Nikula
@ 2018-11-21 10:10 ` Joonas Lahtinen
  2018-11-21 11:35   ` Hans Holmberg
  2018-11-21 10:16 ` Chris Wilson
  2 siblings, 1 reply; 6+ messages in thread
From: Joonas Lahtinen @ 2018-11-21 10:10 UTC (permalink / raw)
  To: David Airlie, Hans Holmberg
  Cc: Jani Nikula, Rodrigo Vivi, intel-gfx, linux-kernel, Hans Holmberg

Quoting Hans Holmberg (2018-11-21 11:54:23)
> From: Hans Holmberg <hans.holmberg@cnexlabs.com>
> 
> There is no need to rebuild i915_gpu_error.o when the version string
> changes as the version is available in init_utsname()->release.
> 
> Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com>

Seems reasonable to me.

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Out of curiosity, are you by any chance hashing the i915_gpu_error.o
file (or the contents elsewhere) for some purpose?

Regards, Joonas

> ---
>  drivers/gpu/drm/i915/i915_gpu_error.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
> index 8762d17b6659..958e1484a3dd 100644
> --- a/drivers/gpu/drm/i915/i915_gpu_error.c
> +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> @@ -27,7 +27,7 @@
>   *
>   */
>  
> -#include <generated/utsrelease.h>
> +#include <linux/utsname.h>
>  #include <linux/stop_machine.h>
>  #include <linux/zlib.h>
>  #include <drm/drm_print.h>
> @@ -650,7 +650,7 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
>  
>         if (*error->error_msg)
>                 err_printf(m, "%s\n", error->error_msg);
> -       err_printf(m, "Kernel: " UTS_RELEASE "\n");
> +       err_printf(m, "Kernel: %s\n", init_utsname()->release);
>         ts = ktime_to_timespec64(error->time);
>         err_printf(m, "Time: %lld s %ld us\n",
>                    (s64)ts.tv_sec, ts.tv_nsec / NSEC_PER_USEC);
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/i915: avoid rebuilding i915_gpu_error.o on version string updates
  2018-11-21  9:54 [PATCH] drm/i915: avoid rebuilding i915_gpu_error.o on version string updates Hans Holmberg
  2018-11-21 10:05 ` Jani Nikula
  2018-11-21 10:10 ` Joonas Lahtinen
@ 2018-11-21 10:16 ` Chris Wilson
  2 siblings, 0 replies; 6+ messages in thread
From: Chris Wilson @ 2018-11-21 10:16 UTC (permalink / raw)
  To: David Airlie, Hans Holmberg
  Cc: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, intel-gfx,
	linux-kernel, Hans Holmberg

Quoting Hans Holmberg (2018-11-21 09:54:23)
> From: Hans Holmberg <hans.holmberg@cnexlabs.com>
> 
> There is no need to rebuild i915_gpu_error.o when the version string
> changes as the version is available in init_utsname()->release.
> 
> Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com>
> ---
>  drivers/gpu/drm/i915/i915_gpu_error.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
> index 8762d17b6659..958e1484a3dd 100644
> --- a/drivers/gpu/drm/i915/i915_gpu_error.c
> +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> @@ -27,7 +27,7 @@
>   *
>   */
>  
> -#include <generated/utsrelease.h>
> +#include <linux/utsname.h>
>  #include <linux/stop_machine.h>
>  #include <linux/zlib.h>
>  #include <drm/drm_print.h>
> @@ -650,7 +650,7 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
>  
>         if (*error->error_msg)
>                 err_printf(m, "%s\n", error->error_msg);
> -       err_printf(m, "Kernel: " UTS_RELEASE "\n");
> +       err_printf(m, "Kernel: %s\n", init_utsname()->release);

Should we take some more info from init_utsname, plagiarising
dump_stack,

	err_printf(m, :Kernel: %s %.*s\n",
		   init_utsname()->release,
		   (int)strcspn(init_utsname()->version, " "),
		   init_utsname()->version);

-Chris

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/i915: avoid rebuilding i915_gpu_error.o on version string updates
  2018-11-21 10:10 ` Joonas Lahtinen
@ 2018-11-21 11:35   ` Hans Holmberg
  2018-11-21 12:37     ` Joonas Lahtinen
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Holmberg @ 2018-11-21 11:35 UTC (permalink / raw)
  To: Joonas Lahtinen
  Cc: David Airlie, Jani Nikula, Rodrigo Vivi, intel-gfx,
	Linux Kernel Mailing List, Hans Holmberg

On Wed, Nov 21, 2018 at 11:10 AM Joonas Lahtinen
<joonas.lahtinen@linux.intel.com> wrote:
>
> Quoting Hans Holmberg (2018-11-21 11:54:23)
> > From: Hans Holmberg <hans.holmberg@cnexlabs.com>
> >
> > There is no need to rebuild i915_gpu_error.o when the version string
> > changes as the version is available in init_utsname()->release.
> >
> > Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com>
>
> Seems reasonable to me.
>
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>
> Out of curiosity, are you by any chance hashing the i915_gpu_error.o
> file (or the contents elsewhere) for some purpose?

Oh no, I was just moderately annoyed by the file being rebuilt every
time the version was updated(I use my current branch name as
LOCALVERSION when building).

Thanks,
Hans
>
> Regards, Joonas
>
> > ---
> >  drivers/gpu/drm/i915/i915_gpu_error.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
> > index 8762d17b6659..958e1484a3dd 100644
> > --- a/drivers/gpu/drm/i915/i915_gpu_error.c
> > +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> > @@ -27,7 +27,7 @@
> >   *
> >   */
> >
> > -#include <generated/utsrelease.h>
> > +#include <linux/utsname.h>
> >  #include <linux/stop_machine.h>
> >  #include <linux/zlib.h>
> >  #include <drm/drm_print.h>
> > @@ -650,7 +650,7 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
> >
> >         if (*error->error_msg)
> >                 err_printf(m, "%s\n", error->error_msg);
> > -       err_printf(m, "Kernel: " UTS_RELEASE "\n");
> > +       err_printf(m, "Kernel: %s\n", init_utsname()->release);
> >         ts = ktime_to_timespec64(error->time);
> >         err_printf(m, "Time: %lld s %ld us\n",
> >                    (s64)ts.tv_sec, ts.tv_nsec / NSEC_PER_USEC);
> > --
> > 2.17.1
> >

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/i915: avoid rebuilding i915_gpu_error.o on version string updates
  2018-11-21 11:35   ` Hans Holmberg
@ 2018-11-21 12:37     ` Joonas Lahtinen
  0 siblings, 0 replies; 6+ messages in thread
From: Joonas Lahtinen @ 2018-11-21 12:37 UTC (permalink / raw)
  To: Hans Holmberg
  Cc: David Airlie, Jani Nikula, Rodrigo Vivi, intel-gfx,
	Linux Kernel Mailing List, Hans Holmberg

Quoting Hans Holmberg (2018-11-21 13:35:19)
> On Wed, Nov 21, 2018 at 11:10 AM Joonas Lahtinen
> <joonas.lahtinen@linux.intel.com> wrote:
> >
> > Quoting Hans Holmberg (2018-11-21 11:54:23)
> > > From: Hans Holmberg <hans.holmberg@cnexlabs.com>
> > >
> > > There is no need to rebuild i915_gpu_error.o when the version string
> > > changes as the version is available in init_utsname()->release.
> > >
> > > Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com>
> >
> > Seems reasonable to me.
> >
> > Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> >
> > Out of curiosity, are you by any chance hashing the i915_gpu_error.o
> > file (or the contents elsewhere) for some purpose?
> 
> Oh no, I was just moderately annoyed by the file being rebuilt every
> time the version was updated(I use my current branch name as
> LOCALVERSION when building).

That's a reasonable explanation, too :)

I unblocked the message from moderation queue so that our CI picks this
up for testing. I will then proceed to merge this once the results are
back.

Thanks for the patch!

Regards, Joonas

> 
> Thanks,
> Hans
> >
> > Regards, Joonas
> >
> > > ---
> > >  drivers/gpu/drm/i915/i915_gpu_error.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
> > > index 8762d17b6659..958e1484a3dd 100644
> > > --- a/drivers/gpu/drm/i915/i915_gpu_error.c
> > > +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> > > @@ -27,7 +27,7 @@
> > >   *
> > >   */
> > >
> > > -#include <generated/utsrelease.h>
> > > +#include <linux/utsname.h>
> > >  #include <linux/stop_machine.h>
> > >  #include <linux/zlib.h>
> > >  #include <drm/drm_print.h>
> > > @@ -650,7 +650,7 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
> > >
> > >         if (*error->error_msg)
> > >                 err_printf(m, "%s\n", error->error_msg);
> > > -       err_printf(m, "Kernel: " UTS_RELEASE "\n");
> > > +       err_printf(m, "Kernel: %s\n", init_utsname()->release);
> > >         ts = ktime_to_timespec64(error->time);
> > >         err_printf(m, "Time: %lld s %ld us\n",
> > >                    (s64)ts.tv_sec, ts.tv_nsec / NSEC_PER_USEC);
> > > --
> > > 2.17.1
> > >

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-11-21 12:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-21  9:54 [PATCH] drm/i915: avoid rebuilding i915_gpu_error.o on version string updates Hans Holmberg
2018-11-21 10:05 ` Jani Nikula
2018-11-21 10:10 ` Joonas Lahtinen
2018-11-21 11:35   ` Hans Holmberg
2018-11-21 12:37     ` Joonas Lahtinen
2018-11-21 10:16 ` Chris Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).