<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/tools, branch v3.3</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/tools?h=v3.3</id>
<link rel='self' href='https://git.amat.us/linux/atom/tools?h=v3.3'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-03-14T15:42:34Z</updated>
<entry>
<title>perf tools, x86: Build perf on older user-space as well</title>
<updated>2012-03-14T15:42:34Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2012-03-14T15:42:34Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=eae7a755ee81129370c8f555b0d5672e6673735d'/>
<id>urn:sha1:eae7a755ee81129370c8f555b0d5672e6673735d</id>
<content type='text'>
On ancient systems I get this build failure:

  util/../../../arch/x86/include/asm/unistd.h:67:29: error: asm/unistd_64.h: No such file or directory
  In file included from util/cache.h:7,
                   from builtin-test.c:8:
  util/../perf.h: In function ‘sys_perf_event_open’:In file included from util/../perf.h:16
  perf.h:170: error: ‘__NR_perf_event_open’ undeclared (first use in this function)

The reason is that this old system does not have the split
unistd.h headers yet, from which to pick up the syscall
definitions.

Add the syscall numbers to the already existing i386 and x86_64
blocks in perf.h, and also provide empty include file stubs.

With this patch perf builds and works fine on 5 years old
user-space as well.

Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Link: http://lkml.kernel.org/n/tip-jctwg64le1w47tuaoeyftsg9@git.kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf tools: Use scnprintf where applicable</title>
<updated>2012-03-14T15:36:19Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
<email>acme@redhat.com</email>
</author>
<published>2012-03-14T15:29:29Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e7f01d1e3d8d501deb8abeaa269d5d48a703b8b0'/>
<id>urn:sha1:e7f01d1e3d8d501deb8abeaa269d5d48a703b8b0</id>
<content type='text'>
Several places were expecting that the value returned was the number of
characters printed, not what would be printed if there was space.

Fix it by using the scnprintf and vscnprintf variants we inherited from
the kernel sources.

Some corner cases where the number of printed characters were not
accounted were fixed too.

Reported-by: Anton Blanchard &lt;anton@samba.org&gt;
Cc: Anton Blanchard &lt;anton@samba.org&gt;
Cc: Eric B Munson &lt;emunson@mgebm.net&gt;
Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Cc: Yanmin Zhang &lt;yanmin_zhang@linux.intel.com&gt;
Cc: stable@kernel.org
Link: http://lkml.kernel.org/n/tip-kwxo2eh29cxmd8ilixi2005x@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf tools: Incorrect use of snprintf results in SEGV</title>
<updated>2012-03-14T15:36:19Z</updated>
<author>
<name>Anton Blanchard</name>
<email>anton@samba.org</email>
</author>
<published>2012-03-07T00:42:49Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b832796caa1fda8516464a003c8c7cc547bc20c2'/>
<id>urn:sha1:b832796caa1fda8516464a003c8c7cc547bc20c2</id>
<content type='text'>
I have a workload where perf top scribbles over the stack and we SEGV.
What makes it interesting is that an snprintf is causing this.

The workload is a c++ gem that has method names over 3000 characters
long, but snprintf is designed to avoid overrunning buffers. So what
went wrong?

The problem is we assume snprintf returns the number of characters
written:

    ret += repsep_snprintf(bf + ret, size - ret, "[%c] ", self-&gt;level);
...
    ret += repsep_snprintf(bf + ret, size - ret, "%s", self-&gt;ms.sym-&gt;name);

Unfortunately this is not how snprintf works. snprintf returns the
number of characters that would have been written if there was enough
space. In the above case, if the first snprintf returns a value larger
than size, we pass a negative size into the second snprintf and happily
scribble over the stack. If you have 3000 character c++ methods thats a
lot of stack to trample.

This patch fixes repsep_snprintf by clamping the value at size - 1 which
is the maximum snprintf can write before adding the NULL terminator.

I get the sinking feeling that there are a lot of other uses of snprintf
that have this same bug, we should audit them all.

Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: Eric B Munson &lt;emunson@mgebm.net&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Yanmin Zhang &lt;yanmin_zhang@linux.intel.com&gt;
Cc: stable@kernel.org
Link: http://lkml.kernel.org/r/20120307114249.44275ca3@kryten
Signed-off-by: Anton Blanchard &lt;anton@samba.org&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf record: Fix buffer overrun bug in tracepoint_id_to_path()</title>
<updated>2012-03-13T16:01:28Z</updated>
<author>
<name>Stephane Eranian</name>
<email>eranian@google.com</email>
</author>
<published>2012-03-13T15:51:02Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8aa8a7c80ccdfac2df5ee48a51a4a7bee2143d4f'/>
<id>urn:sha1:8aa8a7c80ccdfac2df5ee48a51a4a7bee2143d4f</id>
<content type='text'>
This patch fixes a buffer overrun bug in
tracepoint_id_to_path(). The bug manisfested itself as a memory
error reported by perf record. I ran into it with perf sched:

 $ perf sched rec noploop 2 noploop for 2 seconds
 [ perf record: Woken up 14 times to write data ]
 [ perf record: Captured and wrote 42.701 MB perf.data (~1865622 samples) ]
 Fatal: No memory to alloc tracepoints list

It turned out that tracepoint_id_to_path() was reading the
tracepoint id using read() but the buffer was not large enough
to include the \n terminator for id with 4 digits or more.

The patch fixes the problem by extending the buffer to a more
reasonable size covering all possible id length include \n
terminator. Note that atoll() stops at the first non digit
character, thus it is not necessary to clear the buffer between
each read.

