<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/trace/trace_events.c, branch v2.6.30</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v2.6.30</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.30'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2009-04-12T09:59:29Z</updated>
<entry>
<title>tracing/filters: return proper error code when writing filter file</title>
<updated>2009-04-12T09:59:29Z</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2009-04-11T07:55:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=44e9c8b7adc52079f0535f9de0c2c2477831389b'/>
<id>urn:sha1:44e9c8b7adc52079f0535f9de0c2c2477831389b</id>
<content type='text'>
- propagate return value of filter_add_pred() to the user

- return -ENOSPC but not -ENOMEM or -EINVAL when the filter array
  is full

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Acked-by: Tom Zanussi &lt;tzanussi@gmail.com&gt;
Acked-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
LKML-Reference: &lt;49E04CF0.3010105@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing/filters: NIL-terminate user input filter</title>
<updated>2009-04-12T09:59:27Z</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2009-04-11T07:52:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8433a40eb7f2c4883ad57f9900f63e4d59240eb7'/>
<id>urn:sha1:8433a40eb7f2c4883ad57f9900f63e4d59240eb7</id>
<content type='text'>
Make sure messages from user space are NIL-terminated strings,
otherwise we could dump random memory while reading filter file.

Try this:
 # echo 'parent_comm ==' &gt; events/sched/sched_process_fork/filter
 # cat events/sched/sched_process_fork/filter
 parent_comm == �

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Acked-by: Tom Zanussi &lt;tzanussi@gmail.com&gt;
Acked-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
LKML-Reference: &lt;49E04C32.6060508@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing: filter fix for TRACE_EVENT_FORMAT events</title>
<updated>2009-03-26T08:13:14Z</updated>
<author>
<name>Tom Zanussi</name>
<email>tzanussi@gmail.com</email>
</author>
<published>2009-03-26T06:24:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9a8118baaeb0eaa148913bed77bf9c6335f6ca63'/>
<id>urn:sha1:9a8118baaeb0eaa148913bed77bf9c6335f6ca63</id>
<content type='text'>
Impact: fix crash (hang) when using TRACE_EVENT_FORMAT filter files

filters are only hooked up to the tracepoint events defined using
TRACE_EVENT but not the tracers that use TRACE_EVENT_FORMAT, such
as ftrace.

Do not display the filter files at all for TRACE_EVENT_FORMAT events
for the time being.

Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: =?ISO-8859-1?Q?Fr=E9d=E9ric?= Weisbecker &lt;fweisbec@gmail.com&gt;
LKML-Reference: &lt;1237878882.8339.61.camel@charm-linux&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing/filters: use trace_seq_printf() to print filters</title>
<updated>2009-03-24T07:26:52Z</updated>
<author>
<name>Tom Zanussi</name>
<email>tzanussi@gmail.com</email>
</author>
<published>2009-03-24T07:14:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4bda2d517bfa3ce3d7044e06988cdddae7adffe2'/>
<id>urn:sha1:4bda2d517bfa3ce3d7044e06988cdddae7adffe2</id>
<content type='text'>
Impact: cleanup

Instead of just using the trace_seq buffer to print the filters, use
trace_seq_printf() as it was intended to be used.

Reported-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Tom Zanussi &lt;tzanussi@gmail.com&gt;
Cc: =?ISO-8859-1?Q?Fr=E9d=E9ric?= Weisbecker &lt;fweisbec@gmail.com&gt;
LKML-Reference: &lt;1237878871.8339.59.camel@charm-linux&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing/filters: free pred when clearing filters</title>
<updated>2009-03-24T07:26:51Z</updated>
<author>
<name>Tom Zanussi</name>
<email>tzanussi@gmail.com</email>
</author>
<published>2009-03-24T07:14:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=09f1f245c79585383de63e3ca54d0f91824bff3a'/>
<id>urn:sha1:09f1f245c79585383de63e3ca54d0f91824bff3a</id>
<content type='text'>
Impact: fix (small) per trace filter modification memory leak

Free the current pred when clearing the filters via the filter files.

Signed-off-by: Tom Zanussi &lt;tzanussi@gmail.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: =?ISO-8859-1?Q?Fr=E9d=E9ric?= Weisbecker &lt;fweisbec@gmail.com&gt;
LKML-Reference: &lt;1237878851.8339.58.camel@charm-linux&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing/filters: clean up filter_add_subsystem_pred()</title>
<updated>2009-03-23T08:30:37Z</updated>
<author>
<name>Tom Zanussi</name>
<email>tzanussi@gmail.com</email>
</author>
<published>2009-03-23T08:26:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c4cff064be678f1e8344d907499f2a81282edc19'/>
<id>urn:sha1:c4cff064be678f1e8344d907499f2a81282edc19</id>
<content type='text'>
Impact: cleanup, memory leak fix

This patch cleans up filter_add_subsystem_pred():

- searches for the field before creating a copy of the pred

- fixes memory leak in the case a predicate isn't applied

- if -ENOMEM, makes sure there's no longer a reference to the
  pred so the caller can free the half-finished filter

