diff options
| author | Federico Vaga <[email protected]> | 2018-01-12 00:47:48 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2018-01-17 13:22:19 +0000 |
| commit | 67dfc376f3dfdc39b9125f32d5b24053a4da264f (patch) | |
| tree | b8025b85da4c1a82de5f0b9fe6566d654d1be469 /tools/perf/scripts/python/event_analyzing_sample.py | |
| parent | tools lib traceevent: Show contents (in hex) of data of unrecognized type rec... (diff) | |
| download | kernel-67dfc376f3dfdc39b9125f32d5b24053a4da264f.tar.gz kernel-67dfc376f3dfdc39b9125f32d5b24053a4da264f.zip | |
tools lib traceevent: Use asprintf when possible
It makes the code clearer and less error prone.
clearer:
- less code
- the code is now using the same format to create strings dynamically
less error prone:
- no magic number +2 +9 +5 to compute the size
- no copy&paste of the strings to compute the size and to concatenate
The function `asprintf` is not POSIX standard but the program
was already using it. Later it can be decided to use only POSIX
functions, then we can easly replace all the `asprintf(3)` with a local
implementation of that function.
Signed-off-by: Federico Vaga <[email protected]>
Acked-by: Namhyung Kim <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Federico Vaga <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Steven Rostedt <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/event_analyzing_sample.py')
0 files changed, 0 insertions, 0 deletions
