26 Oct, 2020

1 commit

  • Use a more generic form for __section that requires quotes to avoid
    complications with clang and gcc differences.

    Remove the quote operator # from compiler_attributes.h __section macro.

    Convert all unquoted __section(foo) uses to quoted __section("foo").
    Also convert __attribute__((section("foo"))) uses to __section("foo")
    even if the __attribute__ has multiple list entry forms.

    Conversion done using the script at:

    https://lore.kernel.org/lkml/75393e5ddc272dc7403de74d645e6c6e0f4e70eb.camel@perches.com/2-convert_section.pl

    Signed-off-by: Joe Perches
    Reviewed-by: Nick Desaulniers
    Reviewed-by: Miguel Ojeda
    Signed-off-by: Linus Torvalds

    Joe Perches
     

01 Jul, 2020

4 commits

  • After the previous cleanup, DEFINE_EVENT_PRINT's definition has no
    relationship with DEFINE_EVENT. So After we re-define DEFINE_EVENT, it
    is not necessary to define DEFINE_EVENT_PRINT to be empty again.

    Link: http://lkml.kernel.org/r/20200612092844.56107-5-richard.weiyang@linux.alibaba.com

    Signed-off-by: Wei Yang
    Signed-off-by: Steven Rostedt (VMware)

    Wei Yang
     
  • Current definition define DEFINE_EVENT_PRINT to be DEFINE_EVENT.
    Actually, at this point DEFINE_EVENT is already an empty macro. Let's
    cut the relationship between DEFINE_EVENT_PRINT and DEFINE_EVENT.

    Link: http://lkml.kernel.org/r/20200612092844.56107-4-richard.weiyang@linux.alibaba.com

    Signed-off-by: Wei Yang
    Signed-off-by: Steven Rostedt (VMware)

    Wei Yang
     
  • The definition of DEFINE_EVENT_PRINT is not changed after previous one,
    so not necessary to re-define is as the same form.

    Link: http://lkml.kernel.org/r/20200612092844.56107-3-richard.weiyang@linux.alibaba.com

    Signed-off-by: Wei Yang
    Signed-off-by: Steven Rostedt (VMware)

    Wei Yang
     
  • After un-define DEFINE_EVENT in Stage 2, DEFINE_EVENT is not defined to a
    specific form. It is not necessary to un-define it again.

    Let's skip this.

    Link: http://lkml.kernel.org/r/20200612092844.56107-2-richard.weiyang@linux.alibaba.com

    Signed-off-by: Wei Yang
    Signed-off-by: Steven Rostedt (VMware)

    Wei Yang
     

06 Feb, 2020

1 commit

  • Pull tracing updates from Steven Rostedt:

    - Added new "bootconfig".

    This looks for a file appended to initrd to add boot config options,
    and has been discussed thoroughly at Linux Plumbers.

    Very useful for adding kprobes at bootup.

    Only enabled if "bootconfig" is on the real kernel command line.

    - Created dynamic event creation.

    Merges common code between creating synthetic events and kprobe
    events.

    - Rename perf "ring_buffer" structure to "perf_buffer"

    - Rename ftrace "ring_buffer" structure to "trace_buffer"

    Had to rename existing "trace_buffer" to "array_buffer"

    - Allow trace_printk() to work withing (some) tracing code.

    - Sort of tracing configs to be a little better organized

    - Fixed bug where ftrace_graph hash was not being protected properly

    - Various other small fixes and clean ups

    * tag 'trace-v5.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (88 commits)
    bootconfig: Show the number of nodes on boot message
    tools/bootconfig: Show the number of bootconfig nodes
    bootconfig: Add more parse error messages
    bootconfig: Use bootconfig instead of boot config
    ftrace: Protect ftrace_graph_hash with ftrace_sync
    ftrace: Add comment to why rcu_dereference_sched() is open coded
    tracing: Annotate ftrace_graph_notrace_hash pointer with __rcu
    tracing: Annotate ftrace_graph_hash pointer with __rcu
    bootconfig: Only load bootconfig if "bootconfig" is on the kernel cmdline
    tracing: Use seq_buf for building dynevent_cmd string
    tracing: Remove useless code in dynevent_arg_pair_add()
    tracing: Remove check_arg() callbacks from dynevent args
    tracing: Consolidate some synth_event_trace code
    tracing: Fix now invalid var_ref_vals assumption in trace action
    tracing: Change trace_boot to use synth_event interface
    tracing: Move tracing selftests to bottom of menu
    tracing: Move mmio tracer config up with the other tracers
    tracing: Move tracing test module configs together
    tracing: Move all function tracing configs together
    tracing: Documentation for in-kernel synthetic event API
    ...

    Linus Torvalds
     

