• Frederic Weisbecker's avatar
    perf report: Use a modifiable string for default callchain options · be903885
    Frederic Weisbecker authored
    If the user doesn't provide options to tune his callchain output
    (ie: if he uses -c without arguments) then the default value passed
    in the OPT_CALLBACK_DEFAULT() macro is used.
    
    But it's parsed later by strtok() which will replace comma separators
    to a zero. This may segfault as we are using a read-only string.
    
    Use a modifiable one instead, and also fix the "100%" default
    minimum threshold value by turning it into a 0 (output every callchains)
    as it was intended in the origin.
    Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Anton Blanchard <anton@samba.org>
    Cc: Jens Axboe <jens.axboe@oracle.com>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    LKML-Reference: <1246772361-9960-2-git-send-email-fweisbec@gmail.com>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    be903885
builtin-report.c 39.2 KB