Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304057
b: refs/heads/master
c: 8e59b5c
h: refs/heads/master
i:
  304055: 4c282ad
v: v3
  • Loading branch information
Jim Cromie authored and Greg Kroah-Hartman committed Apr 30, 2012
1 parent 4679884 commit 9a713eb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4107692760db8160a65347f7bb2fa7fa7bf9b0d1
refs/heads/master: 8e59b5cfb9a6f43753236b554d785e8efca62db7
21 changes: 13 additions & 8 deletions trunk/lib/dynamic_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ static int check_set(const char **dest, char *src, char *name)
* Returns 0 on success, <0 on error.
*/
static int ddebug_parse_query(char *words[], int nwords,
struct ddebug_query *query)
struct ddebug_query *query, const char *modname)
{
unsigned int i;
int rc;
Expand All @@ -348,6 +348,10 @@ static int ddebug_parse_query(char *words[], int nwords,
return -EINVAL;
memset(query, 0, sizeof(*query));

if (modname)
/* support $modname.dyndbg=<multiple queries> */
query->module = modname;

for (i = 0 ; i < nwords ; i += 2) {
if (!strcmp(words[i], "func"))
rc = check_set(&query->function, words[i+1], "func");
Expand Down Expand Up @@ -444,7 +448,7 @@ static int ddebug_parse_flags(const char *str, unsigned int *flagsp,
return 0;
}

static int ddebug_exec_query(char *query_string)
static int ddebug_exec_query(char *query_string, const char *modname)
{
unsigned int flags = 0, mask = 0;
struct ddebug_query query;
Expand All @@ -455,7 +459,7 @@ static int ddebug_exec_query(char *query_string)
nwords = ddebug_tokenize(query_string, words, MAXWORDS);
if (nwords <= 0)
return -EINVAL;
if (ddebug_parse_query(words, nwords-1, &query))
if (ddebug_parse_query(words, nwords-1, &query, modname))
return -EINVAL;
if (ddebug_parse_flags(words[nwords-1], &flags, &mask))
return -EINVAL;
Expand All @@ -471,7 +475,7 @@ static int ddebug_exec_query(char *query_string)
last error or number of matching callsites. Module name is either
in param (for boot arg) or perhaps in query string.
*/
static int ddebug_exec_queries(char *query)
static int ddebug_exec_queries(char *query, const char *modname)
{
char *split;
int i, errs = 0, exitcode = 0, rc, nfound = 0;
Expand All @@ -487,7 +491,7 @@ static int ddebug_exec_queries(char *query)

vpr_info("query %d: \"%s\"\n", i, query);

rc = ddebug_exec_query(query);
rc = ddebug_exec_query(query, modname);
if (rc < 0) {
errs++;
exitcode = rc;
Expand Down Expand Up @@ -652,7 +656,7 @@ static ssize_t ddebug_proc_write(struct file *file, const char __user *ubuf,
tmpbuf[len] = '\0';
vpr_info("read %d bytes from userspace\n", (int)len);

ret = ddebug_exec_queries(tmpbuf);
ret = ddebug_exec_queries(tmpbuf, NULL);
kfree(tmpbuf);
if (ret < 0)
return ret;
Expand Down Expand Up @@ -878,7 +882,8 @@ static int ddebug_dyndbg_param_cb(char *param, char *val,
if (strcmp(param, "dyndbg"))
return on_err; /* determined by caller */

ddebug_exec_queries(val ? val : "+p");
ddebug_exec_queries((val ? val : "+p"), modname);

return 0; /* query failure shouldnt stop module load */
}

Expand Down Expand Up @@ -1011,7 +1016,7 @@ static int __init dynamic_debug_init(void)
if (ddebug_setup_string[0] != '\0') {
pr_warn("ddebug_query param name is deprecated,"
" change it to dyndbg\n");
ret = ddebug_exec_queries(ddebug_setup_string);
ret = ddebug_exec_queries(ddebug_setup_string, NULL);
if (ret < 0)
pr_warn("Invalid ddebug boot param %s",
ddebug_setup_string);
Expand Down

0 comments on commit 9a713eb

Please sign in to comment.