<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/kernel/trace/trace_uprobe.c, branch v3.10.44</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.10.44</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.10.44'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2013-08-29T16:47:34Z</updated>
<entry>
<title>tracing/uprobes: Fail to unregister if probe event files are in use</title>
<updated>2013-08-29T16:47:34Z</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2013-07-04T03:33:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=396dd500521287215d836b84b2ae61cd9163bba5'/>
<id>urn:sha1:396dd500521287215d836b84b2ae61cd9163bba5</id>
<content type='text'>
commit c6c2401d8bbaf9edc189b4c35a8cb2780b8b988e upstream.

Uprobes suffer the same problem that kprobes have. There's a race between
writing to the "enable" file and removing the probe. The probe checks for
it being in use and if it is not, goes about deleting the probe and the
event that represents it. But the problem with that is, after it checks
if it is in use it can be enabled, and the deletion of the event (access
to the probe) will fail, as it is in use. But the uprobe will still be
deleted. This is a problem as the event can reference the uprobe that
was deleted.

The fix is to remove the event first, and check to make sure the event
removal succeeds. Then it is safe to remove the probe.

When the event exists, either ftrace or perf can enable the probe and
prevent the event from being removed.

Link: http://lkml.kernel.org/r/20130704034038.991525256@goodmis.org

Acked-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>uprobes: Fix return value in error handling path</title>
<updated>2013-07-25T21:07:31Z</updated>
<author>
<name>zhangwei(Jovi)</name>
<email>jovi.zhangwei@huawei.com</email>
</author>
<published>2013-06-13T06:21:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3873153a61235a63517547e347db7ab90788486f'/>
<id>urn:sha1:3873153a61235a63517547e347db7ab90788486f</id>
<content type='text'>
commit fa44063f9ef163c3a4c8d8c0465bb8a056b42035 upstream.

When wrong argument is passed into uprobe_events it does not return
an error:

[root@jovi tracing]# echo 'p:myprobe /bin/bash' &gt; uprobe_events
[root@jovi tracing]#

The proper response is:

[root@jovi tracing]# echo 'p:myprobe /bin/bash' &gt; uprobe_events
-bash: echo: write error: Invalid argument

Link: http://lkml.kernel.org/r/51B964FF.5000106@huawei.com

Signed-off-by: zhangwei(Jovi) &lt;jovi.zhangwei@huawei.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: &lt;srikar@linux.vnet.ibm.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>uprobes/perf: Avoid perf_trace_buf_prepare/submit if -&gt;perf_events is empty</title>
<updated>2013-04-15T15:39:52Z</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@redhat.com</email>
</author>
<published>2013-04-13T13:36:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=515619f209114697fabd21eed1623bfa69746815'/>
<id>urn:sha1:515619f209114697fabd21eed1623bfa69746815</id>
<content type='text'>
perf_trace_buf_prepare() + perf_trace_buf_submit() make no sense
if this task/CPU has no active counters. Change uprobe_perf_print()
to return if hlist_empty(call-&gt;perf_events).

Note: this is not uprobe-specific, we can change other users too.

Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
</content>
</entry>
<entry>
<title>uprobes/tracing: Don't pass addr=ip to perf_trace_buf_submit()</title>
<updated>2013-04-13T13:32:04Z</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@redhat.com</email>
</author>
<published>2013-04-10T14:25:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=32520b2c695b23221751eb09360a6a3dd3105b52'/>
<id>urn:sha1:32520b2c695b23221751eb09360a6a3dd3105b52</id>
<content type='text'>
uprobe_perf_print() passes addr=ip to perf_trace_buf_submit() for
no reason. This sets perf_sample_data-&gt;addr for PERF_SAMPLE_ADDR,
we already have perf_sample_data-&gt;ip initialized if PERF_SAMPLE_IP.

Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Acked-by: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
Acked-by: Srikar Dronamraju &lt;srikar@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>uprobes/tracing: Change create_trace_uprobe() to support uretprobes</title>
<updated>2013-04-13T13:32:03Z</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@redhat.com</email>
</author>
<published>2013-03-30T19:28:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4ee5a52ed6301d0afa56cc995ef2c3795f45e801'/>
<id>urn:sha1:4ee5a52ed6301d0afa56cc995ef2c3795f45e801</id>
<content type='text'>
Finally change create_trace_uprobe() to check if argv[0][0] == 'r'
and pass the correct "is_ret" to alloc_trace_uprobe().

Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Acked-by: Srikar Dronamraju &lt;srikar@linux.vnet.ibm.com&gt;
Tested-by: Anton Arapov &lt;anton@redhat.com&gt;
</content>
</entry>
<entry>
<title>uprobes/tracing: Make seq_printf() code uretprobe-friendly</title>
<updated>2013-04-13T13:32:03Z</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@redhat.com</email>
</author>
<published>2013-03-30T18:48:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3ede82dd3e3deb23429f2bf44fb600f440eef84b'/>
<id>urn:sha1:3ede82dd3e3deb23429f2bf44fb600f440eef84b</id>
<content type='text'>
Change probes_seq_show() and print_uprobe_event() to check
is_ret_probe() and print the correct data.

Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Acked-by: Srikar Dronamraju &lt;srikar@linux.vnet.ibm.com&gt;
Tested-by: Anton Arapov &lt;anton@redhat.com&gt;
</content>
</entry>
<entry>
<title>uprobes/tracing: Make register_uprobe_event() paths uretprobe-friendly</title>
<updated>2013-04-13T13:32:03Z</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@redhat.com</email>
</author>
<published>2013-03-30T18:23:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4d1298e2124767b4e263498485618b2e91aee5f0'/>
<id>urn:sha1:4d1298e2124767b4e263498485618b2e91aee5f0</id>
<content type='text'>
Change uprobe_event_define_fields(), and __set_print_fmt() to check
is_ret_probe() and use the appropriate format/fields.

Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Acked-by: Srikar Dronamraju &lt;srikar@linux.vnet.ibm.com&gt;
Tested-by: Anton Arapov &lt;anton@redhat.com&gt;
</content>
</entry>
<entry>
<title>uprobes/tracing: Make uprobe_{trace,perf}_print() uretprobe-friendly</title>
<updated>2013-04-13T13:32:03Z</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@redhat.com</email>
</author>
<published>2013-03-30T17:46:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=393a736c280d555d9301fc5516d4d401544eb9db'/>
<id>urn:sha1:393a736c280d555d9301fc5516d4d401544eb9db</id>
<content type='text'>
Change uprobe_trace_print() and uprobe_perf_print() to check
is_ret_probe() and fill ring_buffer_event accordingly.

Also change uprobe_trace_func() and uprobe_perf_func() to not
_print() if is_ret_probe() is true. Note that we keep -&gt;handler()
nontrivial even for uretprobe, we need this for filtering and for
other potential extensions.

Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Acked-by: Srikar Dronamraju &lt;srikar@linux.vnet.ibm.com&gt;
Tested-by: Anton Arapov &lt;anton@redhat.com&gt;
</content>
</entry>
<entry>
<title>uprobes/tracing: Introduce is_ret_probe() and uretprobe_dispatcher()</title>
<updated>2013-04-13T13:32:02Z</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@redhat.com</email>
</author>
<published>2013-03-30T17:25:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c1ae5c75e1034070b203dc9d4ad77ce196166a6c'/>
<id>urn:sha1:c1ae5c75e1034070b203dc9d4ad77ce196166a6c</id>
<content type='text'>
Create the new functions we need to support uretprobes, and change
alloc_trace_uprobe() to initialize consumer.ret_handler if the new
"is_ret" argument is true. Curently this argument is always false,
so the new code is never called and is_ret_probe(tu) is false too.

Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Acked-by: Srikar Dronamraju &lt;srikar@linux.vnet.ibm.com&gt;
Tested-by: Anton Arapov &lt;anton@redhat.com&gt;
</content>
</entry>
<entry>
<title>uprobes/tracing: Introduce uprobe_{trace,perf}_print() helpers</title>
<updated>2013-04-13T13:32:01Z</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@redhat.com</email>
</author>
<published>2013-03-30T17:02:12Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a51cc6041773dd88ff35608f54274bfd6ac68652'/>
<id>urn:sha1:a51cc6041773dd88ff35608f54274bfd6ac68652</id>
<content type='text'>
Extract the output code from uprobe_trace_func() and uprobe_perf_func()
into the new helpers, they will be used by -&gt;ret_handler() too. We also
add the unused "unsigned long func" argument in advance, to simplify the
next changes.

Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Acked-by: Srikar Dronamraju &lt;srikar@linux.vnet.ibm.com&gt;
Tested-by: Anton Arapov &lt;anton@redhat.com&gt;
</content>
</entry>
</feed>