Signed-off-by: Stephane Eranian &lt;eranian@google.com&gt;
Acked-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: fweisbec@gmail.com
Cc: dsahern@gmail.com
Link: http://lkml.kernel.org/r/20120313155102.GA6465@quad
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2012-03-06T00:23:12Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-03-06T00:23:12Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f3969bf78f140f437f51787dfc2751943ba454d1'/>
<id>urn:sha1:f3969bf78f140f437f51787dfc2751943ba454d1</id>
<content type='text'>
Pull perf fixes from Ingo Molnar:
 "It contains three cherry-picked fixes from perf/core, which turned out
  to be more urgent than we originally thought."

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf tools: Handle kernels that don't support attr.exclude_{guest,host}
  perf tools: Change perf_guest default back to false
  perf record: No build id option fails
</content>
</entry>
<entry>
<title>perf tools: Handle kernels that don't support attr.exclude_{guest,host}</title>
<updated>2012-03-03T15:19:56Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
<email>acme@redhat.com</email>
</author>
<published>2012-02-14T16:05:30Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=bc76efe64533305b55d1f0834fd03414da8a12b2'/>
<id>urn:sha1:bc76efe64533305b55d1f0834fd03414da8a12b2</id>
<content type='text'>
Just fall back to resetting those fields, if set, warning the user that
that feature is not available.

If guest samples appear they will just be discarded because no struct
machine will be found and thus the event will be accounted as not
handled and dropped, see 0c09571.

Reported-by: Namhyung Kim &lt;namhyung@gmail.com&gt;
Tested-by: Joerg Roedel &lt;joerg.roedel@amd.com&gt;
Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Joerg Roedel &lt;joerg.roedel@amd.com&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Link: http://lkml.kernel.org/n/tip-vuwxig36mzprl5n7nzvnxxsh@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf tools: Change perf_guest default back to false</title>
<updated>2012-03-03T15:13:41Z</updated>
<author>
<name>Joerg Roedel</name>
<email>joerg.roedel@amd.com</email>
</author>
<published>2012-02-10T17:05:05Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8f54ed4a2d8cf001456d3779bdb33985a050bf03'/>
<id>urn:sha1:8f54ed4a2d8cf001456d3779bdb33985a050bf03</id>
<content type='text'>
Setting perf_guest to true by default makes no sense because the perf
subcommands can not setup guest symbol information and thus not process
and guest samples. The only exception is perf-kvm which changes the
perf_guest value on its own.  So change the default for perf_guest back
to false.

Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Jason Wang &lt;jasowang@redhat.com&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Link: http://lkml.kernel.org/r/1328893505-4115-3-git-send-email-joerg.roedel@amd.com
Signed-off-by: Joerg Roedel &lt;joerg.roedel@amd.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf record: No build id option fails</title>
<updated>2012-03-03T14:02:16Z</updated>
<author>
<name>David Ahern</name>
<email>dsahern@gmail.com</email>
</author>
<published>2012-02-06T22:27:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6e557a6adfdbb511dbfa7a0a4aa2148f76a01c6d'/>
<id>urn:sha1:6e557a6adfdbb511dbfa7a0a4aa2148f76a01c6d</id>
<content type='text'>
A recent refactoring of perf-record introduced the following:

perf record -a -B
Couldn't generating buildids. Use --no-buildid to profile anyway.
sleep: Terminated

I believe the triple negative was meant to be only a double negative.
:-) While I'm there, fixed the grammar on the error message.

Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Robert Richter &lt;robert.richter@amd.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: http://lkml.kernel.org/r/1328567272-13190-1-git-send-email-dsahern@gmail.com
Signed-off-by: David Ahern &lt;dsahern@gmail.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>Merge branches 'core-urgent-for-linus', 'perf-urgent-for-linus' and 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2012-03-02T19:38:43Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-03-02T19:38:43Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2273d5ccb882106a74c7b780a6bfa16fb210cd24'/>
<id>urn:sha1:2273d5ccb882106a74c7b780a6bfa16fb210cd24</id>
<content type='text'>
Pulling latest branches from Ingo:

* 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  memblock: Fix size aligning of memblock_alloc_base_nid()

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf probe: Ensure offset provided is not greater than function length without DWARF info too
  perf tools: Ensure comm string is properly terminated
  perf probe: Ensure offset provided is not greater than function length
  perf evlist: Return first evsel for non-sample event on old kernel
  perf/hwbp: Fix a possible memory leak

* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  CPU hotplug, cpusets, suspend: Don't touch cpusets during suspend/resume
</content>
</entry>
<entry>
<title>perf probe: Ensure offset provided is not greater than function length without DWARF info too</title>
<updated>2012-02-29T21:29:46Z</updated>
<author>
<name>Prashanth Nageshappa</name>
<email>prashanth@linux.vnet.ibm.com</email>
</author>
<published>2012-02-28T04:13:01Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1c1bc9223387dacc48eb2b61b0baabe7e9cf47f6'/>
<id>urn:sha1:1c1bc9223387dacc48eb2b61b0baabe7e9cf47f6</id>
<content type='text'>
The 'perf probe' command allows kprobe to be inserted at any offset from
a function start, which results in adding kprobes to unintended
location.  (example: perf probe do_fork+10000 is allowed even though
size of do_fork is ~904).

My previous patch https://lkml.org/lkml/2012/2/24/42 addressed the case
where DWARF info was available for the kernel. This patch fixes the
case where perf probe is used on a kernel without debuginfo available.

Acked-by: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
Cc: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Cc: Jason Baron &lt;jbaron@redhat.com&gt;
Cc: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
Cc: Srikar Dronamraju &lt;srikar@linux.vnet.ibm.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Link: http://lkml.kernel.org/r/4F4C544D.1010909@linux.vnet.ibm.com
Signed-off-by: Prashanth Nageshappa &lt;prashanth@linux.vnet.ibm.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
</feed>
