linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] tracing: Updates for 5.2
@ 2019-05-15 17:36 Steven Rostedt
  2019-05-15 23:29 ` Linus Torvalds
  2019-05-15 23:50 ` pr-tracker-bot
  0 siblings, 2 replies; 7+ messages in thread
From: Steven Rostedt @ 2019-05-15 17:36 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: LKML, Ingo Molnar, Andrew Morton

Linus,

The major changes in this tracing update includes:

 - Removing of non-DYNAMIC_FTRACE from 32bit x86

 - Removing of mcount support from x86

 - Emulating a call from int3 on x86_64, fixes live kernel patching

 - Consolidated Tracing Error logs file

Minor updates:

 - Removal of klp_check_compiler_support()

 - kdb ftrace dumping output changes

 - Accessing and creating ftrace instances from inside the kernel

 - Clean up of #define if macro

 - Introduction of TRACE_EVENT_NOP() to disable trace events based on config
   options

And other minor fixes and clean ups

 *** NOTE *** This has conflicts with your tree, with the following files:

     Conflicts:
            arch/x86/entry/entry_64.S
            include/linux/compiler.h

I did a merge against the commit d7a02fa0a8f9ec in your tree, and put
my conflict resolution at my branch in the same tree as this pull request:

  ftrace/conflicts


Please pull the latest trace-v5.2 tree, which can be found at:


  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
trace-v5.2

Tag SHA1: 666ff819de73a218eae4b7850ce9112942b40d4e
Head SHA1: 693713cbdb3a4bda5a8a678c31f06560bbb14657

Anders Roxell (1):
      tracing: Allow RCU to run between postponed startup tests

Colin Ian King (1):
      tracing: Fix white space issues in parse_pred() function

Divya Indi (1):
      tracing: Kernel access to Ftrace instances

Douglas Anderson (3):
      tracing: kdb: The skip_lines parameter should have been skip_entries
      tracing: Add trace_total_entries() / trace_total_entries_cpu()
      tracing: kdb: Allow ftdump to skip all but the last few entries

Elazar Leibovich (1):
      tracing: Fix partial reading of trace event's id file

Gustavo A. R. Silva (1):
      tracing: Replace kzalloc with kcalloc

Jiri Kosina (1):
      livepatch: Remove klp_check_compiler_support()

Josh Poimboeuf (1):
      x86_64: Add gap to int3 to allow for call emulation

Linus Torvalds (1):
      tracing: Simplify "if" macro code

Masami Hiramatsu (5):
      tracing: Use tracing error_log with probe events
      selftests/ftrace: Add error_log testcase for probe errors
      tracing: uprobes: Re-enable $comm support for uprobe events
      tracing: probeevent: Do not accumulate on ret variable
      tracing: probeevent: Fix to make the type of $comm string

Peter Zijlstra (2):
      x86_64: Allow breakpoints to emulate call instructions
      ftrace/x86_64: Emulate call function while updating in breakpoint handler

Rasmus Villemoes (1):
      tracing: Eliminate const char[] auto variables

Srivatsa S. Bhat (VMware) (1):
      tracing: Fix documentation about disabling options using trace_options

Steven Rostedt (VMware) (10):
      tracing: Add trace_array parameter to create_event_filter()
      tracing: Have histogram code pass around trace_array for error handling
      tracing: Have the error logs show up in the proper instances
      ftrace: Remove ASSIGN_OPS_HASH() macro from ftrace.c
      ftrace: Do not process STUB functions in ftrace_ops_list_func()
      function_graph: Have selftest also emulate tr->reset() as it did with tr->init()
      function_graph: Place ftrace_graph_entry_stub() prototype in include/linux/ftrace.h
      ftrace/x86_32: Remove support for non DYNAMIC_FTRACE
      ftrace/x86: Remove mcount support
      x86: Hide the int3_emulate_call/jmp functions from UML