25 Jan, 2020

1 commit

  • commit f42c85e74faa422cf0bc747ed808681145448f88 moved tracepoint's ftrace
    creation into include/trace/ftrace.h and trace/define_trace.h was deleted
    as a result. However some comment info does not adapt to the change, which
    is such a misguiding when reading related code.

    This patch fix this by moving trace/trace_events.h to ,
    since tracepoint headers have already been moved to tarce/events/.

    Link: http://lkml.kernel.org/r/1425419298-61941-1-git-send-email-houpengyang@huawei.com

    Signed-off-by: Hou Pengyang
    [ Pulled from the archeological digging of my INBOX ]
    Signed-off-by: Steven Rostedt (VMware)

    Hou Pengyang
     

14 Jan, 2020

1 commit

  • As there's two struct ring_buffers in the kernel, it causes some confusion.
    The other one being the perf ring buffer. It was agreed upon that as neither
    of the ring buffers are generic enough to be used globally, they should be
    renamed as:

    perf's ring_buffer -> perf_buffer
    ftrace's ring_buffer -> trace_buffer

    This implements the changes to the ring buffer that ftrace uses.

    Link: https://lore.kernel.org/r/20191213140531.116b3200@gandalf.local.home

    Signed-off-by: Steven Rostedt (VMware)

    Steven Rostedt (VMware)
     

10 Dec, 2019

1 commit


27 Nov, 2019

2 commits

  • Rework event_create_dir() to use an array of static data instead of
    function pointers where possible.

    The problem is that it would call the function pointer on module load
    before parse_args(), possibly even before jump_labels were initialized.
    Luckily the generated functions don't use jump_labels but it still seems
    fragile. It also gets in the way of changing when we make the module map
    executable.

    The generated function are basically calling trace_define_field() with a
    bunch of static arguments. So instead of a function, capture these
    arguments in a static array, avoiding the function call.

    Now there are a number of cases where the fields are dynamic (syscall
    arguments, kprobes and uprobes), in which case a static array does not
    work, for these we preserve the function call. Luckily all these cases
    are not related to modules and so we can retain the function call for
    them.

    Also fix up all broken tracepoint definitions that now generate a
    compile error.

    Tested-by: Alexei Starovoitov
    Tested-by: Steven Rostedt (VMware)
    Signed-off-by: Peter Zijlstra (Intel)
    Reviewed-by: Steven Rostedt (VMware)
    Acked-by: Alexei Starovoitov
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Cc: Thomas Gleixner
    Link: https://lkml.kernel.org/r/20191111132458.342979914@infradead.org
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • undef is needed for parsing __print_hex_dump in traceevent lib.

    Link: http://lkml.kernel.org/r/1574762791-14883-1-git-send-email-piotrx.maziarz@linux.intel.com

    Signed-off-by: Piotr Maziarz
    Signed-off-by: Cezary Rojewski
    Signed-off-by: Steven Rostedt (VMware)

    Piotr Maziarz
     

15 Nov, 2019

1 commit

  • Without this, buffers can be printed with __print_array macro that has
    no formatting options and can be hard to read. The other way is to
    mimic formatting capability with multiple calls of trace event with one
    call per row which gives performance impact and different timestamp in
    each row.

    Link: http://lkml.kernel.org/r/1573130738-29390-2-git-send-email-piotrx.maziarz@linux.intel.com

    Signed-off-by: Piotr Maziarz
    Signed-off-by: Cezary Rojewski
    Signed-off-by: Steven Rostedt (VMware)

    Piotr Maziarz
     

29 May, 2018

1 commit

  • A zero size static array has special meaning in the ftrace infrastructure.
    Trace events are for recording data in the trace buffers that is normally
    difficult to obtain via probes or function tracing. There is no reason for
    any trace event to declare a zero size static array.

    If one does, BUILD_BUG_ON() will trigger and prevent the kernel from
    compiling.

    Reviewed-by: Namhyung Kim
    Signed-off-by: Steven Rostedt (VMware)

    Steven Rostedt (VMware)
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

14 Jun, 2017

