From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH] drm: Don't split up debug output Date: Mon, 18 Nov 2013 11:55:39 +0100 Message-ID: <20131118105538.GA8646@ulmo.nvidia.com> References: <1384723502-13398-1-git-send-email-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0259484473==" Return-path: In-Reply-To: <1384723502-13398-1-git-send-email-daniel.vetter@ffwll.ch> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Daniel Vetter Cc: Intel Graphics Development , DRI Development List-Id: intel-gfx@lists.freedesktop.org --===============0259484473== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zhXaljGHf11kAtnf" Content-Disposition: inline --zhXaljGHf11kAtnf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 17, 2013 at 10:25:02PM +0100, Daniel Vetter wrote: > Otherwise we risk that the 2nd part of the line ends up on a line of > it's own, which means a kernel dmesg line without a log level. This > then upsets the dmesg checker in piglit. >=20 > Only really happens in some of the truly nasty igt testcases which > race cache dropping (through debugfs) with other gem operations. >=20 > Signed-off-by: Daniel Vetter > --- > drivers/gpu/drm/drm_stub.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c > index f53d5246979c..74e0357c1c38 100644 > --- a/drivers/gpu/drm/drm_stub.c > +++ b/drivers/gpu/drm/drm_stub.c > @@ -99,13 +99,19 @@ void drm_ut_debug_printk(unsigned int request_level, > const char *function_name, > const char *format, ...) > { > + struct va_format vaf; > va_list args; > =20 > if (drm_debug & request_level) { > - if (function_name) > - printk(KERN_DEBUG "[%s:%s], ", prefix, function_name); > va_start(args, format); > - vprintk(format, args); > + vaf.fmt =3D format; > + vaf.va =3D &args; > + > + if (function_name) > + printk(KERN_DEBUG "[%s:%s], %pV", prefix, > + function_name, &vaf); > + else > + printk(KERN_DEBUG "%pV", &vaf); > va_end(args); > } > } According to Documentation/printk-formats.txt, usage of %pV is not recommended unless the format string and va_list can be properly verified for correctness. I guess we leave it up to the compiler to do that verification using the __printf() annotation, so I think it should be fine to use it here: Reviewed-by: Thierry Reding --zhXaljGHf11kAtnf Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJSifIqAAoJEN0jrNd/PrOh/fUP/RCM4oiH5B/3x/XUg3j6W7L5 WlH02PbeqwKZ0dVx6Ox65Q5KjMnEFqt24954teMwuP3BAV88uQv848CL3KPBit4q XDRXtSj8uQltg4VdPQ3Rilf4RoADCVZDdYHbreeQSuI1h3Itm1GTYOKsjfuAGacf lTm6NTUcC3PUQM3yeJeC4n5Q/blURHgOurGIOhpn3IuBLeTvbC6l3wihaBfrLBww uMGNIjPz/MPaMjVPatM0bQaboO5FmZtLzLul6DoXcKW9w0VJnEIcFWs+0EbWBvpl dcpe/ehHj0uI9s1vWi80s031oUr4K+BB4e0b7Y4Vu4hNroxZhEDmlQ/8z8OIAaV2 NdlWTNMsASSccAYw+hD9s3icfab/oQNmoaAT5EBW5Gz/9oDVsnN9CD/rrKudLzoY bOKmiXqKGwxk6E/1NYXPE9W+XIXEzelS1af8Dv+v4+uIyf6/4qGdNuzmgLaFkltC a/cKPKPtkm4AIp8exJ2T9PYOtBrvWHt+838+cmixb4pTJ5+KdC3h/r3iFFAQvspS zCDo9IV0uxIAt7YKmpJ1tWL0duDNvS2JzPBoH5QDBHjxzs1D0UlqeVtQFkjKrB9W I/HNt8Djhon7uiV9YnT+MnBHPL8oa12RK2EbrFw0jy7TFG99it04JeGGTEOMTtAQ E4yyhJ1QkvxchfY/Dnwv =DLGC -----END PGP SIGNATURE----- --zhXaljGHf11kAtnf-- --===============0259484473== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============0259484473==--