<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/trace/trace_events.c, branch v3.10</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=v3.10</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.10'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2013-05-16T15:01:16Z</updated>
<entry>
<title>tracing: Return -EBUSY when event_enable_func() fails to get module</title>
<updated>2013-05-16T15:01:16Z</updated>
<author>
<name>Masami Hiramatsu</name>
<email>masami.hiramatsu.pt@hitachi.com</email>
</author>
<published>2013-05-16T11:48:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6ed0106667d76589cb648c27edb4f4ffbf9d59ca'/>
<id>urn:sha1:6ed0106667d76589cb648c27edb4f4ffbf9d59ca</id>
<content type='text'>
Since try_module_get() returns false( = 0) when it fails to
pindown a module, event_enable_func() returns 0 which means
"succeed". This can cause a kernel panic when the entry
is removed, because the event is already released.

This fixes the bug by returning -EBUSY, because the reason
why it fails is that the module is being removed at that time.

Link: http://lkml.kernel.org/r/20130516114848.13508.97899.stgit@mhiramat-M0-7522

Cc: Srikar Dronamraju &lt;srikar@linux.vnet.ibm.com&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Tom Zanussi &lt;tom.zanussi@intel.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Signed-off-by: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Add helper function trace_create_new_event() to remove duplicate code</title>
<updated>2013-05-10T00:14:49Z</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2013-05-09T19:00:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=da511bf33e47ea1f33f4b672f7da166d2a1b8a91'/>
<id>urn:sha1:da511bf33e47ea1f33f4b672f7da166d2a1b8a91</id>
<content type='text'>
Both __trace_add_new_event() and __trace_early_add_new_event() do
basically the same thing, except that __trace_add_new_event() does
a little more.

Instead of having duplicate code between the two functions, add
a helper function trace_create_new_event() that both can use.
This will help against having bugs fixed in one function but not
the other.

Cc: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Modify soft-mode only if there's no other referrer</title>
<updated>2013-05-10T00:14:25Z</updated>
<author>
<name>Masami Hiramatsu</name>
<email>masami.hiramatsu.pt@hitachi.com</email>
</author>
<published>2013-05-09T05:44:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1cf4c0732db3cd3c49cadbc60ff6bda08604e6fa'/>
<id>urn:sha1:1cf4c0732db3cd3c49cadbc60ff6bda08604e6fa</id>
<content type='text'>
Modify soft-mode flag only if no other soft-mode referrer
(currently only the ftrace triggers) by using a reference
counter in each ftrace_event_file.

Without this fix, adding and removing several different
enable/disable_event triggers on the same event clear
soft-mode bit from the ftrace_event_file. This also
happens with a typo of glob on setting triggers.

e.g.

 # echo vfs_symlink:enable_event:net:netif_rx &gt; set_ftrace_filter
 # cat events/net/netif_rx/enable
 0*
 # echo typo_func:enable_event:net:netif_rx &gt; set_ftrace_filter
 # cat events/net/netif_rx/enable
 0
 # cat set_ftrace_filter
 #### all functions enabled ####
 vfs_symlink:enable_event:net:netif_rx:unlimited

As above, we still have a trigger, but soft-mode is gone.

Link: http://lkml.kernel.org/r/20130509054429.30398.7464.stgit@mhiramat-M0-7522

Cc: Srikar Dronamraju &lt;srikar@linux.vnet.ibm.com&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: David Sharp &lt;dhsharp@google.com&gt;
Cc: Hiraku Toyooka &lt;hiraku.toyooka.gu@hitachi.com&gt;
Cc: Tom Zanussi &lt;tom.zanussi@intel.com&gt;
Signed-off-by: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Indicate enabled soft-mode in enable file</title>
<updated>2013-05-10T00:14:07Z</updated>
<author>
<name>Masami Hiramatsu</name>
<email>masami.hiramatsu.pt@hitachi.com</email>
</author>
<published>2013-05-09T05:44:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=30052170dcc256c18a43fb3e76577a67394543f8'/>
<id>urn:sha1:30052170dcc256c18a43fb3e76577a67394543f8</id>
<content type='text'>
Indicate enabled soft-mode event as "1*" in "enable" file
for each event, because it can be soft-disabled when disable_event
trigger is hit.

Link: http://lkml.kernel.org/r/20130509054426.30398.28202.stgit@mhiramat-M0-7522

Cc: Srikar Dronamraju &lt;srikar@linux.vnet.ibm.com&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Tom Zanussi &lt;tom.zanussi@intel.com&gt;
Signed-off-by: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Return error if register_ftrace_function_probe() fails for event_enable_func()</title>
<updated>2013-05-09T15:30:26Z</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2013-05-09T15:30:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ff305ded9ff83436039a16d31bc558dc6598d7ce'/>
<id>urn:sha1:ff305ded9ff83436039a16d31bc558dc6598d7ce</id>
<content type='text'>
register_ftrace_function_probe() returns the number of functions
it registered, which can be zero, it can also return a negative number
if something went wrong. But event_enable_func() only checks for
the case that it didn't register anything, it needs to also check
for the case that something went wrong and return that error code
as well.