3 commits

  • Perf has a problem that if sizeof() macros are used within TRACE_EVENT()
    macro's they end up in userspace as "sizeof(kernel structure)" which
    cannot properly be parsed. Add a macro which can forward this data
    through the eval_map for userspace utilization.

    Link: http://lkml.kernel.org/r/20170531215653.3240-10-jeremy.linton@arm.com

    Signed-off-by: Jeremy Linton
    Signed-off-by: Steven Rostedt (VMware)

    Jeremy Linton
     
  • Each enum is loaded into the trace_enum_map, as we
    are now using this for more than enums rename it.

    Link: http://lkml.kernel.org/r/20170531215653.3240-3-jeremy.linton@arm.com

    Signed-off-by: Jeremy Linton
    Signed-off-by: Steven Rostedt (VMware)

    Jeremy Linton
     
  • The kernel and its modules have sections containing the enum
    string to value conversions. Rename this section because we
    intend to store more than enums in it.

    Link: http://lkml.kernel.org/r/20170531215653.3240-2-jeremy.linton@arm.com

    Signed-off-by: Jeremy Linton
    Signed-off-by: Steven Rostedt (VMware)

    Jeremy Linton
     

23 Feb, 2017

1 commit

  • Patch series "DAX tracepoints, mm argument simplification", v4.

    This contains both my DAX tracepoint code and Dave Jiang's MM argument
    simplifications. Dave's code was written with my tracepoint code as a
    baseline, so it seemed simplest to keep them together in a single series.

    This patch (of 7):

    Add __print_flags_u64() and the helper trace_print_flags_seq_u64() in the
    same spirit as __print_symbolic_u64() and trace_print_symbols_seq_u64().
    These functions allow us to print symbols associated with flags that are
    64 bits wide even on 32 bit machines.

    These will be used by the DAX code so that we can print the flags set in a
    pfn_t such as PFN_SG_CHAIN, PFN_SG_LAST, PFN_DEV and PFN_MAP.

    Without this new function I was getting errors like the following when
    compiling for i386:

    include/linux/pfn_t.h:13:22: warning: large integer implicitly truncated to unsigned type [-Woverflow]
    #define PFN_SG_CHAIN (1ULL << (BITS_PER_LONG_LONG - 1))
    ^

    Link: http://lkml.kernel.org/r/1484085142-2297-2-git-send-email-ross.zwisler@linux.intel.com
    Signed-off-by: Ross Zwisler
    Reviewed-by: Steven Rostedt
    Cc: Dave Chinner
    Cc: Dave Jiang
    Cc: Jan Kara
    Cc: Matthew Wilcox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ross Zwisler
     

04 Feb, 2017

1 commit

  • Steven suggested to improve trace_print_hex_seq() a bit after commit
    2acae0d5b0f7 ("trace: add variant without spacing in trace_print_hex_seq")
    in two ways: i) by adding a kdoc comment for the helper function
    itself and ii) by renaming 'spacing' argument into 'concatenate'
    to better denote that we don't add spaces between each hex bytes.

    Suggested-by: Steven Rostedt
    Signed-off-by: Daniel Borkmann
    Signed-off-by: David S. Miller

    Daniel Borkmann
     

26 Jan, 2017

1 commit

  • For upcoming tracepoint support for BPF, we want to dump the program's
    tag. Format should be similar to __print_hex(), but without spacing.
    Add a __print_hex_str() variant for exactly that purpose that reuses
    trace_print_hex_seq().

    Signed-off-by: Daniel Borkmann
    Cc: Steven Rostedt
    Cc: Arnaldo Carvalho de Melo
    Signed-off-by: David S. Miller

    Daniel Borkmann
     

16 Jul, 2016

1 commit

  • __get_str(str)'s definition includes a (char *) operator
    overloading that is not protected with outer ().

    This patch adds () around __get_str()'s definition, enabling
    some code cleanup.

    Link: http://lkml.kernel.org/r/20ac1a10c2ec4ccd23e4a8ef34101fb6e4157d37.1467407618.git.bristot@redhat.com

    Cc: Trond Myklebust
    Cc: Anna Schumaker
    Cc: Ingo Molnar
    Suggested-by: Steven Rostedt
    Reviewed-by: Steven Rostedt
    Signed-off-by: Daniel Bristot de Oliveira
    Signed-off-by: Steven Rostedt

    Daniel Bristot de Oliveira
     

08 Apr, 2016

1 commit

  • now all calls to perf_trace_buf_submit() pass 0 as 4th
    argument which will be repurposed in the next patch which will
    change the meaning of 1st arg of perf_tp_event() to event_type

    Signed-off-by: Alexei Starovoitov
    Acked-by: Peter Zijlstra (Intel)
    Signed-off-by: David S. Miller

    Alexei Starovoitov
     

24 Dec, 2015

1 commit

  • TRACE_EVENT_FN can't be used in some circumstances
    like invoking trace functions from offlined CPU due
    to RCU usage.

    This patch adds the TRACE_EVENT_FN_COND macro
    to make such trace points conditional.

    Link: http://lkml.kernel.org/r/1450124286-4822-1-git-send-email-kda@linux-powerpc.org

    Signed-off-by: Denis Kirjanov
    Signed-off-by: Steven Rostedt

    Denis Kirjanov
     