Tom Zanussi (9):
      tracing: Add tracing error log
      tracing: Save the last hist command's associated event name
      tracing: Use tracing error_log with hist triggers
      tracing: Use tracing error_log with trace event filters
      selftests/ftrace: Move kprobe/uprobe check_error() to test.d/functions
      selftests/ftrace: Remove trigger-extended-error-support testcase
      selftests/ftrace: Add tracing/error_log testcase
      tracing: Add tracing/error_log Documentation
      tracing: Add error_log to README

Yafang Shao (3):
      tracing: introduce TRACE_EVENT_NOP()
      sched/fair: do not expose some tracepoints to user if CONFIG_SCHEDSTATS is not set
      rcu: validate arguments for rcu tracepoints

Yangtao Li (1):
      ring-buffer: Fix mispelling of Calculate

YueHaibing (1):
      ring-buffer: Fix ring buffer size in rb_write_something()

----
Documentation/trace/ftrace.rst                     |  31 ++
 Documentation/trace/histogram.rst                  |  16 +-
 arch/nds32/kernel/ftrace.c                         |   1 -
 arch/parisc/kernel/ftrace.c                        |   1 -
 arch/powerpc/include/asm/livepatch.h               |   5 -
 arch/s390/include/asm/livepatch.h                  |   5 -
 arch/x86/Kconfig                                   |  11 +
 arch/x86/entry/entry_64.S                          |  18 +-
 arch/x86/include/asm/ftrace.h                      |   8 +-
 arch/x86/include/asm/livepatch.h                   |   8 -
 arch/x86/include/asm/text-patching.h               |  30 ++
 arch/x86/kernel/ftrace.c                           |  32 +-
 arch/x86/kernel/ftrace_32.S                        |  75 +---
 arch/x86/kernel/ftrace_64.S                        |  28 +-
 include/linux/compiler.h                           |  35 +-
 include/linux/ftrace.h                             |   2 +
 include/linux/tracepoint.h                         |  15 +
 include/trace/define_trace.h                       |   8 +
 include/trace/events/rcu.h                         |  81 ++--
 include/trace/events/sched.h                       |  21 +-
 kernel/livepatch/core.c                            |   8 -
 kernel/rcu/rcu.h                                   |   9 +-
 kernel/rcu/tree.c                                  |   8 +-
 kernel/trace/ftrace.c                              |   9 +-
 kernel/trace/ring_buffer.c                         |   2 +-
 kernel/trace/ring_buffer_benchmark.c               |   2 +-
 kernel/trace/trace.c                               | 417 ++++++++++++++++++---
 kernel/trace/trace.h                               |  13 +-
 kernel/trace/trace_events.c                        |   4 +-
 kernel/trace/trace_events_filter.c                 |  84 +++--
 kernel/trace/trace_events_hist.c                   | 268 +++++++------
 kernel/trace/trace_events_trigger.c                |   3 +-
 kernel/trace/trace_kdb.c                           |  61 +--
 kernel/trace/trace_kprobe.c                        |  77 ++--
 kernel/trace/trace_probe.c                         | 291 +++++++++-----
 kernel/trace/trace_probe.h                         |  78 +++-
 kernel/trace/trace_probe_tmpl.h                    |   2 +-
 kernel/trace/trace_selftest.c                      |   5 +-
 kernel/trace/trace_uprobe.c                        |  57 ++-
 .../ftrace/test.d/ftrace/tracing-error-log.tc      |  19 +
 tools/testing/selftests/ftrace/test.d/functions    |  12 +
 .../ftrace/test.d/kprobe/kprobe_syntax_errors.tc   |  85 +++++
 .../ftrace/test.d/kprobe/uprobe_syntax_errors.tc   |  23 ++
 .../inter-event/trigger-extended-error-support.tc  |  28 --
 44 files changed, 1345 insertions(+), 651 deletions(-)
create mode 100644 tools/testing/selftests/ftrace/test.d/ftrace/tracing-error-log.tc
 create mode 100644 tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
 create mode 100644 tools/testing/selftests/ftrace/test.d/kprobe/uprobe_syntax_errors.tc
 delete mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-extended-error-support.tc
