linux-um archives
 help / color / mirror / Atom feed
* [uml-devel] patch/RFC: add bypass for "debug" parameter
@ 2004-02-08 21:53 Werner Almesberger
  2004-02-12 15:49 ` [uml-devel] " Jeff Dike
  0 siblings, 1 reply; 7+ messages in thread
From: Werner Almesberger @ 2004-02-08 21:53 UTC (permalink / raw)
  To: jdike; +Cc: user-mode-linux-devel

Since UML ursurps the "debug" parameter, we can't make the kernel
more verbose before user space runs. This patch adds a new option
"kernel" that has the same effect as the original "debug".

Slightly kludgy, but gets the job done :-)

The patch is for 2.6.1 with uml-patch-2.6.1-1.

- Werner

--- linux-2.6.1/arch/um/kernel/tt/tracer.c.orig	Sun Feb  8 18:15:18 2004
+++ linux-2.6.1/arch/um/kernel/tt/tracer.c	Sun Feb  8 18:44:51 2004
@@ -391,10 +391,19 @@
 {
 	char *next;
 
-	debug = 1;
-	*add = 0;
-	if(*line != '=') return(0);
-	line++;
+	if (!strncmp(line, "=kernel", 7)) {
+		*line = 0;
+		if (line[7] != ',')
+			return 0;
+		line += 8;
+		debug = 1;
+	}
+	else {
+		debug = 1;
+		*add = 0;
+		if(*line != '=') return(0);
+		line++;
+	}
 
 	while(line != NULL){
 		next = strchr(line, ',');
@@ -410,10 +419,15 @@
 }
 
 __uml_setup("debug", uml_debug_setup,
-"debug\n"
-"    Starts up the kernel under the control of gdb. See the \n"
-"    kernel debugging tutorial and the debugging session pages\n"
-"    at http://user-mode-linux.sourceforge.net/ for more information.\n\n"
+"debug[=kernel,go,parent]\n"
+"    \"debug=kernel\" changes the kernel log level such that debugging\n"
+"    printks are printed on the console. This is equivalent to the \"debug\"\n"
+"    option in a non-UML kernel. If \"debug=kernel\" is used with other\n"
+"    options, it must be the first option in the list.\n"
+"    The other options (or just plain \"debug\") start up the kernel under\n"
+"    the control of gdb. See the kernel debugging tutorial and the\n"
+"    debugging session pages at http://user-mode-linux.sourceforge.net/\n"
+"    for more information.\n\n"
 );
 
 static int __init uml_debugtrace_setup(char *line, int *add)

-- 
  _________________________________________________________________________
 / Werner Almesberger, Buenos Aires, Argentina     werner@almesberger.net /
/_http://www.almesberger.net/____________________________________________/


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

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

* [uml-devel] Re: patch/RFC: add bypass for "debug" parameter
  2004-02-08 21:53 [uml-devel] patch/RFC: add bypass for "debug" parameter Werner Almesberger
@ 2004-02-12 15:49 ` Jeff Dike
  2004-02-13  0:40   ` Werner Almesberger
  0 siblings, 1 reply; 7+ messages in thread
From: Jeff Dike @ 2004-02-12 15:49 UTC (permalink / raw)
  To: Werner Almesberger; +Cc: user-mode-linux-devel

On Sun, Feb 08, 2004 at 06:53:34PM -0300, Werner Almesberger wrote:
> Since UML ursurps the "debug" parameter, we can't make the kernel
> more verbose before user space runs. This patch adds a new option
> "kernel" that has the same effect as the original "debug".

Hummm, that was some bad planning on my part.

Would there be any loud screams of horror if I were to change the UML
'debug' switch to 'gdb' or something?  That would get rid of this clash
and eliminate the need for this patch.

If I don't hear sufficiently loud objections, I think I will go ahead and
do it.

				Jeff


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

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

* [uml-devel] Re: patch/RFC: add bypass for "debug" parameter
  2004-02-12 15:49 ` [uml-devel] " Jeff Dike
@ 2004-02-13  0:40   ` Werner Almesberger
  2004-02-13  9:53     ` Geert Uytterhoeven
  0 siblings, 1 reply; 7+ messages in thread
From: Werner Almesberger @ 2004-02-13  0:40 UTC (permalink / raw)
  To: Jeff Dike; +Cc: user-mode-linux-devel

Jeff Dike wrote:
> Would there be any loud screams of horror if I were to change the UML
> 'debug' switch to 'gdb' or something?

Only screams of joy from my side :-)

