From: Joe Perches <joe@perches.com>
To: Jim Cromie <jim.cromie@gmail.com>,
jbaron@akamai.com, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] dyndbg: refine export, rename to dynamic_debug_exec_queries()
Date: Mon, 24 Aug 2020 12:09:55 -0700 [thread overview]
Message-ID: <1bf51283e26e6dd5f3c3e017d15cbb50dd84e507.camel@perches.com> (raw)
In-Reply-To: <20200824185412.1617174-3-jim.cromie@gmail.com>
On Mon, 2020-08-24 at 12:54 -0600, Jim Cromie wrote:
> commit 59cf47e7df31 dyndbg: export ddebug_exec_queries
> left a few configs broken, fix them with ifdef-stubs.
>
> Rename the export to dynamic_debug_exec_queries(). This is a more
> canonical function name, instead of exposing the 'ddebug' internal
> name prefix. Do this now, before export hits v5.9.0
>
> Implement as new function wrapping ddebug_exec_queries(now static
> again), which copies the query-string, preserving ddebug_exec_queries'
> in-place parsing, while allowing users to pass "const strings".
[]
> diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
[]
> @@ -210,6 +215,13 @@ static inline int ddebug_dyndbg_module_param_cb(char *param, char *val,
> print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, \
> rowsize, groupsize, buf, len, ascii); \
> } while (0)
> -#endif
> +
> +static inline int dynamic_debug_exec_queries(const char *query, const char *modname)
> +{
> + printk(KERN_WARNING "kernel not built w CONFIG_DYNAMIC_DEBUG_CORE\n");
pr_warn and w should be with
> diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
[]
> @@ -557,7 +557,27 @@ int ddebug_exec_queries(char *query, const char *modname)
> return exitcode;
> return nfound;
> }
> -EXPORT_SYMBOL_GPL(ddebug_exec_queries);
> +
> +/**
> + * dynamic_debug_exec_queries - apply changes to selected dynamic-debug prints
> + * @query: string with callsite-selectors +enablement+decorations
> + * @modname: string containing module name
> + *
> + * This implements the >/proc/dynamic_debug/control reader, allowing
> + * module authors to modify their dynamic-debug callsites. The modname
> + * is canonically struct module.mod_name, but can also be null or a
> + * module-wildcard, for example: "drm*".
> + */
> +int dynamic_debug_exec_queries(const char *query, const char *modname)
> +{
> + char *qry = kmalloc(PAGE_SIZE, GFP_KERNEL);
> + int rc;
> + strncpy(qry, query, PAGE_SIZE);
kstrndup?
next prev parent reply other threads:[~2020-08-24 19:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-24 18:54 [PATCH 0/3] dynamic-debug fixups for 5.9 Jim Cromie
2020-08-24 18:54 ` [PATCH 1/3] dyndbg: give %3u width in pr-format, cosmetic only Jim Cromie
2020-08-24 18:54 ` [PATCH 2/3] dyndbg: refine export, rename to dynamic_debug_exec_queries() Jim Cromie
2020-08-24 19:09 ` Joe Perches [this message]
2020-08-24 18:54 ` [PATCH 3/3] dyndbg: fix problem parsing format="foo bar" Jim Cromie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1bf51283e26e6dd5f3c3e017d15cbb50dd84e507.camel@perches.com \
--to=joe@perches.com \
--cc=gregkh@linuxfoundation.org \
--cc=jbaron@akamai.com \
--cc=jim.cromie@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®