17 Jun, 2020

1 commit

  • kmemleak report:
    [] __kmalloc_track_caller+0x139/0x2b0
    [] kstrndup+0x37/0x80
    [] parse_probe_arg.isra.7+0x3cc/0x630
    [] traceprobe_parse_probe_arg+0x2f5/0x810
    [] trace_kprobe_create+0x2ca/0x950
    [] create_or_delete_trace_kprobe+0xf/0x30
    [] trace_run_command+0x67/0x80
    [] trace_parse_run_command+0xa7/0x140
    [] probes_write+0x10/0x20
    [] __vfs_write+0x30/0x1e0
    [] vfs_write+0x96/0x1b0
    [] ksys_write+0x53/0xc0
    [] __ia32_sys_write+0x15/0x20
    [] do_syscall_32_irqs_on+0x3d/0x260
    [] do_fast_syscall_32+0x39/0xb0
    [] entry_SYSENTER_32+0xaf/0x102

    Post parse_probe_arg(), the FETCH_OP_DATA operation type is overwritten
    to FETCH_OP_ST_STRING, as a result memory is never freed since
    traceprobe_free_probe_arg() iterates only over SYMBOL and DATA op types

    Setup fetch string operation correctly after fetch_op_data operation.

    Link: https://lkml.kernel.org/r/20200615143034.GA1734@cosmos

    Cc: stable@vger.kernel.org
    Fixes: a42e3c4de964 ("tracing/probe: Add immediate string parameter support")
    Acked-by: Masami Hiramatsu
    Signed-off-by: Vamshi K Sthambamkadi
    Signed-off-by: Steven Rostedt (VMware)

    Vamshi K Sthambamkadi
     

20 May, 2020

1 commit

  • Elsewhere in the file, the function trace_kprobe_has_same_kprobe uses
    a trace_probe_event.probes object as the second argument of
    list_for_each_entry, ie as a list head, while the list_for_each_entry
    iterates over the list fields of the trace_probe structures, making
    them the list elements. So, exchange the arguments on the list_add
    call to put the list head in the second argument.

    Since both list_head structures were just initialized, this problem
    did not cause any loss of information.

    Link: https://lkml.kernel.org/r/1588879808-24488-1-git-send-email-Julia.Lawall@inria.fr

    Fixes: 60d53e2c3b75 ("tracing/probe: Split trace_event related data from trace_probe")
    Acked-by: Masami Hiramatsu
    Signed-off-by: Julia Lawall
    Signed-off-by: Steven Rostedt (VMware)

    Julia Lawall
     

27 Jan, 2020

1 commit

  • Thomas Richter reported:

    > Test case 66 'Use vfs_getname probe to get syscall args filenames'
    > is broken on s390, but works on x86. The test case fails with:
    >
    > [root@m35lp76 perf]# perf test -F 66
    > 66: Use vfs_getname probe to get syscall args filenames
    > :Recording open file:
    > [ perf record: Woken up 1 times to write data ]
    > [ perf record: Captured and wrote 0.004 MB /tmp/__perf_test.perf.data.TCdYj\
    > (20 samples) ]
    > Looking at perf.data file for vfs_getname records for the file we touched:
    > FAILED!
    > [root@m35lp76 perf]#

    The root cause was the print_fmt of the kprobe event that referenced the
    "ustring"

    > Setting up the kprobe event using perf command:
    >
    > # ./perf probe "vfs_getname=getname_flags:72 pathname=filename:ustring"
    >
    > generates this format file:
    > [root@m35lp76 perf]# cat /sys/kernel/debug/tracing/events/probe/\
    > vfs_getname/format
    > name: vfs_getname
    > ID: 1172
    > format:
    > field:unsigned short common_type; offset:0; size:2; signed:0;
    > field:unsigned char common_flags; offset:2; size:1; signed:0;
    > field:unsigned char common_preempt_count; offset:3; size:1; signed:0;
    > field:int common_pid; offset:4; size:4; signed:1;
    >
    > field:unsigned long __probe_ip; offset:8; size:8; signed:0;
    > field:__data_loc char[] pathname; offset:16; size:4; signed:1;
    >
    > print fmt: "(%lx) pathname=\"%s\"", REC->__probe_ip, REC->pathname

    Instead of using "__get_str(pathname)" it referenced it directly.

    Link: http://lkml.kernel.org/r/20200124100742.4050c15e@gandalf.local.home

    Cc: stable@vger.kernel.org
    Fixes: 88903c464321 ("tracing/probe: Add ustring type for user-space string")
    Acked-by: Masami Hiramatsu
    Reported-by: Thomas Richter
    Tested-by: Thomas Richter
    Signed-off-by: Steven Rostedt (VMware)

    Steven Rostedt (VMware)
     