Perhaps a parameter to pass further parameters verbatim to the
kernel, i.e. something like the "--" some programs use, could
be useful too, just in case someone invents a configurable
"global debug buffer" or such.

- Werner

-- 
  _________________________________________________________________________
 / Werner Almesberger, Buenos Aires, Argentina     werner@almesberger.net /
/_http://www.almesberger.net/____________________________________________/


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

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

* Re: [uml-devel] Re: patch/RFC: add bypass for "debug" parameter
  2004-02-13  0:40   ` Werner Almesberger
@ 2004-02-13  9:53     ` Geert Uytterhoeven
  2004-02-13 17:15       ` Werner Almesberger
  0 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2004-02-13  9:53 UTC (permalink / raw)
  To: Werner Almesberger; +Cc: Jeff Dike, User-mode Linux Kernel Development

On Thu, 12 Feb 2004, Werner Almesberger wrote:
> Jeff Dike wrote:
> > Would there be any loud screams of horror if I were to change the UML
> > 'debug' switch to 'gdb' or something?
>
> Only screams of joy from my side :-)
>
> Perhaps a parameter to pass further parameters verbatim to the
> kernel, i.e. something like the "--" some programs use, could
> be useful too, just in case someone invents a configurable
> "global debug buffer" or such.

Be careful not to break the feature to pass all remaining arguments to init.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

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

* Re: [uml-devel] Re: patch/RFC: add bypass for "debug" parameter
  2004-02-13  9:53     ` Geert Uytterhoeven
@ 2004-02-13 17:15       ` Werner Almesberger
  2004-02-13 17:18         ` Geert Uytterhoeven
  0 siblings, 1 reply; 7+ messages in thread
From: Werner Almesberger @ 2004-02-13 17:15 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Jeff Dike, User-mode Linux Kernel Development

Geert Uytterhoeven wrote:
> Be careful not to break the feature to pass all remaining arguments to init.

Hmm, I don't see it. How does it work ?

- Werner

-- 
  _________________________________________________________________________
 / Werner Almesberger, Buenos Aires, Argentina     werner@almesberger.net /
/_http://www.almesberger.net/____________________________________________/


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

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

* Re: [uml-devel] Re: patch/RFC: add bypass for "debug" parameter
  2004-02-13 17:15       ` Werner Almesberger
@ 2004-02-13 17:18         ` Geert Uytterhoeven
  2004-02-13 18:43           ` Werner Almesberger
  0 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2004-02-13 17:18 UTC (permalink / raw)
  To: Werner Almesberger; +Cc: Jeff Dike, User-mode Linux Kernel Development

On Fri, 13 Feb 2004, Werner Almesberger wrote:
> Geert Uytterhoeven wrote:
> > Be careful not to break the feature to pass all remaining arguments to init.
>
> Hmm, I don't see it. How does it work ?

All kernel parameters that are not recognized by the kernel are passed to init
using its argv[].

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

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

* Re: [uml-devel] Re: patch/RFC: add bypass for "debug" parameter
  2004-02-13 17:18         ` Geert Uytterhoeven
@ 2004-02-13 18:43           ` Werner Almesberger
  0 siblings, 0 replies; 7+ messages in thread
From: Werner Almesberger @ 2004-02-13 18:43 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Jeff Dike, User-mode Linux Kernel Development

Geert Uytterhoeven wrote:
> All kernel parameters that are not recognized by the kernel are passed
> to init using its argv[].

Ah, that ! I thought you meant some well-hidden feature that
would work like "--", separating things parsed by the kernel
from those passed verbatim to init :)

No, there should be no problem. UML actually layers its
command-line parsing on top of the kernel part. Everything
not explicitly claimed by UML ends up on the (single) string
passed to the kernel, which is then processed in a separate
pass.

- Werner

-- 
  _________________________________________________________________________
 / Werner Almesberger, Buenos Aires, Argentina     werner@almesberger.net /
/_http://www.almesberger.net/____________________________________________/


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

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

end of thread, other threads:[~2004-02-13 18:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-08 21:53 [uml-devel] patch/RFC: add bypass for "debug" parameter Werner Almesberger
2004-02-12 15:49 ` [uml-devel] " Jeff Dike
2004-02-13  0:40   ` Werner Almesberger
2004-02-13  9:53     ` Geert Uytterhoeven
2004-02-13 17:15       ` Werner Almesberger
2004-02-13 17:18         ` Geert Uytterhoeven
2004-02-13 18:43           ` Werner Almesberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox