<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/trace/trace_uprobe.c, branch v3.13</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.13</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.13'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2013-11-05T21:50:20Z</updated>
<entry>
<title>tracing: Update event filters for multibuffer</title>
<updated>2013-11-05T21:50:20Z</updated>
<author>
<name>Tom Zanussi</name>
<email>tom.zanussi@linux.intel.com</email>
</author>
<published>2013-10-24T13:34:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f306cc82a93d6b19f01634b80c580b9755c8b7cc'/>
<id>urn:sha1:f306cc82a93d6b19f01634b80c580b9755c8b7cc</id>
<content type='text'>
The trace event filters are still tied to event calls rather than
event files, which means you don't get what you'd expect when using
filters in the multibuffer case:

Before:

  # echo 'bytes_alloc &gt; 8192' &gt; /sys/kernel/debug/tracing/events/kmem/kmalloc/filter
  # cat /sys/kernel/debug/tracing/events/kmem/kmalloc/filter
  bytes_alloc &gt; 8192
  # mkdir /sys/kernel/debug/tracing/instances/test1
  # echo 'bytes_alloc &gt; 2048' &gt; /sys/kernel/debug/tracing/instances/test1/events/kmem/kmalloc/filter
  # cat /sys/kernel/debug/tracing/events/kmem/kmalloc/filter
  bytes_alloc &gt; 2048
  # cat /sys/kernel/debug/tracing/instances/test1/events/kmem/kmalloc/filter
  bytes_alloc &gt; 2048

Setting the filter in tracing/instances/test1/events shouldn't affect
the same event in tracing/events as it does above.

After:

  # echo 'bytes_alloc &gt; 8192' &gt; /sys/kernel/debug/tracing/events/kmem/kmalloc/filter
  # cat /sys/kernel/debug/tracing/events/kmem/kmalloc/filter
  bytes_alloc &gt; 8192
  # mkdir /sys/kernel/debug/tracing/instances/test1
  # echo 'bytes_alloc &gt; 2048' &gt; /sys/kernel/debug/tracing/instances/test1/events/kmem/kmalloc/filter
  # cat /sys/kernel/debug/tracing/events/kmem/kmalloc/filter
  bytes_alloc &gt; 8192
  # cat /sys/kernel/debug/tracing/instances/test1/events/kmem/kmalloc/filter
  bytes_alloc &gt; 2048

We'd like to just move the filter directly from ftrace_event_call to
ftrace_event_file, but there are a couple cases that don't yet have
multibuffer support and therefore have to continue using the current
event_call-based filters.  For those cases, a new USE_CALL_FILTER bit
is added to the event_call flags, whose main purpose is to keep the
old behavior for those cases until they can be updated with
multibuffer support; at that point, the USE_CALL_FILTER flag (and the
new associated call_filter_check_discard() function) can go away.

The multibuffer support also made filter_current_check_discard()
redundant, so this change removes that function as well and replaces
it with filter_check_discard() (or call_filter_check_discard() as
appropriate).

Link: http://lkml.kernel.org/r/f16e9ce4270c62f46b2e966119225e1c3cca7e60.1382620672.git.tom.zanussi@linux.intel.com

Signed-off-by: Tom Zanussi &lt;tom.zanussi@linux.intel.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing/uprobes: Fail to unregister if probe event files are in use</title>
<updated>2013-08-01T22:25:50Z</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.shady.money/linux/commit/?id=c6c2401d8bbaf9edc189b4c35a8cb2780b8b988e'/>
<id>urn:sha1:c6c2401d8bbaf9edc189b4c35a8cb2780b8b988e</id>
<content type='text'>
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;
</content>
</entry>
<entry>
<title>tracing/perf: Move the PERF_MAX_TRACE_SIZE check into perf_trace_buf_prepare()</title>
<updated>2013-07-19T01:31:28Z</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@redhat.com</email>
</author>
<published>2013-06-17T17:02:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cd92bf61d6d70bd3eb33b46d600e3f3eb9c5778a'/>
<id>urn:sha1:cd92bf61d6d70bd3eb33b46d600e3f3eb9c5778a</id>
<content type='text'>
Every perf_trace_buf_prepare() caller does
WARN_ONCE(size &gt; PERF_MAX_TRACE_SIZE, message) and "message" is
almost the same.

Shift this WARN_ONCE() into perf_trace_buf_prepare(). This changes
the meaning of _ONCE, but I think this is fine.

	- 4947014 2932448 10104832  17984294  1126b26 vmlinux
	+ 4948422 2932448 10104832  17985702  11270a6 vmlinux

on my build.

Link: http://lkml.kernel.org/r/20130617170211.GA19813@redhat.com

Acked-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>uprobes: Fix return value in error handling path</title>
<updated>2013-07-03T00:42:29Z</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.shady.money/linux/commit/?id=fa44063f9ef163c3a4c8d8c0465bb8a056b42035'/>
<id>urn:sha1:fa44063f9ef163c3a4c8d8c0465bb8a056b42035</id>
<content type='text'>
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

Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: &lt;srikar@linux.vnet.ibm.com&gt;
Cc: stable@vger.kernel.org # 3.5+
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>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.shady.money/linux/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.shady.money/linux/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.shady.money/linux/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.shady.money/linux/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.shady.money/linux/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.shady.money/linux/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>
</feed>
