Marcin Slusarz
2012-Sep-12 22:50 UTC
[Nouveau] [PATCH] drm/nouveau: add default debug level override
Useful when we don't know which subsystem is failing.
Signed-off-by: Marcin Slusarz <marcin.slusarz at gmail.com>
---
drivers/gpu/drm/nouveau/core/core/option.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/core/core/option.c
b/drivers/gpu/drm/nouveau/core/core/option.c
index 62a432e..fde06b0 100644
--- a/drivers/gpu/drm/nouveau/core/core/option.c
+++ b/drivers/gpu/drm/nouveau/core/core/option.c
@@ -22,9 +22,16 @@
* Authors: Ben Skeggs
*/
+#include <linux/module.h>
#include <core/option.h>
#include <core/debug.h>
+MODULE_PARM_DESC(debug_level, "nv_printk level (0-"
+ __stringify(CONFIG_NOUVEAU_DEBUG) ", default "
+ __stringify(CONFIG_NOUVEAU_DEBUG_DEFAULT) ")");
+static int nouveau_debug_level = CONFIG_NOUVEAU_DEBUG_DEFAULT;
+module_param_named(debug_level, nouveau_debug_level, int, 0400);
+
/* compares unterminated string 'str' with zero-terminated string
'cmp' */
static inline int
strncasecmpz(const char *str, const char *cmp, size_t len)
@@ -86,7 +93,7 @@ nouveau_boolopt(const char *optstr, const char *opt, bool
value)
int
nouveau_dbgopt(const char *optstr, const char *sub)
{
- int mode = 1, level = CONFIG_NOUVEAU_DEBUG_DEFAULT;
+ int mode = 1, level = nouveau_debug_level;
while (optstr) {
int len = strcspn(optstr, ",=");
--
1.7.12
Ben Skeggs
2012-Sep-13 02:09 UTC
[Nouveau] [PATCH] drm/nouveau: add default debug level override
On Thu, Sep 13, 2012 at 12:50:06AM +0200, Marcin Slusarz wrote:> Useful when we don't know which subsystem is failing.This is really unnecessary unless I'm missing something. You can pass nouveau.debug=LEVEL (without specifying a subdev name) to set the default already.> > Signed-off-by: Marcin Slusarz <marcin.slusarz at gmail.com> > --- > drivers/gpu/drm/nouveau/core/core/option.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/nouveau/core/core/option.c b/drivers/gpu/drm/nouveau/core/core/option.c > index 62a432e..fde06b0 100644 > --- a/drivers/gpu/drm/nouveau/core/core/option.c > +++ b/drivers/gpu/drm/nouveau/core/core/option.c > @@ -22,9 +22,16 @@ > * Authors: Ben Skeggs > */ > > +#include <linux/module.h> > #include <core/option.h> > #include <core/debug.h> > > +MODULE_PARM_DESC(debug_level, "nv_printk level (0-" > + __stringify(CONFIG_NOUVEAU_DEBUG) ", default " > + __stringify(CONFIG_NOUVEAU_DEBUG_DEFAULT) ")"); > +static int nouveau_debug_level = CONFIG_NOUVEAU_DEBUG_DEFAULT; > +module_param_named(debug_level, nouveau_debug_level, int, 0400); > + > /* compares unterminated string 'str' with zero-terminated string 'cmp' */ > static inline int > strncasecmpz(const char *str, const char *cmp, size_t len) > @@ -86,7 +93,7 @@ nouveau_boolopt(const char *optstr, const char *opt, bool value) > int > nouveau_dbgopt(const char *optstr, const char *sub) > { > - int mode = 1, level = CONFIG_NOUVEAU_DEBUG_DEFAULT; > + int mode = 1, level = nouveau_debug_level; > > while (optstr) { > int len = strcspn(optstr, ",="); > -- > 1.7.12 >
Maarten Lankhorst
2012-Sep-13 04:33 UTC
[Nouveau] [PATCH] drm/nouveau: add default debug level override
Hey, Op 13-09-12 00:50, Marcin Slusarz schreef:> Useful when we don't know which subsystem is failing. > > Signed-off-by: Marcin Slusarz <marcin.slusarz at gmail.com> > --- > drivers/gpu/drm/nouveau/core/core/option.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/nouveau/core/core/option.c b/drivers/gpu/drm/nouveau/core/core/option.c > index 62a432e..fde06b0 100644 > --- a/drivers/gpu/drm/nouveau/core/core/option.c > +++ b/drivers/gpu/drm/nouveau/core/core/option.c > @@ -22,9 +22,16 @@ > * Authors: Ben Skeggs > */ > > +#include <linux/module.h> > #include <core/option.h> > #include <core/debug.h> > > +MODULE_PARM_DESC(debug_level, "nv_printk level (0-" > + __stringify(CONFIG_NOUVEAU_DEBUG) ", default " > + __stringify(CONFIG_NOUVEAU_DEBUG_DEFAULT) ")"); > +static int nouveau_debug_level = CONFIG_NOUVEAU_DEBUG_DEFAULT; > +module_param_named(debug_level, nouveau_debug_level, int, 0400);Why make default 0400? 0600 or 0644 would make more sense.. ~Maarten
Possibly Parallel Threads
- HP Zbook17 Dock and UEFI conflict with GK107GLM aka Quadro K1100M
- HP Zbook17 Dock and UEFI conflict with GK107GLM aka Quadro K1100M
- [Bug 111853] New: nouveau kernel module won't load (not available) on Sony laptop with NVIDIA G86M [GeForce 8400M GT] ID: 10de:0426
- [PATCH] common/mltools: getopt: add Getopt.OptString
- [Bug 111853] nouveau kernel module won't load (not available) on Sony laptop with NVIDIA G86M [GeForce 8400M GT] ID: 10de:0426