22 Jan, 2020

1 commit

  • Commit 99c9a923e97a ("tracing/uprobe: Fix double perf_event
    linking on multiprobe uprobe") moved trace_uprobe_filter on
    trace_probe_event. However, since it introduced a flexible
    data structure with char array and type casting, the
    alignment of trace_uprobe_filter can be broken.

    This changes the type of the array to trace_uprobe_filter
    data strucure to fix it.

    Link: http://lore.kernel.org/r/20200120124022.GA14897@hirez.programming.kicks-ass.net
    Link: http://lkml.kernel.org/r/157966340499.5107.10978352478952144902.stgit@devnote2

    Fixes: 99c9a923e97a ("tracing/uprobe: Fix double perf_event linking on multiprobe uprobe")
    Suggested-by: Peter Zijlstra
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     

15 Jan, 2020

1 commit

  • Fix double perf_event linking to trace_uprobe_filter on
    multiple uprobe event by moving trace_uprobe_filter under
    trace_probe_event.

    In uprobe perf event, trace_uprobe_filter data structure is
    managing target mm filters (in perf_event) related to each
    uprobe event.

    Since commit 60d53e2c3b75 ("tracing/probe: Split trace_event
    related data from trace_probe") left the trace_uprobe_filter
    data structure in trace_uprobe, if a trace_probe_event has
    multiple trace_uprobe (multi-probe event), a perf_event is
    added to different trace_uprobe_filter on each trace_uprobe.
    This leads a linked list corruption.

    To fix this issue, move trace_uprobe_filter to trace_probe_event
    and link it once on each event instead of each probe.

    Link: http://lkml.kernel.org/r/157862073931.1800.3800576241181489174.stgit@devnote2

    Cc: Jiri Olsa
    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Cc: "Naveen N . Rao"
    Cc: Anil S Keshavamurthy
    Cc: "David S . Miller"
    Cc: Namhyung Kim
    Cc: =?utf-8?q?Toke_H=C3=B8iland-J?= =?utf-8?b?w7hyZ2Vuc2Vu?=
    Cc: Jean-Tsung Hsiao
    Cc: Jesper Dangaard Brouer
    Cc: stable@vger.kernel.org
    Fixes: 60d53e2c3b75 ("tracing/probe: Split trace_event related data from trace_probe")
    Link: https://lkml.kernel.org/r/20200108171611.GA8472@kernel.org
    Reported-by: Arnaldo Carvalho de Melo
    Tested-by: Arnaldo Carvalho de Melo
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     

29 Sep, 2019

1 commit

  • Steven reported that a test triggered:

    ==================================================================
    BUG: KASAN: slab-out-of-bounds in trace_kprobe_create+0xa9e/0xe40
    Read of size 8 at addr ffff8880c4f25a48 by task ftracetest/4798

    CPU: 2 PID: 4798 Comm: ftracetest Not tainted 5.3.0-rc6-test+ #30
    Hardware name: Hewlett-Packard HP Compaq Pro 6300 SFF/339A, BIOS K01 v03.03 07/14/2016
    Call Trace:
    dump_stack+0x7c/0xc0
    ? trace_kprobe_create+0xa9e/0xe40
    print_address_description+0x6c/0x332
    ? trace_kprobe_create+0xa9e/0xe40
    ? trace_kprobe_create+0xa9e/0xe40
    __kasan_report.cold.6+0x1a/0x3b
    ? trace_kprobe_create+0xa9e/0xe40
    kasan_report+0xe/0x12
    trace_kprobe_create+0xa9e/0xe40
    ? print_kprobe_event+0x280/0x280
    ? match_held_lock+0x1b/0x240
    ? find_held_lock+0xac/0xd0
    ? fs_reclaim_release.part.112+0x5/0x20
    ? lock_downgrade+0x350/0x350
    ? kasan_unpoison_shadow+0x30/0x40
    ? __kasan_kmalloc.constprop.6+0xc1/0xd0
    ? trace_kprobe_create+0xe40/0xe40
    ? trace_kprobe_create+0xe40/0xe40
    create_or_delete_trace_kprobe+0x2e/0x60
    trace_run_command+0xc3/0xe0
    ? trace_panic_handler+0x20/0x20
    ? kasan_unpoison_shadow+0x30/0x40
    trace_parse_run_command+0xdc/0x163
    vfs_write+0xe1/0x240
    ksys_write+0xba/0x150
    ? __ia32_sys_read+0x50/0x50
    ? tracer_hardirqs_on+0x61/0x180
    ? trace_hardirqs_off_caller+0x43/0x110
    ? mark_held_locks+0x29/0xa0
    ? do_syscall_64+0x14/0x260
    do_syscall_64+0x68/0x260

    Fix to check the difference of nr_args before adding probe
    on existing probes. This also may set the error log index
    bigger than the number of command parameters. In that case
    it sets the error position is next to the last parameter.

    Link: http://lkml.kernel.org/r/156966474783.3478.13217501608215769150.stgit@devnote2

    Fixes: ca89bc071d5e ("tracing/kprobe: Add multi-probe per event support")
    Reported-by: Steven Rostedt (VMware)
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     

17 Sep, 2019

1 commit

  • Fix NULL pointer access in trace_probe_unlink() by initializing
    trace_probe.list correctly in trace_probe_init().

    In the error case of trace_probe_init(), it can call trace_probe_unlink()
    before initializing trace_probe.list member. This causes NULL pointer
    dereference at list_del_init() in trace_probe_unlink().

    Syzbot reported :

    kasan: CONFIG_KASAN_INLINE enabled
    kasan: GPF could be caused by NULL-ptr deref or user memory access
    general protection fault: 0000 [#1] PREEMPT SMP KASAN
    CPU: 1 PID: 8633 Comm: syz-executor797 Not tainted 5.3.0-rc8-next-20190915
    #0
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
    Google 01/01/2011
    RIP: 0010:__list_del_entry_valid+0x85/0xf5 lib/list_debug.c:51
    Code: 0f 84 e1 00 00 00 48 b8 22 01 00 00 00 00 ad de 49 39 c4 0f 84 e2 00
    00 00 48 b8 00 00 00 00 00 fc ff df 4c 89 e2 48 c1 ea 03 3c 02 00 75
    53 49 8b 14 24 4c 39 f2 0f 85 99 00 00 00 49 8d 7d
    RSP: 0018:ffff888090a7f9d8 EFLAGS: 00010246
    RAX: dffffc0000000000 RBX: ffff88809b6f90c0 RCX: ffffffff817c0ca9
    RDX: 0000000000000000 RSI: ffffffff817c0a73 RDI: ffff88809b6f90c8
    RBP: ffff888090a7f9f0 R08: ffff88809a04e600 R09: ffffed1015d26aed
    R10: ffffed1015d26aec R11: ffff8880ae935763 R12: 0000000000000000
    R13: 0000000000000000 R14: ffff88809b6f90c0 R15: ffff88809b6f90d0
    FS: 0000555556f99880(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 00000000006cc090 CR3: 00000000962b2000 CR4: 00000000001406e0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    Call Trace:
    __list_del_entry include/linux/list.h:131 [inline]
    list_del_init include/linux/list.h:190 [inline]
    trace_probe_unlink+0x1f/0x200 kernel/trace/trace_probe.c:959
    trace_probe_cleanup+0xd3/0x110 kernel/trace/trace_probe.c:973
    trace_probe_init+0x3f2/0x510 kernel/trace/trace_probe.c:1011
    alloc_trace_uprobe+0x5e/0x250 kernel/trace/trace_uprobe.c:353
    create_local_trace_uprobe+0x109/0x4a0 kernel/trace/trace_uprobe.c:1508
    perf_uprobe_init+0x131/0x210 kernel/trace/trace_event_perf.c:314
    perf_uprobe_event_init+0x106/0x1a0 kernel/events/core.c:8898
    perf_try_init_event+0x135/0x590 kernel/events/core.c:10184
    perf_init_event kernel/events/core.c:10228 [inline]
    perf_event_alloc.part.0+0x1b89/0x33d0 kernel/events/core.c:10505
    perf_event_alloc kernel/events/core.c:10887 [inline]
    __do_sys_perf_event_open+0xa2d/0x2d00 kernel/events/core.c:10989
    __se_sys_perf_event_open kernel/events/core.c:10871 [inline]
    __x64_sys_perf_event_open+0xbe/0x150 kernel/events/core.c:10871
    do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290
    entry_SYSCALL_64_after_hwframe+0x49/0xbe

    Link: http://lkml.kernel.org/r/156869709721.22406.5153754822203046939.stgit@devnote2

    Reported-by: syzbot+2f807f4d3a2a4e87f18f@syzkaller.appspotmail.com
    Fixes: ca89bc071d5e ("tracing/kprobe: Add multi-probe per event support")
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     

01 Sep, 2019

5 commits

  • Add immediate string parameter (\"string") support to
    probe events. This allows you to specify an immediate
    (or dummy) parameter instead of fetching a string from
    memory.

    This feature looks odd, but imagine that you put a probe
    on a code to trace some string data. If the code is
    compiled into 2 instructions and 1 instruction has a
    string on memory but other has no string since it is
    optimized out. In that case, you can not fold those into
    one event, even if ftrace supported multiple probes on
    one event. With this feature, you can set a dummy string
    like foo=\"(optimized)":string instead of something
    like foo=+0(+0(%bp)):string.

    Link: http://lkml.kernel.org/r/156095691687.28024.13372712423865047991.stgit@devnote2

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     
  • Add immediate value parameter (\1234) support to
    probe events. This allows you to specify an immediate
    (or dummy) parameter instead of fetching from memory
    or register.

    This feature looks odd, but imagine when you put a probe
    on a code to trace some data. If the code is compiled into
    2 instructions and 1 instruction has a value but other has
    nothing since it is optimized out.
    In that case, you can not fold those into one event, even
    if ftrace supported multiple probes on one event.
    With this feature, you can set a dummy value like
    foo=\deadbeef instead of something like foo=%di.

    Link: http://lkml.kernel.org/r/156095690733.28024.13258186548822649469.stgit@devnote2

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     
  • Allow user to delete a probe from event. This is done by head
    match. For example, if we have 2 probes on an event

    $ cat kprobe_events
    p:kprobes/testprobe _do_fork r1=%ax r2=%dx
    p:kprobes/testprobe idle_fork r1=%ax r2=%cx

    Then you can remove one of them by passing the head of definition
    which identify the probe.

    $ echo "-:kprobes/testprobe idle_fork" >> kprobe_events

    Link: http://lkml.kernel.org/r/156095688848.28024.15798690082378432435.stgit@devnote2

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     
  • Add multi-probe per one event support to kprobe events.
    User can define several different probes on one trace event
    if those events have same "event signature",
    e.g.

    # echo p:testevent _do_fork > kprobe_events
    # echo p:testevent fork_idle >> kprobe_events
    # kprobe_events
    p:kprobes/testevent _do_fork
    p:kprobes/testevent fork_idle

    The event signature is defined by kprobe type (retprobe or not),
    the number of args, argument names, and argument types.

    Note that this only support appending method. Delete event
    operation will delete all probes on the event.

    Link: http://lkml.kernel.org/r/156095686913.28024.9357292202316540742.stgit@devnote2

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     
  • Split the trace_event related data from trace_probe data structure
    and introduce trace_probe_event data structure for its folder.
    This trace_probe_event data structure can have multiple trace_probe.

    Link: http://lkml.kernel.org/r/156095683995.28024.7552150340561557873.stgit@devnote2

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     

31 Aug, 2019

1 commit

  • BUG: KASAN: null-ptr-deref in trace_probe_cleanup+0x8d/0xd0
    Read of size 8 at addr 0000000000000000 by task syz-executor.0/9746
    trace_probe_cleanup+0x8d/0xd0
    free_trace_kprobe.part.14+0x15/0x50
    alloc_trace_kprobe+0x23e/0x250

    Link: http://lkml.kernel.org/r/1565220563-980-1-git-send-email-danielliu861@gmail.com

    Fixes: e3dc9f898ef9c ("tracing/probe: Add trace_event_call accesses APIs")
    Signed-off-by: Xinpeng Liu
    Signed-off-by: Steven Rostedt (VMware)

    Xinpeng Liu
     

17 Jul, 2019

5 commits

  • Add trace_event_call access APIs for trace_probe.
    Instead of accessing trace_probe.call directly, use those
    accesses by trace_probe_event_call() method. This hides
    the relationship of trace_event_call and trace_probe from
    trace_kprobe and trace_uprobe.

    Link: http://lkml.kernel.org/r/155931587711.28323.8335129014686133120.stgit@devnote2

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     
  • Add trace_probe_test/set/clear_flag() functions for accessing
    trace_probe.flag field.
    This flags field should not be accessed directly.

    Link: http://lkml.kernel.org/r/155931585683.28323.314290023236905988.stgit@devnote2

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     
  • Add trace_event_file access APIs for trace_probe data structure.
    This simplifies enabling/disabling operations in uprobe and kprobe
    events so that those don't touch deep inside the trace_probe.

    This also removing a redundant synchronization when the
    kprobe event is used from perf, since the perf itself uses
    tracepoint_synchronize_unregister() after disabling (ftrace-
    defined) event, thus we don't have to synchronize in that
    path. Also we don't need to identify local trace_kprobe too
    anymore.

    Link: http://lkml.kernel.org/r/155931584587.28323.372301976283354629.stgit@devnote2

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     
  • Since trace_event_call is a field of trace_probe, these
    operations should be done in trace_probe.c. trace_kprobe
    and trace_uprobe use new functions to register/unregister
    trace_event_call.

    Link: http://lkml.kernel.org/r/155931583643.28323.14828411185591538876.stgit@devnote2

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     
  • Add common trace_probe init and cleanup function in
    trace_probe.c, and use it from trace_kprobe.c and trace_uprobe.c

    Link: http://lkml.kernel.org/r/155931582664.28323.5934870189034740822.stgit@devnote2

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     

26 May, 2019

2 commits

  • Support user-space dereference syntax for probe event arguments
    to dereference the data-structure or array in user-space.

    The syntax is just adding 'u' before an offset value.

    +|-u()

    e.g. +u8(%ax), +u0(+0(%si))

    For example, if you probe do_sched_setscheduler(pid, policy,
    param) and record param->sched_priority, you can add new
    probe as below;

    p do_sched_setscheduler priority=+u0($arg3)

    Note that kprobe event provides this and it doesn't change the
    dereference method automatically because we do not know whether
    the given address is in userspace or kernel on some archs.

    So as same as "ustring", this is an option for user, who has to
    carefully choose the dereference method.

    Link: http://lkml.kernel.org/r/155789872187.26965.4468456816590888687.stgit@devnote2

    Acked-by: Ingo Molnar
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     
  • Add "ustring" type for fetching user-space string from kprobe event.
    User can specify ustring type at uprobe event, and it is same as
    "string" for uprobe.

    Note that probe-event provides this option but it doesn't choose the
    correct type automatically since we have not way to decide the address
    is in user-space or not on some arch (and on some other arch, you can
    fetch the string by "string" type). So user must carefully check the
    target code (e.g. if you see __user on the target variable) and
    use this new type.

    Link: http://lkml.kernel.org/r/155789871009.26965.14167558859557329331.stgit@devnote2

    Acked-by: Ingo Molnar
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     

09 May, 2019

2 commits

  • Replace kzalloc() function with its 2-factor argument form, kcalloc().

    This patch replaces cases of:

    kzalloc(a * b, gfp)

    with:
    kcalloc(a, b, gfp)

    This code was detected with the help of Coccinelle.

    Link: http://lkml.kernel.org/r/20190115043408.GA23456@embeddedor

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Steven Rostedt (VMware)

    Gustavo A. R. Silva
     
  • Fix to make the type of $comm "string". If we set the other type to $comm
    argument, it shows meaningless value or wrong data. Currently probe events
    allow us to set string array type (e.g. ":string[2]"), or other digit types
    like x8 on $comm. But since clearly $comm is just a string data, it should
    not be fetched by other types including array.

    Link: http://lkml.kernel.org/r/155723736241.9149.14582064184468574539.stgit@devnote2

    Cc: Andreas Ziegler
    Cc: Ingo Molnar
    Cc: stable@vger.kernel.org
    Fixes: 533059281ee5 ("tracing: probeevent: Introduce new argument fetching code")
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     

08 Apr, 2019

1 commit

  • As each instance has their own error_log file, it makes more sense that the
    instances show the errors of their own instead of all error_logs having the
    same data. Make it that the errors show up in the instance error_log file
    that the error happens in. If no instance trace_array is available, then
    NULL can be passed in which will create the error in the top level instance
    (the one at the top of the tracefs directory).

    Reviewed-by: Masami Hiramatsu
    Reviewed-by: Tom Zanussi
    Tested-by: Tom Zanussi
    Signed-off-by: Steven Rostedt (VMware)

    Steven Rostedt (VMware)
     

03 Apr, 2019

1 commit

  • Use tracing error_log with probe events for logging error more
    precisely. This also makes all parse error returns -EINVAL
    (except for -ENOMEM), because user can see better error message
    in error_log file now.

    Link: http://lkml.kernel.org/r/6a4d90e141d138040ea61f4776b991597077451e.1554072478.git.tom.zanussi@linux.intel.com

    Acked-by: Masami Hiramatsu
    Acked-by: Namhyung Kim
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     

15 Mar, 2019

3 commits


12 Mar, 2019

1 commit

  • sparse complains:
    CHECK kernel/trace/trace_probe.c
    kernel/trace/trace_probe.c:16:12: warning: symbol 'reserved_field_names' was not declared. Should it be static?

    Yes, it should be static.

    Link: http://lkml.kernel.org/r/2478.1552380778@turing-police

    Signed-off-by: Valdis Kletnieks
    Signed-off-by: Steven Rostedt (VMware)

    Valdis Klētnieks
     

07 Feb, 2019

1 commit

  • There is a plan to build the kernel with -Wimplicit-fallthrough and
    this place in the code produced a warning (W=1).

    This commit remove the following warning:

    kernel/trace/trace_probe.c:302:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

    Link: http://lkml.kernel.org/r/20190114203039.16535-1-malat@debian.org

    Signed-off-by: Mathieu Malaterre
    Signed-off-by: Steven Rostedt (VMware)

    Mathieu Malaterre
     

23 Dec, 2018

2 commits


09 Dec, 2018

2 commits

  • Use dyn_event framework for kprobe events. This shows
    kprobe events on "tracing/dynamic_events" file.

    User can also define new events via tracing/dynamic_events.

    Link: http://lkml.kernel.org/r/154140855646.17322.6619219995865980392.stgit@devbox

    Reviewed-by: Tom Zanussi
    Tested-by: Tom Zanussi
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     
  • Integrate similar argument parsers for kprobes and uprobes events
    into traceprobe_parse_probe_arg().

    Link: http://lkml.kernel.org/r/154140850016.17322.9836787731210512176.stgit@devbox

    Reviewed-by: Tom Zanussi
    Tested-by: Tom Zanussi
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     

05 Nov, 2018

1 commit

  • Fix strpbrk()'s argument order, it must pass acceptable string
    in 2nd argument. Note that this can cause a kernel panic where
    it recovers backup character to code->data.

    Link: http://lkml.kernel.org/r/154108256792.2604.1816052586385217811.stgit@devbox

    Fixes: a6682814f371 ("tracing/kprobes: Allow kprobe-events to record module symbol")
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     

13 Oct, 2018

1 commit

  • Dan's smatch utility found an uninitialized use of offset in a path in
    parse_probe_args(). Unless an offset is specifically specified for commands
    that allow them, it should default to zero.

    Link: http://lkml.kernel.org/r/20181012134246.5doqaobxunlqqs53@mwanda
    Fixes: 533059281ee5 ("tracing: probeevent: Introduce new argument fetching code")
    Reported-by: Dan Carpenter (smatch)
    Signed-off-by: Steven Rostedt (VMware)

    Steven Rostedt (VMware)
     

11 Oct, 2018

5 commits

  • Allow kprobe-events to record module symbols.

    Since data symbols in a non-loaded module doesn't exist, it fails to
    define such symbol as an argument of kprobe-event. But if the kprobe
    event is defined on that module, we can defer to resolve the symbol
    address.

    Note that if given symbol is not found, the event is kept unavailable.
    User can enable it but the event is not recorded.

    Link: http://lkml.kernel.org/r/153547312336.26502.11432902826345374463.stgit@devbox

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     
  • Add $argN special fetch variable for accessing function
    arguments. This allows user to trace the Nth argument easily
    at the function entry.

    Note that this returns most probably assignment of registers
    and stacks. In some case, it may not work well. If you need
    to access correct registers or stacks you should use perf-probe.

    Link: http://lkml.kernel.org/r/152465888632.26224.3412465701570253696.stgit@devbox

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     
  • Add array type support for probe events.
    This allows user to get arraied types from memory address.
    The array type syntax is

    TYPE[N]

    Where TYPE is one of types (u8/16/32/64,s8/16/32/64,
    x8/16/32/64, symbol, string) and N is a fixed value less
    than 64.

    The string array type is a bit different from other types. For
    other base types, [1] is equal to
    (e.g. +0(%di):x32[1] is same as +0(%di):x32.) But string[1] is not
    equal to string. The string type itself represents "char array",
    but string array type represents "char * array". So, for example,
    +0(%di):string[1] is equal to +0(+0(%di)):string.

    Link: http://lkml.kernel.org/r/152465891533.26224.6150658225601339931.stgit@devbox

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     
  • Add "symbol" type to probeevent, which is an alias of u32 or u64
    (depends on BITS_PER_LONG). This shows the result value in
    symbol+offset style. This type is only available with kprobe
    events.

    Link: http://lkml.kernel.org/r/152465882860.26224.14779072294412467338.stgit@devbox

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu
     
  • Append traceprobe_ for exported function set_print_fmt() as
    same as other functions.

    Link: http://lkml.kernel.org/r/152465877071.26224.11143125027282999726.stgit@devbox

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt (VMware)

    Masami Hiramatsu