Added some comments about the code as well, to make it more
understandable.

Cc: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Don't succeed if event_enable_func did not register anything</title>
<updated>2013-05-09T15:26:01Z</updated>
<author>
<name>Masami Hiramatsu</name>
<email>masami.hiramatsu.pt@hitachi.com</email>
</author>
<published>2013-05-09T05:44:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a5b85bd1557209b4ef18a8cf07e60a1ca3132468'/>
<id>urn:sha1:a5b85bd1557209b4ef18a8cf07e60a1ca3132468</id>
<content type='text'>
Return 0 instead of the number of activated ftrace function probes if
event_enable_func succeeded and return an error code if it failed or
did not register any functions. But it currently returns the number
of registered functions and if it didn't register anything, it returns 0,
but that is considered success.

This also fixes the return value. As if it succeeds, it returns the
number of functions that were enabled, which is returned back to
the user in ftrace_regex_write (the write() return code). If only
one function is enabled, then the return code of the write is one,
and this can confuse the user program in thinking it only wrote 1
byte.

Link: http://lkml.kernel.org/r/20130509054413.30398.55650.stgit@mhiramat-M0-7522

Cc: Srikar Dronamraju &lt;srikar@linux.vnet.ibm.com&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Tom Zanussi &lt;tom.zanussi@intel.com&gt;
Signed-off-by: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
[ Rewrote change log to reflect that this fixes two bugs - SR ]
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Rename trace_event_mutex to trace_event_sem</title>
<updated>2013-03-15T17:22:10Z</updated>
<author>
<name>zhangwei(Jovi)</name>
<email>jovi.zhangwei@huawei.com</email>
</author>
<published>2013-03-11T07:14:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=52f6ad6dc3f4c6de598fe7cc9b629888d624aa52'/>
<id>urn:sha1:52f6ad6dc3f4c6de598fe7cc9b629888d624aa52</id>
<content type='text'>
trace_event_mutex is an rw semaphore now, not a mutex, change the name.

Link: http://lkml.kernel.org/r/513D843B.40109@huawei.com

Signed-off-by: zhangwei(Jovi) &lt;jovi.zhangwei@huawei.com&gt;
[ Forward ported to my new code ]
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Convert trace_destroy_fields() to static</title>
<updated>2013-03-15T17:22:08Z</updated>
<author>
<name>zhangwei(Jovi)</name>
<email>jovi.zhangwei@huawei.com</email>
</author>
<published>2013-03-11T07:13:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ad7067cebf3253412a7c0a169a9dd056b11e69ac'/>
<id>urn:sha1:ad7067cebf3253412a7c0a169a9dd056b11e69ac</id>
<content type='text'>
trace_destroy_fields() is not used outside of the file. It can be
a static function.

Link: http://lkml.kernel.org/r/513D842A.2000907@huawei.com

Signed-off-by: zhangwei(Jovi) &lt;jovi.zhangwei@huawei.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Move find_event_field() into trace_events.c</title>
<updated>2013-03-15T17:22:07Z</updated>
<author>
<name>zhangwei(Jovi)</name>
<email>jovi.zhangwei@huawei.com</email>
</author>
<published>2013-03-11T07:13:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b3a8c6fd7bb61c910bd4f80ae1d75056e8f98c19'/>
<id>urn:sha1:b3a8c6fd7bb61c910bd4f80ae1d75056e8f98c19</id>
<content type='text'>
By moving find_event_field() and trace_find_field() into trace_events.c,
the ftrace_common_fields list and trace_get_fields() can become local to
the trace_events.c file.

find_event_field() is renamed to trace_find_event_field() to conform to
the tracing global function names.

Link: http://lkml.kernel.org/r/513D8426.9070109@huawei.com

Signed-off-by: zhangwei(Jovi) &lt;jovi.zhangwei@huawei.com&gt;
[ rostedt: Modified trace_find_field() to trace_find_event_field() ]
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Add function probe triggers to enable/disable events</title>
<updated>2013-03-15T04:36:04Z</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2013-03-12T23:35:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3cd715de261182413b3487abfffe1b6af41b81b3'/>
<id>urn:sha1:3cd715de261182413b3487abfffe1b6af41b81b3</id>
<content type='text'>
Add triggers to function tracer that lets an event get enabled or
disabled when a function is called:

format is:

 &lt;function&gt;:enable_event:&lt;system&gt;:&lt;event&gt;[:&lt;count&gt;]
 &lt;function&gt;:disable_event:&lt;system&gt;:&lt;event&gt;[:&lt;count&gt;]

 echo 'schedule:enable_event:sched:sched_switch' &gt; /debug/tracing/set_ftrace_filter

Every time schedule is called, it will enable the sched_switch event.

 echo 'schedule:disable_event:sched:sched_switch:2' &gt; /debug/tracing/set_ftrace_filter

The first two times schedule is called while the sched_switch
event is enabled, it will disable it. It will not count for a time
that the event is already disabled (or enabled for enable_event).

[ fixed return without mutex_unlock() - thanks to Dan Carpenter and smatch ]

Cc: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Cc: Tom Zanussi &lt;tom.zanussi@linux.intel.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
</feed>
