<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/samples, branch linux-4.3.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.3.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.3.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2015-10-28T02:51:10Z</updated>
<entry>
<title>bpf: sample: define aarch64 specific registers</title>
<updated>2015-10-28T02:51:10Z</updated>
<author>
<name>Yang Shi</name>
<email>yang.shi@linaro.org</email>
</author>
<published>2015-10-27T00:02:19Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=85ff8a43f39fa6d2f970b5e1e5c03df87abde242'/>
<id>urn:sha1:85ff8a43f39fa6d2f970b5e1e5c03df87abde242</id>
<content type='text'>
Define aarch64 specific registers for building bpf samples correctly.

Signed-off-by: Yang Shi &lt;yang.shi@linaro.org&gt;
Acked-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>kprobes: use _do_fork() in samples to make them work again</title>
<updated>2015-10-02T01:42:35Z</updated>
<author>
<name>Petr Mladek</name>
<email>pmladek@suse.com</email>
</author>
<published>2015-10-01T22:37:11Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=54aea4542980a3ed580426a81c5af799df4d610d'/>
<id>urn:sha1:54aea4542980a3ed580426a81c5af799df4d610d</id>
<content type='text'>
Commit 3033f14ab78c ("clone: support passing tls argument via C rather
than pt_regs magic") introduced _do_fork() that allowed to pass @tls
parameter.

The old do_fork() is defined only for architectures that are not ready
to use this way and do not define HAVE_COPY_THREAD_TLS.

Let's use _do_fork() in the kprobe examples to make them work again on
all architectures.

Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
Cc: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Thiago Macieira &lt;thiago.macieira@intel.com&gt;
Cc: Jiri Kosina &lt;jkosina@suse.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>bpf: fix build warnings and add function read_trace_pipe()</title>
<updated>2015-08-12T23:39:12Z</updated>
<author>
<name>Kaixu Xia</name>
<email>xiakaixu@huawei.com</email>
</author>
<published>2015-08-12T09:37:53Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5ed3ccbd5ac11414d61c16182718e68868becc16'/>
<id>urn:sha1:5ed3ccbd5ac11414d61c16182718e68868becc16</id>
<content type='text'>
There are two improvements in this patch:
 1. Fix the build warnings;
 2. Add function read_trace_pipe() to print the result on
    the screen;

Before this patch, we can get the result through /sys/kernel/de
bug/tracing/trace_pipe and get nothing on the screen.
By applying this patch, the result can be printed on the screen.
  $ ./tracex6
	...
         tracex6-705   [003] d..1   131.428593: : CPU-3   19981414
            sshd-683   [000] d..1   131.428727: : CPU-0   221682321
            sshd-683   [000] d..1   131.428821: : CPU-0   221808766
            sshd-683   [000] d..1   131.428950: : CPU-0   221982984
            sshd-683   [000] d..1   131.429045: : CPU-0   222111851
         tracex6-705   [003] d..1   131.429168: : CPU-3   20757551
            sshd-683   [000] d..1   131.429170: : CPU-0   222281240
            sshd-683   [000] d..1   131.429261: : CPU-0   222403340
            sshd-683   [000] d..1   131.429378: : CPU-0   222561024
	...

Signed-off-by: Kaixu Xia &lt;xiakaixu@huawei.com&gt;
Acked-by: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>samples/bpf: example of get selected PMU counter value</title>
<updated>2015-08-10T05:50:06Z</updated>
<author>
<name>Kaixu Xia</name>
<email>xiakaixu@huawei.com</email>
</author>
<published>2015-08-06T07:02:36Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=47efb30274cbec1bd3c0c980a7ece328df2c16a8'/>
<id>urn:sha1:47efb30274cbec1bd3c0c980a7ece328df2c16a8</id>
<content type='text'>
This is a simple example and shows how to use the new ability
to get the selected Hardware PMU counter value.

Signed-off-by: Kaixu Xia &lt;xiakaixu@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ebpf: Allow dereferences of PTR_TO_STACK registers</title>
<updated>2015-07-27T07:54:10Z</updated>
<author>
<name>Alex Gartrell</name>
<email>agartrell@fb.com</email>
</author>
<published>2015-07-23T21:24:40Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=24b4d2abd0bd628f396dada3e915d395cbf459eb'/>
<id>urn:sha1:24b4d2abd0bd628f396dada3e915d395cbf459eb</id>
<content type='text'>
mov %rsp, %r1           ; r1 = rsp
        add $-8, %r1            ; r1 = rsp - 8
        store_q $123, -8(%rsp)  ; *(u64*)r1 = 123  &lt;- valid
        store_q $123, (%r1)     ; *(u64*)r1 = 123  &lt;- previously invalid
        mov $0, %r0
        exit                    ; Always need to exit

And we'd get the following error:

	0: (bf) r1 = r10
	1: (07) r1 += -8
	2: (7a) *(u64 *)(r10 -8) = 999
	3: (7a) *(u64 *)(r1 +0) = 999
	R1 invalid mem access 'fp'

	Unable to load program

We already know that a register is a stack address and the appropriate
offset, so we should be able to validate those references as well.

Signed-off-by: Alex Gartrell &lt;agartrell@fb.com&gt;
Acked-by: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2015-07-23T07:41:16Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2015-07-23T07:41:16Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c5e40ee287db61a79af1746954ee03ebbf1ff8a3'/>
<id>urn:sha1:c5e40ee287db61a79af1746954ee03ebbf1ff8a3</id>
<content type='text'>
Conflicts:
	net/bridge/br_mdb.c

br_mdb.c conflict was a function call being removed to fix a bug in
'net' but whose signature was changed in 'net-next'.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tracing: Fix sample output of dynamic arrays</title>
<updated>2015-07-17T18:15:13Z</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2015-07-17T18:03:26Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d6726c8145290bef950ae2538ea6ae1d96a1944b'/>
<id>urn:sha1:d6726c8145290bef950ae2538ea6ae1d96a1944b</id>
<content type='text'>
He Kuang noticed that the trace event samples for arrays was broken:

"The output result of trace_foo_bar event in traceevent samples is
 wrong. This problem can be reproduced as following:

  (Build kernel with SAMPLE_TRACE_EVENTS=m)

  $ insmod trace-events-sample.ko

  $ echo 1 &gt; /sys/kernel/debug/tracing/events/sample-trace/foo_bar/enable

  $ cat /sys/kernel/debug/tracing/trace

  event-sample-980 [000] ....  43.649559: foo_bar: foo hello 21 0x15
  BIT1|BIT3|0x10 {0x1,0x6f6f6e53,0xff007970,0xffffffff} Snoopy
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                 The array length is not right, should be {0x1}.
  (ffffffff,ffffffff)

  event-sample-980 [000] ....  44.653827: foo_bar: foo hello 22 0x16
  BIT2|BIT3|0x10
  {0x1,0x2,0x646e6147,0x666c61,0xffffffff,0xffffffff,0x750aeffe,0x7}
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                 The array length is not right, should be {0x1,0x2}.
  Gandalf (ffffffff,ffffffff)"

This was caused by an update to have __print_array()'s second parameter
be the count of items in the array and not the size of the array.

As there is already users of __print_array(), it can not change. But
the sample code can and we can also improve on the documentation about
__print_array() and __get_dynamic_array_len().

Link: http://lkml.kernel.org/r/1436839171-31527-2-git-send-email-hekuang@huawei.com

Fixes: ac01ce1410fc2 ("tracing: Make ftrace_print_array_seq compute buf_len")
Reported-by: He Kuang &lt;hekuang@huawei.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>samples: bpf: enable trace samples for s390x</title>
<updated>2015-07-08T22:17:45Z</updated>
<author>
<name>Michael Holzheu</name>
<email>holzheu@linux.vnet.ibm.com</email>
</author>
<published>2015-07-06T14:20:07Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d912557b346099584bbbfa8d3c1e101c46e33b59'/>
<id>urn:sha1:d912557b346099584bbbfa8d3c1e101c46e33b59</id>
<content type='text'>
The trace bpf samples do not compile on s390x because they use x86
specific fields from the "pt_regs" structure.

Fix this and access the fields via new PT_REGS macros.

Signed-off-by: Michael Holzheu &lt;holzheu@linux.vnet.ibm.com&gt;
Acked-by: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bpf: BPF based latency tracing</title>
<updated>2015-06-23T13:09:58Z</updated>
<author>
<name>Daniel Wagner</name>
<email>daniel.wagner@bmw-carit.de</email>
</author>
<published>2015-06-19T14:00:44Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0fb1170ee68a6aa14eca0666e02c4b62cbf1251d'/>
<id>urn:sha1:0fb1170ee68a6aa14eca0666e02c4b62cbf1251d</id>
<content type='text'>
BPF offers another way to generate latency histograms. We attach
kprobes at trace_preempt_off and trace_preempt_on and calculate the
time it takes to from seeing the off/on transition.

The first array is used to store the start time stamp. The key is the
CPU id. The second array stores the log2(time diff). We need to use
static allocation here (array and not hash tables). The kprobes
hooking into trace_preempt_on|off should not calling any dynamic
memory allocation or free path. We need to avoid recursivly
getting called. Besides that, it reduces jitter in the measurement.

CPU 0
      latency        : count     distribution
       1 -&gt; 1        : 0        |                                        |
       2 -&gt; 3        : 0        |                                        |
       4 -&gt; 7        : 0        |                                        |
       8 -&gt; 15       : 0        |                                        |
      16 -&gt; 31       : 0        |                                        |
      32 -&gt; 63       : 0        |                                        |
      64 -&gt; 127      : 0        |                                        |
     128 -&gt; 255      : 0        |                                        |
     256 -&gt; 511      : 0        |                                        |
     512 -&gt; 1023     : 0        |                                        |
    1024 -&gt; 2047     : 0        |                                        |
    2048 -&gt; 4095     : 166723   |*************************************** |
    4096 -&gt; 8191     : 19870    |***                                     |
    8192 -&gt; 16383    : 6324     |                                        |
   16384 -&gt; 32767    : 1098     |                                        |
   32768 -&gt; 65535    : 190      |                                        |
   65536 -&gt; 131071   : 179      |                                        |
  131072 -&gt; 262143   : 18       |                                        |
  262144 -&gt; 524287   : 4        |                                        |
  524288 -&gt; 1048575  : 1363     |                                        |
CPU 1
      latency        : count     distribution
       1 -&gt; 1        : 0        |                                        |
       2 -&gt; 3        : 0        |                                        |
       4 -&gt; 7        : 0        |                                        |
       8 -&gt; 15       : 0        |                                        |
      16 -&gt; 31       : 0        |                                        |
      32 -&gt; 63       : 0        |                                        |
      64 -&gt; 127      : 0        |                                        |
     128 -&gt; 255      : 0        |                                        |
     256 -&gt; 511      : 0        |                                        |
     512 -&gt; 1023     : 0        |                                        |
    1024 -&gt; 2047     : 0        |                                        |
    2048 -&gt; 4095     : 114042   |*************************************** |
    4096 -&gt; 8191     : 9587     |**                                      |
    8192 -&gt; 16383    : 4140     |                                        |
   16384 -&gt; 32767    : 673      |                                        |
   32768 -&gt; 65535    : 179      |                                        |
   65536 -&gt; 131071   : 29       |                                        |
  131072 -&gt; 262143   : 4        |                                        |
  262144 -&gt; 524287   : 1        |                                        |
  524288 -&gt; 1048575  : 364      |                                        |
CPU 2
      latency        : count     distribution
       1 -&gt; 1        : 0        |                                        |
       2 -&gt; 3        : 0        |                                        |
       4 -&gt; 7        : 0        |                                        |
       8 -&gt; 15       : 0        |                                        |
      16 -&gt; 31       : 0        |                                        |
      32 -&gt; 63       : 0        |                                        |
      64 -&gt; 127      : 0        |                                        |
     128 -&gt; 255      : 0        |                                        |
     256 -&gt; 511      : 0        |                                        |
     512 -&gt; 1023     : 0        |                                        |
    1024 -&gt; 2047     : 0        |                                        |
    2048 -&gt; 4095     : 40147    |*************************************** |
    4096 -&gt; 8191     : 2300     |*                                       |
    8192 -&gt; 16383    : 828      |                                        |
   16384 -&gt; 32767    : 178      |                                        |
   32768 -&gt; 65535    : 59       |                                        |
   65536 -&gt; 131071   : 2        |                                        |
  131072 -&gt; 262143   : 0        |                                        |
  262144 -&gt; 524287   : 1        |                                        |
  524288 -&gt; 1048575  : 174      |                                        |
CPU 3
      latency        : count     distribution
       1 -&gt; 1        : 0        |                                        |
       2 -&gt; 3        : 0        |                                        |
       4 -&gt; 7        : 0        |                                        |
       8 -&gt; 15       : 0        |                                        |
      16 -&gt; 31       : 0        |                                        |
      32 -&gt; 63       : 0        |                                        |
      64 -&gt; 127      : 0        |                                        |
     128 -&gt; 255      : 0        |                                        |
     256 -&gt; 511      : 0        |                                        |
     512 -&gt; 1023     : 0        |                                        |
    1024 -&gt; 2047     : 0        |                                        |
    2048 -&gt; 4095     : 29626    |*************************************** |
    4096 -&gt; 8191     : 2704     |**                                      |
    8192 -&gt; 16383    : 1090     |                                        |
   16384 -&gt; 32767    : 160      |                                        |
   32768 -&gt; 65535    : 72       |                                        |
   65536 -&gt; 131071   : 32       |                                        |
  131072 -&gt; 262143   : 26       |                                        |
  262144 -&gt; 524287   : 12       |                                        |
  524288 -&gt; 1048575  : 298      |                                        |

All this is based on the trace3 examples written by
Alexei Starovoitov &lt;ast@plumgrid.com&gt;.

Signed-off-by: Daniel Wagner &lt;daniel.wagner@bmw-carit.de&gt;
Cc: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: linux-kernel@vger.kernel.org
Cc: netdev@vger.kernel.org
Acked-by: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Acked-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bpf: introduce current-&gt;pid, tgid, uid, gid, comm accessors</title>
<updated>2015-06-15T22:53:50Z</updated>
<author>
<name>Alexei Starovoitov</name>
<email>ast@plumgrid.com</email>
</author>
<published>2015-06-13T02:39:12Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ffeedafbf0236f03aeb2e8db273b3e5ae5f5bc89'/>
<id>urn:sha1:ffeedafbf0236f03aeb2e8db273b3e5ae5f5bc89</id>
<content type='text'>
eBPF programs attached to kprobes need to filter based on
current-&gt;pid, uid and other fields, so introduce helper functions:

u64 bpf_get_current_pid_tgid(void)
Return: current-&gt;tgid &lt;&lt; 32 | current-&gt;pid

u64 bpf_get_current_uid_gid(void)
Return: current_gid &lt;&lt; 32 | current_uid

bpf_get_current_comm(char *buf, int size_of_buf)
stores current-&gt;comm into buf

They can be used from the programs attached to TC as well to classify packets
based on current task fields.

Update tracex2 example to print histogram of write syscalls for each process
instead of aggregated for all.

Signed-off-by: Alexei Starovoitov &lt;ast@plumgrid.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
