• Franck Bui-Huu's avatar
    perf probe: Fix short file name probe location reporting · 32ae2ade
    Franck Bui-Huu authored
    After adding probes, perf-probe(1) reports the probes locations which include
    filenames for certain cases.
    
    But for short file names (whose length < 32), perf-probe didn't display the
    name correctly. It actually skipped the first character.
    
    Here's an example where 'icmp.c' was screwed:
    
       $ perf probe -n -a "icmp.c;sk=*"
       Add new events:
         probe:icmp_push_reply (on @cmp.c)
         probe:icmp_reply     (on @cmp.c)
         probe:icmp_reply_1   (on @cmp.c)
         probe:icmp_send      (on @cmp.c)
         probe:icmp_send_1    (on @cmp.c)
         probe:icmp_error     (on @cmp.c)
         probe:icmp_error_1   (on @cmp.c)
         probe:icmp_error_2   (on @cmp.c)
         probe:icmp_error_3   (on @cmp.c)
    
    This patch fixes this bug in synthesize_perf_probe_point().
    Acked-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
    Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
    LKML-Reference: <m31v588r9k.fsf@gmail.com>
    Signed-off-by: default avatarFranck Bui-Huu <fbuihuu@gmail.com>
    Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    32ae2ade
probe-event.c 41.8 KB