]> git.baikalelectronics.ru Git - kernel.git/commit
perf tools: Correct size computation in tracepoint_id_to_path()
authorJulia Lawall <julia@diku.dk>
Sun, 6 Dec 2009 09:16:30 +0000 (10:16 +0100)
committerIngo Molnar <mingo@elte.hu>
Sun, 6 Dec 2009 09:21:59 +0000 (10:21 +0100)
commitac425bb66d115dcfcf7be8e4d011d9c6d25664de
treebef799ddcee211591b462aa683c3f0a3d48efd84
parent444f9f730f5cb5f33069a8c80ab5c203209fa9b4
perf tools: Correct size computation in tracepoint_id_to_path()

The size argument to zalloc should be the size of desired
structure, not the pointer to it.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@expression@
expression *x;
@@

x =
 <+...
-sizeof(x)
+sizeof(*x)
...+>// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <Pine.LNX.4.64.0912061016120.20858@ask.diku.dk>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
tools/perf/util/parse-events.c