23 Sep, 2015

1 commit


14 May, 2015

11 commits


15 Apr, 2009

1 commit

  • This patch moves the ftrace creation into include/trace/ftrace.h and
    simplifies the work of developers in adding new tracepoints.
    Just the act of creating the trace points in include/trace and including
    define_trace.h will create the events in the debugfs/tracing/events
    directory.

    This patch removes the need of include/trace/trace_events.h

    Signed-off-by: Steven Rostedt

    Steven Rostedt
     

12 Apr, 2009

1 commit

  • TRACE_EVENT is a more generic way to define tracepoints.
    Doing so adds these new capabilities to this tracepoint:

    - zero-copy and per-cpu splice() tracing
    - binary tracing without printf overhead
    - structured logging records exposed under /debug/tracing/events
    - trace events embedded in function tracer output and other plugins
    - user-defined, per tracepoint filter expressions

    Signed-off-by: Zhao Lei
    Acked-by: Eduard - Gabriel Munteanu
    Acked-by: Pekka Enberg
    Cc: Steven Rostedt
    Cc: Frederic Weisbecker
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Zhaolei
     

10 Apr, 2009

1 commit

  • TRACE_EVENT is a more generic way to define a tracepoint.
    Doing so adds these new capabilities to this tracepoint:

    - zero-copy and per-cpu splice() tracing
    - binary tracing without printf overhead
    - structured logging records exposed under /debug/tracing/events
    - trace events embedded in function tracer output and other plugins
    - user-defined, per tracepoint filter expressions

    Signed-off-by: Zhao Lei
    Acked-by: Neil Horman
    Cc: "David S. Miller"
    Cc: Arnaldo Carvalho de Melo
    Cc: "Steven Rostedt ;"
    Cc: Frederic Weisbecker
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Zhaolei
     

05 Mar, 2009

1 commit

  • Augment the traces with lock names when lockdep is available:

    1) | down_read_trylock() {
    1) | _spin_lock_irqsave() {
    1) | /* lock_acquire: &sem->wait_lock */
    1) 4.201 us | }
    1) | _spin_unlock_irqrestore() {
    1) | /* lock_release: &sem->wait_lock */
    1) 3.523 us | }
    1) | /* lock_acquire: try read &mm->mmap_sem */
    1) + 13.386 us | }
    1) 1.635 us | find_vma();
    1) | handle_mm_fault() {
    1) | __do_fault() {
    1) | filemap_fault() {
    1) | find_lock_page() {
    1) | find_get_page() {
    1) | /* lock_acquire: read rcu_read_lock */
    1) | /* lock_release: rcu_read_lock */
    1) 5.697 us | }
    1) 8.158 us | }
    1) + 11.079 us | }
    1) | _spin_lock() {
    1) | /* lock_acquire: __pte_lockptr(page) */
    1) 3.949 us | }
    1) 1.460 us | page_add_file_rmap();
    1) | _spin_unlock() {
    1) | /* lock_release: __pte_lockptr(page) */
    1) 3.115 us | }
    1) | unlock_page() {
    1) 1.421 us | page_waitqueue();
    1) 1.220 us | __wake_up_bit();
    1) 6.519 us | }
    1) + 34.328 us | }
    1) + 37.452 us | }
    1) | up_read() {
    1) | /* lock_release: &mm->mmap_sem */
    1) | _spin_lock_irqsave() {
    1) | /* lock_acquire: &sem->wait_lock */
    1) 3.865 us | }
    1) | _spin_unlock_irqrestore() {
    1) | /* lock_release: &sem->wait_lock */
    1) 8.562 us | }
    1) + 17.370 us | }

    Signed-off-by: Peter Zijlstra
    Cc: Steven Rostedt
    Cc: =?ISO-8859-1?Q?T=F6r=F6k?= Edwin
    Cc: Jason Baron
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

28 Feb, 2009

1 commit

  • Impact: clean up

    To further facilitate the ease of adding trace points for developers, this
    patch creates include/trace/trace_events.h and
    include/trace/trace_event_types.h.

    The former file will hold the trace/.h files and the latter will hold
    the trace/_event_types.h files.

    To create new tracepoints and to have them automatically
    appear in the event tracer, a developer makes the trace/.h file
    which includes and the trace/_event_types.h file.

    The trace/_event_types.h file will hold the TRACE_FORMAT
    macros.

    Then add the trace/.h file to trace/trace_events.h,
    and add the trace/_event_types.h to the trace_event_types.h file.

    No need to modify files elsewhere.

    Signed-off-by: Steven Rostedt

    Steven Rostedt