<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/lib/dynamic_debug.c, branch v3.4.40</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.4.40</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.4.40'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2012-01-24T20:50:36Z</updated>
<entry>
<title>dynamic_debug: process multiple debug-queries on a line</title>
<updated>2012-01-24T20:50:36Z</updated>
<author>
<name>Jim Cromie</name>
<email>jim.cromie@gmail.com</email>
</author>
<published>2011-12-19T22:13:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=85f7f6c0edb8414053d788229c97d5ecff21efab'/>
<id>urn:sha1:85f7f6c0edb8414053d788229c97d5ecff21efab</id>
<content type='text'>
Insert ddebug_exec_queries() in place of ddebug_exec_query().  It
splits the query string on [;\n], and calls ddebug_exec_query() on
each.  All queries are processed independent of errors, allowing a
query to fail, for example when a module is not installed.  Empty
lines and comments are skipped.  Errors are counted, and the last
error seen (negative) or the number of callsites found (0 or positive)
is returned.  Return code checks are altered accordingly.

With this, multiple queries can be given in ddebug_query, allowing
more selective enabling of callsites.  As a side effect, a set of
commands can be batched in:

	cat cmd-file &gt; $DBGMT/dynamic_debug/control

We dont want a ddebug_query syntax error to kill the dynamic debug
facility, so dynamic_debug_init() zeros ddebug_exec_queries()'s return
code after logging the appropriate message, so that ddebug tables are
preserved and $DBGMT/dynamic_debug/control file is created.  This
would be appropriate even without accepting multiple queries.

This patch also alters ddebug_change() to return number of callsites
matched (which typically is the same as number of callsites changed).
ddebug_exec_query() also returns the number found, or a negative value
if theres a parse error on the query.

Splitting on [;\n] prevents their use in format-specs, but selecting
callsites on punctuation is brittle anyway, meaningful and selective
substrings are more typical.

Note: splitting queries on ';' before handling trailing #comments
means that a ';' also terminates a comment, and text after the ';' is
treated as another query.  This trailing query will almost certainly
result in a parse error and thus have no effect other than the error
message.  The double corner case with unexpected results is:

     ddebug_query="func foo +p # enable foo ; +p"

Signed-off-by: Jim Cromie &lt;jim.cromie@gmail.com&gt;
Signed-off-by: Jason Baron &lt;jbaron@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>dynamic_debug: factor vpr_info_dq out of ddebug_parse_query</title>
<updated>2012-01-24T20:50:36Z</updated>
<author>
<name>Jim Cromie</name>
<email>jim.cromie@gmail.com</email>
</author>
<published>2011-12-19T22:13:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=574b3725e327531c70361d1a10b8dc8dd2b93590'/>
<id>urn:sha1:574b3725e327531c70361d1a10b8dc8dd2b93590</id>
<content type='text'>
Factor pr_info(query) out of ddebug_parse_query, into vpr_info_dq(),
for reuse later.  Also change the printed labels: file, func to agree
with the query-spec keywords accepted in the control file.  Pass ""
when string is null, to avoid "(null)" output from sprintf.  For
format print, use precision to skip last char, assuming its '\n', no
great harm if not, its a debug msg.

Signed-off-by: Jim Cromie &lt;jim.cromie@gmail.com&gt;
Signed-off-by: Jason Baron &lt;jbaron@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>dynamic_debug: add trim_prefix() to provide source-root relative paths</title>
<updated>2012-01-24T20:48:55Z</updated>
<author>
<name>Jim Cromie</name>
<email>jim.cromie@gmail.com</email>
</author>
<published>2011-12-19T22:13:12Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2b6783191da7211c88f98eb1a2bd2027bff36e30'/>
<id>urn:sha1:2b6783191da7211c88f98eb1a2bd2027bff36e30</id>
<content type='text'>
trim_prefix(path) skips past the absolute source path root, and
returns the pointer to the relative path from there.  It is used to
shorten the displayed path in $DBGMT/dynamic_debug/control via
ddebug_proc_show(), and in ddebug_change() to allow relative filenames
to be used in applied queries.  For example:

  ~# echo file kernel/freezer.c +p &gt; $DBGMT/dynamic_debug/control

  kernel/freezer.c:128 [freezer]cancel_freezing p "  clean up: %s\012"

trim_prefix(path) insures common prefix before trimming it, so
out-of-tree module paths are shown as full absolute paths.

Signed-off-by: Jim Cromie &lt;jim.cromie@gmail.com&gt;
Signed-off-by: Jason Baron &lt;jbaron@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>dynamic_debug: enlarge command/query write buffer</title>
<updated>2012-01-24T20:48:55Z</updated>
<author>
<name>Jim Cromie</name>
<email>jim.cromie@gmail.com</email>
</author>
<published>2011-12-19T22:13:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7281491c594e7b8501eb5dfcf6cd3724f8a1b5b0'/>
<id>urn:sha1:7281491c594e7b8501eb5dfcf6cd3724f8a1b5b0</id>
<content type='text'>
Current query write buffer is 256 bytes, on stack.  In comparison, the
ddebug_query boot-arg is 1024.  Allocate the buffer off heap, and
enlarge it to 4096 bytes, big enough for ~100 queries (at 40 bytes
each), and error out if not.  This makes it play nicely with large
query sets (to be added later).  The buffer should be enough for most
uses, and others should probably be split into subsets.

