lkml.org 
[lkml]   [2011]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 03/11] dynamic_debug: process multiple commands on a line
On Wed, Jun 29, 2011 at 4:50 AM, Bart Van Assche <bvanassche@acm.org> wrote:
> On Tue, Jun 28, 2011 at 9:09 AM, Jim Cromie <jim.cromie@gmail.com> wrote:
>> Process multiple commands per line, separated by ';'.  All commands are
>> processed, independent of errors, allowing individual commands to fail,
>> for example when a module is not installed.  Last error code is returned.
>> With this, extensive command sets can be given on the boot-line.
>> +/* handle multiple queries, continue on error, return last error */
>> +static int ddebug_exec_queries(char *query)
>> +{
>> +       char *split = query;
>> +       int i, errs = 0, exitcode = 0, rc;
>> +
>> +       if (verbose)
>> +               /* clean up for logging */
>> +               for (; (split = strpbrk(split, "\t\n")); split++)
>> +                       *split = ' ';
>
> The above will join multiple lines into a single line and hence will
> cause a shell statement like the one below to be interpret as a single
> query:
>

oof.
I got impression from Documentation/dynamic-debug-howto.txt
that multiple commands were not supported. Hence this change
in patch 3:

-Commands are bounded by a write() system call. If you want to do
-multiple commands you need to do a separate "echo" for each, like:
+Commands are bounded by a write() system call. Subject to this limit
+(or 1024 for boot-line parameter) you can send multiple commands,
+separated by ';'

Clearly by your example it is possible.
I'll remove those lines, they were for pretty debug messages anyway.

FWIW, using \n to separate multiple commands doesnt work
on kernel bootline (in mainline); the following kills the ddebug facility
(see 0007-dynamic_debug-dont-kill-entire-facility-on-error-par.patch)

root@voyage:~# more /proc/cmdline
root=LABEL=ROOT_FS console=ttyS0,115200n8 all_generic_ide \
ide_core.nodma=0.0 \
ddebug_query="module init_32 +p\n module suspend +p\n module freezer +p"

>
>> +       for (i = 0; query; query = split, i++) {
>> +
>
> No blank line past "for" please.

ack. will fix.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-07-05 18:15    [W:0.298 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site