---------------------------

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [GIT PULL] tracing: Updates for 5.2
  2019-05-15 17:36 [GIT PULL] tracing: Updates for 5.2 Steven Rostedt
@ 2019-05-15 23:29 ` Linus Torvalds
  2019-05-15 23:31   ` Linus Torvalds
  2019-05-16  9:08   ` David Laight
  2019-05-15 23:50 ` pr-tracker-bot
  1 sibling, 2 replies; 7+ messages in thread
From: Linus Torvalds @ 2019-05-15 23:29 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: LKML, Ingo Molnar, Andrew Morton

On Wed, May 15, 2019 at 10:36 AM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> The major changes in this tracing update includes:

This is not directly related to this pull request, but newer versions
of gcc hate your trace_iterator clearing trick.

This code:

                /* reset all but tr, trace, and overruns */
                memset(&iter.seq, 0,
                       sizeof(struct trace_iterator) -
                       offsetof(struct trace_iterator, seq));

not only has a completely misleading comment (it resets a lot more
than the comment states), but modern gcc looks at that code and says
"oh, you're passing it a pointer to 'iter.seq', but then clearing a
lot more than a 'trace_seq'":

  In function ‘memset’,
      inlined from ‘ftrace_dump’ at kernel/trace/trace.c:8914:3:
 /include/linux/string.h:344:9: warning: ‘__builtin_memset’ offset
[8505, 8560] from the object at ‘iter’ is out of the bounds of
referenced subobject ‘seq’ with type ‘struct trace_seq’ at offset 4368
[-Warray-bounds]
    344 |  return __builtin_memset(p, c, size);
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

It's a somewhat annoying warning because the code itself is
technically correct, but at the same time, I think the gcc warning is
reasonable. You *are* passing it a 'struct trace_seq' pointer, and
then you're clearing a whole lot more than that.

One option is to just rewrite it something like

        const unsigned int offset = offsetof(struct trace_iterator, seq);
        memset(offset+(void *)&iter, 0, sizeof(iter) - offset);

which should compile cleanly - because now you're doing the memset on
a part of the much bigger 'iter' structure, not on one member (and
overflowing that one member).

Another option might be to separate the zeroed part of the structure
into a sub-structure of its own, and then just use

        memset(&iter.sub, 0, sizeof(iter.sub));

but then you'd obviously have to change all the uses of the sub-fields..

                      Linus

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [GIT PULL] tracing: Updates for 5.2
  2019-05-15 23:29 ` Linus Torvalds
@ 2019-05-15 23:31   ` Linus Torvalds
  2019-05-16  0:27     ` Steven Rostedt
  2019-05-16  9:08   ` David Laight
  1 sibling, 1 reply; 7+ messages in thread
From: Linus Torvalds @ 2019-05-15 23:31 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: LKML, Ingo Molnar, Andrew Morton

On Wed, May 15, 2019 at 4:29 PM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> One option is to just rewrite it something like
>
>         const unsigned int offset = offsetof(struct trace_iterator, seq);
>         memset(offset+(void *)&iter, 0, sizeof(iter) - offset);

Side note: make it a well-named helper function, since
"ftrace_dump_buf()" does this too in kernel/trace/trace_kdb.c, and
gets the exact same warning.

              Linus

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [GIT PULL] tracing: Updates for 5.2
  2019-05-15 17:36 [GIT PULL] tracing: Updates for 5.2 Steven Rostedt
  2019-05-15 23:29 ` Linus Torvalds
@ 2019-05-15 23:50 ` pr-tracker-bot
  1 sibling, 0 replies; 7+ messages in thread
From: pr-tracker-bot @ 2019-05-15 23:50 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Linus Torvalds, LKML, Ingo Molnar, Andrew Morton

The pull request you sent on Wed, 15 May 2019 13:36:14 -0400:

> git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git trace-v5.2

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/d2d8b146043ae7e250aef1fb312971f6f479d487

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [GIT PULL] tracing: Updates for 5.2
  2019-05-15 23:31   ` Linus Torvalds
@ 2019-05-16  0:27     ` Steven Rostedt
  2019-05-16  1:21       ` Linus Torvalds
  0 siblings, 1 reply; 7+ messages in thread
From: Steven Rostedt @ 2019-05-16  0:27 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: LKML, Ingo Molnar, Andrew Morton

On Wed, 15 May 2019 16:31:34 -0700
Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Wed, May 15, 2019 at 4:29 PM Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> >
> > One option is to just rewrite it something like
> >
> >         const unsigned int offset = offsetof(struct trace_iterator, seq);
> >         memset(offset+(void *)&iter, 0, sizeof(iter) - offset);  
> 
> Side note: make it a well-named helper function, since
> "ftrace_dump_buf()" does this too in kernel/trace/trace_kdb.c, and

Good point, as they just cut and pasted some of this code.

I like the helper function, as it means I don't need to add the sub
part, as the function would be more contained.

> gets the exact same warning.
> 

I can do this, but it needs testing and all that before sending to you,
and may not make the merge window. Is that fine?

-- Steve

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [GIT PULL] tracing: Updates for 5.2
  2019-05-16  0:27     ` Steven Rostedt
@ 2019-05-16  1:21       ` Linus Torvalds
  0 siblings, 0 replies; 7+ messages in thread
From: Linus Torvalds @ 2019-05-16  1:21 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: LKML, Ingo Molnar, Andrew Morton

On Wed, May 15, 2019 at 5:27 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> I can do this, but it needs testing and all that before sending to you,
> and may not make the merge window. Is that fine?

It's fine. The warning is annoying, but that's my own fault for
updating my system just before the merge window.

                Linus

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [GIT PULL] tracing: Updates for 5.2
  2019-05-15 23:29 ` Linus Torvalds
  2019-05-15 23:31   ` Linus Torvalds
@ 2019-05-16  9:08   ` David Laight
  1 sibling, 0 replies; 7+ messages in thread
From: David Laight @ 2019-05-16  9:08 UTC (permalink / raw)
  To: 'Linus Torvalds', Steven Rostedt; +Cc: LKML, Ingo Molnar, Andrew Morton

> This code:
> 
>                 /* reset all but tr, trace, and overruns */
>                 memset(&iter.seq, 0,
>                        sizeof(struct trace_iterator) -
>                        offsetof(struct trace_iterator, seq));
> 
> not only has a completely misleading comment (it resets a lot more
> than the comment states), but modern gcc looks at that code and says
> "oh, you're passing it a pointer to 'iter.seq', but then clearing a
> lot more than a 'trace_seq'":
> 
>   In function ‘memset’,
>       inlined from ‘ftrace_dump’ at kernel/trace/trace.c:8914:3:
>  /include/linux/string.h:344:9: warning: ‘__builtin_memset’ offset
> [8505, 8560] from the object at ‘iter’ is out of the bounds of
> referenced subobject ‘seq’ with type ‘struct trace_seq’ at offset 4368
> [-Warray-bounds]
>     344 |  return __builtin_memset(p, c, size);
>         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> It's a somewhat annoying warning because the code itself is
> technically correct, but at the same time, I think the gcc warning is
> reasonable. You *are* passing it a 'struct trace_seq' pointer, and
> then you're clearing a whole lot more than that.
> 
> One option is to just rewrite it something like
> 
>         const unsigned int offset = offsetof(struct trace_iterator, seq);
>         memset(offset+(void *)&iter, 0, sizeof(iter) - offset);

I'd do (const char *)&iter + offset ...

A quick fix is (probably) just:
	memset((void *)(long)&iter.seq, ...

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-05-16  9:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-15 17:36 [GIT PULL] tracing: Updates for 5.2 Steven Rostedt
2019-05-15 23:29 ` Linus Torvalds
2019-05-15 23:31   ` Linus Torvalds
2019-05-16  0:27     ` Steven Rostedt
2019-05-16  1:21       ` Linus Torvalds
2019-05-16  9:08   ` David Laight
2019-05-15 23:50 ` pr-tracker-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).