[jbaron@redhat.com: changed USER_BUF_PAGE from 4095 -&gt; 4096 ]
Signed-off-by: Jim Cromie &lt;jim.cromie@gmail.com&gt;
Signed-off-by: Jason Baron &lt;jbaron@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>dynamic_debug: chop off comments in ddebug_tokenize</title>
<updated>2012-01-24T20:48:54Z</updated>
<author>
<name>Jim Cromie</name>
<email>jim.cromie@gmail.com</email>
</author>
<published>2011-12-19T22:13:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8bd6026e88cb2eb1e60ee40c7a1a0786b2db6623'/>
<id>urn:sha1:8bd6026e88cb2eb1e60ee40c7a1a0786b2db6623</id>
<content type='text'>
If a token begins with #, the remainder of query string is a comment,
so drop it.  Doing it here avoids '#' in quoted strings.

Signed-off-by: Jim Cromie &lt;jim.cromie@gmail.com&gt;
Signed-off-by: Jason Baron &lt;jbaron@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>dynamic_debug: early return if _ddebug table is empty</title>
<updated>2012-01-24T20:48:54Z</updated>
<author>
<name>Jim Cromie</name>
<email>jim.cromie@gmail.com</email>
</author>
<published>2011-12-19T22:12:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b5b78f83854af15e04c63fdbc6efed9355afbe8f'/>
<id>urn:sha1:b5b78f83854af15e04c63fdbc6efed9355afbe8f</id>
<content type='text'>
If _ddebug table is empty (in a CONFIG_DYNAMIC_DEBUG build this
shouldn't happen), then warn (error?) and return early.  This skips
empty table scan and parsing of setup-string, including the pr_info
call noting the parse.  By inspection, copy return-code handling from
1st ddebug_add_module() callsite to 2nd.

Signed-off-by: Jim Cromie &lt;jim.cromie@gmail.com&gt;
Signed-off-by: Jason Baron &lt;jbaron@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>dynamic_debug: tighten up error checking on debug queries</title>
<updated>2012-01-24T20:48:53Z</updated>
<author>
<name>Jim Cromie</name>
<email>jim.cromie@gmail.com</email>
</author>
<published>2011-12-19T22:12:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=820874c75ea0d3a9c22d69d6eaad42a279d6756c'/>
<id>urn:sha1:820874c75ea0d3a9c22d69d6eaad42a279d6756c</id>
<content type='text'>
Issue error when a match-spec is given multiple times in a rule.
Previous code kept last one, but was silent about it.  Docs imply only
one is allowed by saying match-specs are ANDed together, given that
module M cannot match both A and B.  Also error when last_line &lt; 1st_line.

Signed-off-by: Jim Cromie &lt;jim.cromie@gmail.com&gt;
Signed-off-by: Jason Baron &lt;jbaron@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>dynamic_debug: describe_flags with '=[pmflt_]*'</title>
<updated>2012-01-24T20:48:52Z</updated>
<author>
<name>Jim Cromie</name>
<email>jim.cromie@gmail.com</email>
</author>
<published>2011-12-19T22:12:44Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5ca7d2a6c5e4f24dfe39e8383c6d32e61d95d16a'/>
<id>urn:sha1:5ca7d2a6c5e4f24dfe39e8383c6d32e61d95d16a</id>
<content type='text'>
Change describe_flags() to emit '=[pmflt_]+' for current callsite
flags, or just '=_' when they're disabled.  Having '=' in output
allows a more selective grep expression; in contrast '-' may appear
in filenames, line-ranges, and format-strings.  '=' also has better
mnemonics, saying; "the current setting is equal to &lt;flags&gt;".

This allows grep "=_" &lt;dbgfs&gt;/dynamic_debug/control to see disabled
callsites while avoiding the many occurrences of " = " seen in format
strings.

Enlarge flagsbufs to handle additional flag char, and alter
ddebug_parse_flags() to allow flags=0, so that user can turn off all
debug flags via:

  ~# echo =_ &gt; &lt;dbgfs&gt;/dynamic_debug/control

Signed-off-by: Jim Cromie &lt;jim.cromie@gmail.com&gt;
Signed-off-by: Jason Baron &lt;jbaron@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>dynamic_debug: drop explicit !=NULL checks</title>
<updated>2012-01-24T20:46:46Z</updated>
<author>
<name>Jim Cromie</name>
<email>jim.cromie@gmail.com</email>
</author>
<published>2011-12-19T22:12:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d6a238d25014d0ff918410d73e2a6300bca5d1f1'/>
<id>urn:sha1:d6a238d25014d0ff918410d73e2a6300bca5d1f1</id>
<content type='text'>
Convert 'if (x !=NULL)' checks into 'if (x)'.

Signed-off-by: Jim Cromie &lt;jim.cromie@gmail.com&gt;
Signed-off-by: Jason Baron &lt;jbaron@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>dynamic_debug: pr_err() call should not depend upon verbosity</title>
<updated>2012-01-24T20:46:45Z</updated>
<author>
<name>Jim Cromie</name>
<email>jim.cromie@gmail.com</email>
</author>
<published>2011-12-19T22:12:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ae27f86a21eb9a9e005f06b126eb88662ba4f940'/>
<id>urn:sha1:ae27f86a21eb9a9e005f06b126eb88662ba4f940</id>
<content type='text'>
Issue keyword/parsing errors even w/o verbose set;
uncover otherwize mysterious non-functionality.

Signed-off-by: Jim Cromie &lt;jim.cromie@gmail.com&gt;
Signed-off-by: Jason Baron &lt;jbaron@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
</feed>