- changes the confusing i == MAX_FILTER_PRED - 1 comparison
  previously remarked upon

This affects only per-subsystem event filtering.

Signed-off-by: Tom Zanussi &lt;tzanussi@gmail.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: =?ISO-8859-1?Q?Fr=E9d=E9ric?= Weisbecker &lt;fweisbec@gmail.com&gt;
LKML-Reference: &lt;1237796808.7527.40.camel@charm-linux&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing/events: make the filter files writable</title>
<updated>2009-03-23T08:22:14Z</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2009-03-22T22:10:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9bd7d099ab3f10dd666da399c064999bae427cd9'/>
<id>urn:sha1:9bd7d099ab3f10dd666da399c064999bae427cd9</id>
<content type='text'>
We need the filter files to be writable, the current
filter file permissions are only set readable.

Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Tom Zanussi &lt;tzanussi@gmail.com&gt;
LKML-Reference: &lt;1237759847-21025-1-git-send-email-fweisbec@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing: add run-time field descriptions for event filtering, kfree fix</title>
<updated>2009-03-22T17:43:25Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2009-03-22T17:41:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fe9f57f250ab4d781b99504caeb218ca2db14c1a'/>
<id>urn:sha1:fe9f57f250ab4d781b99504caeb218ca2db14c1a</id>
<content type='text'>
Impact: fix potential kfree of random data in (rare) failure path

Zero-initialize the field structure.

Reported-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Tom Zanussi &lt;tzanussi@gmail.com&gt;
LKML-Reference: &lt;1237710639.7703.46.camel@charm-linux&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing: add per-subsystem filtering</title>
<updated>2009-03-22T17:38:47Z</updated>
<author>
<name>Tom Zanussi</name>
<email>tzanussi@gmail.com</email>
</author>
<published>2009-03-22T08:31:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cfb180f3e71b2a280a254c8646a9ab1beab63f84'/>
<id>urn:sha1:cfb180f3e71b2a280a254c8646a9ab1beab63f84</id>
<content type='text'>
This patch adds per-subsystem filtering to the event tracing subsystem.

It adds a 'filter' debugfs file to each subsystem directory.  This file
can be written to to set filters; reading from it will display the
current set of filters set for that subsystem.

Basically what it does is propagate the filter down to each event
contained in the subsystem.  If a particular event doesn't have a field
with the name specified in the filter, it simply doesn't get set for
that event.  You can verify whether or not the filter was set for a
particular event by looking at the filter file for that event.

As with per-event filters, compound expressions are supported, echoing
'0' to the subsystem's filter file clears all filters in the subsystem,
etc.

Signed-off-by: Tom Zanussi &lt;tzanussi@gmail.com&gt;
Acked-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
LKML-Reference: &lt;1237710677.7703.49.camel@charm-linux&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing: add per-event filtering</title>
<updated>2009-03-22T17:38:46Z</updated>
<author>
<name>Tom Zanussi</name>
<email>tzanussi@gmail.com</email>
</author>
<published>2009-03-22T08:31:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7ce7e4249921d5073e764f7ff7ad83cfa9894bd7'/>
<id>urn:sha1:7ce7e4249921d5073e764f7ff7ad83cfa9894bd7</id>
<content type='text'>
This patch adds per-event filtering to the event tracing subsystem.

It adds a 'filter' debugfs file to each event directory.  This file can
be written to to set filters; reading from it will display the current
set of filters set for that event.

Basically, any field listed in the 'format' file for an event can be
filtered on (including strings, but not yet other array types) using
either matching ('==') or non-matching ('!=') 'predicates'.  A
'predicate' can be either a single expression:

 # echo pid != 0 &gt; filter

 # cat filter
 pid != 0

or a compound expression of up to 8 sub-expressions combined using '&amp;&amp;'
or '||':

 # echo comm == Xorg &gt; filter
 # echo "&amp;&amp; sig != 29" &gt; filter

 # cat filter
 comm == Xorg
 &amp;&amp; sig != 29

Only events having field values matching an expression will be available
in the trace output; non-matching events are discarded.

Note that a compound expression is built up by echoing each
sub-expression separately - it's not the most efficient way to do
things, but it keeps the parser simple and assumes that compound
expressions will be relatively uncommon.  In any case, a subsequent
patch introducing a way to set filters for entire subsystems should
mitigate any need to do this for lots of events.

Setting a filter without an '&amp;&amp;' or '||' clears the previous filter
completely and sets the filter to the new expression:

 # cat filter
 comm == Xorg
 &amp;&amp; sig != 29

 # echo comm != Xorg

 # cat filter
 comm != Xorg

To clear a filter, echo 0 to the filter file:

 # echo 0 &gt; filter
 # cat filter
 none

The limit of 8 predicates for a compound expression is arbitrary - for
efficiency, it's implemented as an array of pointers to predicates, and
8 seemed more than enough for any filter...

Signed-off-by: Tom Zanussi &lt;tzanussi@gmail.com&gt;
Acked-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
LKML-Reference: &lt;1237710665.7703.48.camel@charm-linux&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
</feed>
