Re: [PATCH 03/21] dynamic_debug: process multiple commands on a line

From: Bart Van Assche
Date: Tue Jul 12 2011 - 01:54:43 EST


On Mon, Jul 11, 2011 at 9:46 AM, Jim Cromie <jim.cromie@xxxxxxxxx> 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.
>
> Signed-off-by: Jim Cromie <jim.cromie@xxxxxxxxx>
> ---
>  lib/dynamic_debug.c |   30 ++++++++++++++++++++++++++++--
>  1 files changed, 28 insertions(+), 2 deletions(-)
>
> diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
> index 1597d5a..ae72402 100644
> --- a/lib/dynamic_debug.c
> +++ b/lib/dynamic_debug.c
> @@ -423,6 +423,32 @@ static int ddebug_exec_query(char *query_string)
>        return 0;
>  }
>
> +/* handle multiple queries, continue on error, return last error */
> +static int ddebug_exec_queries(char *query)
> +{
> +       char *split;
> +       int i, errs = 0, exitcode = 0, rc;
> +
> +       for (i = 0; query; query = split, i++) {
> +               split = strchr(query, ';');
> +               if (split)
> +                       *split++ = '\0';
> +
> +               if (verbose)
> +                       pr_info("query %d: \"%s\"\n", i, query);
> +
> +               rc = ddebug_exec_query(query);
> +               if (rc) {
> +                       errs++;
> +                       exitcode = rc;
> +               }
> +       }
> +       if (verbose)
> +               pr_info("processed %d queries, with %d errs\n", i, errs);
> +
> +       return exitcode;
> +}
> +

Does the above mean that semicolon is considered a valid separator but
newline not ?

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