diff options
author | Arnaldo Carvalho de Melo <[email protected]> | 2019-07-18 20:19:30 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2019-07-29 18:34:42 -0300 |
commit | 30a910d7d3e04dd920e4ca3e8dcabf10c67fb03e (patch) | |
tree | ff1f7977fd926a335a426703e892077d79d850ed /tools/perf/tests/code-reading.c | |
parent | b8b1033fcaa091d82289698d7179e84e28cbd92a (diff) |
perf trace: Preallocate the syscall table
We'll continue reading its details from tracefs as we need it, but
preallocate the whole thing otherwise we may realloc and end up with
pointers to the previous buffer.
I.e. in an upcoming algorithm we'll look for syscalls that have function
signatures that are similar to a given syscall to see if we can reuse
its BPF augmenter, so we may be at syscall 42, having a 'struct syscall'
pointing to that slot in trace->syscalls.table[] and try to read the
slot for an yet unread syscall, which would realloc that table to read
the info for syscall 43, say, which would trigger a realoc of
trace->syscalls.table[], and then the pointer we had for syscall 42
would be pointing to the previous block of memory. b00m.
Cc: Adrian Hunter <[email protected]>
Cc: Brendan Gregg <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Luis Cláudio Gonçalves <[email protected]>
Cc: Namhyung Kim <[email protected]>
Link: https://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/tests/code-reading.c')
0 files changed, 0 insertions, 0 deletions